#include <fstream>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <sys/time.h>

#include <cuda_runtime.h>

#define BLOCK_DIM 8 

__device__ double c(const double x, const double y) {
	//if ((y > 1.0) && (y <= 1.2)) return 0.8;
	//if ((y > 0.5) && (y <= 0.8) && (x > 0.2) && (x <= 0.5)) return 1.0;
	return 1.0;
}

__device__ double v(const double x, const double t) {
	//if (5*t < 2*M_PI) return sin(5*t) * exp(-30*(x-0.5)*(x-0.5));
	return 1.0;
}

__global__ void calcNodeSimple(double *prev, double *curr, double *next, 
                               const double h_x, const double h_y,
                               const double tau, const double time,
                               const int N, const int M) {
	unsigned int i = (blockIdx.x * blockDim.x) + threadIdx.x;
	unsigned int j = (blockIdx.y * blockDim.y) + threadIdx.y;
	if ( (i <= N) && (j <= M) ) {
		unsigned int ind = j*(N+1) + i; // 1D-index
		if (j == M) 
			next[ind] = v(i*h_x, time);
		else if (j == 0) 
			next[ind] = curr[ind] 
				  + c(i*h_x, j*h_y) * tau / h_y * (curr[(j+1)*(N+1) + i] - curr[ind]);
		else if (i == 0) 
			next[ind] = curr[ind] 
				  + c(i*h_x, j*h_y) * tau / h_x * (curr[j*(N+1) + i+1] - curr[ind]);
		else if (i == N) 
			next[ind] = curr[ind] 
				  - c(i*h_x, j*h_y) * tau / h_x * (curr[ind] - curr[j*(N+1) + i-1]);
		else  
			next[ind] = 2 * curr[ind] - prev[ind]
				  + c(i*h_x, j*h_y)*c(i*h_x, j*h_y) * tau*tau / (h_x*h_x) * 
				      (curr[j*(N+1) + i+1] - 2*curr[ind] + curr[j*(N+1) + i-1])
				  + c(i*h_x, j*h_y)*c(i*h_x, j*h_y) * tau*tau / (h_y*h_y) * 
				      (curr[(j+1)*(N+1) + i] - 2*curr[ind] + curr[(j-1)*(N+1) + i]);
	}
}

__global__ void calcNode(double *prev, double *curr, double *next, 
                         const double h_x, const double h_y,
                         const double tau, const double time,
                         const int N, const int M) {
	unsigned int i = (blockIdx.x * blockDim.x) + threadIdx.x;
	unsigned int j = (blockIdx.y * blockDim.y) + threadIdx.y;
	if (i <= N && j <= M) {
		unsigned int ind = j*(N+1) + i; // 1D-index
		__shared__ double sc[BLOCK_DIM+2][BLOCK_DIM+2];
		double n, u; // values on the next and current time layers in that node
		double p = prev[ind];
		// Copy values of that block to shared memory
		u = sc[threadIdx.x+1][threadIdx.y+1] = curr[ind];

		// Copy necessary values of neighbour blocks to shared memory
		if (threadIdx.x == 0) {
			sc[0][threadIdx.y+1] = 0;
			if (i != 0) sc[0][threadIdx.y+1] = curr[j*(N+1) + i-1];
		}
		if (threadIdx.x == blockDim.x-1) {
			sc[blockDim.x+1][threadIdx.y+1] = 0;
			if (i != N) sc[blockDim.x+1][threadIdx.y+1] = curr[j*(N+1) + i+1];
		}
		if (threadIdx.y == 0) {
			sc[threadIdx.x+1][0] = 0;
			if (j != 0) sc[threadIdx.x+1][0] = curr[(j-1)*(N+1) + i];
		}	
		if (threadIdx.y == blockDim.y-1) {
			sc[threadIdx.x+1][blockDim.y+1] = 0;
			if (j != M) sc[threadIdx.x+1][blockDim.y+1] = curr[(j+1)*(N+1) + i];
		}

		__syncthreads();
		// Calculate next time step
		if (j == M) 
			n = v(i*h_x, time);
		else if (j == 0) 
			n = u + c(i*h_x, j*h_y) * tau / h_y * 
			                             (sc[threadIdx.x+1][threadIdx.y+2] - u);
		else if (i == 0) 
			n = u + c(i*h_x, j*h_y) * tau / h_x * 
			                             (sc[threadIdx.x+2][threadIdx.y+1] - u);
		else if (i == N) 
			n = u - c(i*h_x, j*h_y) * tau / h_x * 
			                               (u - sc[threadIdx.x][threadIdx.y+1]);
		else
			n = 2 * u - p
			  + c(i*h_x, j*h_y)*c(i*h_x, j*h_y) * tau*tau / (h_x*h_x) * 
			      (sc[threadIdx.x+2][threadIdx.y+1] - 2*u + sc[threadIdx.x][threadIdx.y+1])
			  + c(i*h_x, j*h_y)*c(i*h_x, j*h_y) * tau*tau / (h_y*h_y) * 
			      (sc[threadIdx.x+1][threadIdx.y+2] - 2*u + sc[threadIdx.x+1][threadIdx.y]);
		
		// Copy calculated value to global memory
		next[ind] = n;
	}
}

template<typename T>
static void put(std::fstream &f, const T value) {
	union {
		char buf[sizeof(T)];
		T val;
	} helper;
	helper.val = value;
	std::reverse(helper.buf, helper.buf + sizeof(T));
	f.write(helper.buf, sizeof(T));
}

void save(const char *prefix, int step, double *a,
          const double &h_x, const double &h_y,
          const int N, const int M) {
	char buffer[50];
	sprintf(buffer, "%s.%05d.vtk", prefix, step);
	std::fstream f(buffer, std::ios::out);
	if (!f) {
		std::cerr << "Unable to open file " << buffer << std::endl;
		return;
	}
	f << "# vtk DataFile Version 3.0" << std::endl;
	f << "U data" << std::endl;
	f << "BINARY" << std::endl;
	f << "DATASET STRUCTURED_POINTS" << std::endl;
	f << "DIMENSIONS " << N+1 << " " << M+1 << " 1" << std::endl;
	f << "SPACING " << h_x << " " << h_y << " 1" << std::endl;
	f << "ORIGIN 0 0 0" << std::endl;
	f << "POINT_DATA " << (N+1) * (M+1) << std::endl;
	f << "SCALARS u double" << std::endl;
	f << "LOOKUP_TABLE default" << std::endl;
	for (int j = 0 ; j < M+1; j++){
		for (int i = 0; i < N+1; i++)
			put(f, a[j*(N+1) + i]);
	}
	f.close();
}

/**
 * Calculate the process, save results.
 */
void calculate(double *prev, double *curr, double *next,
               double *hostData, const int N, const int M) {
	const double h_x = 0.01;
	const double h_y = 0.005;
	const double tau = h_y / 2.0;
	const double T = 5.0;
	double curTime = 0.0;
	int counter = 0;
	double visualisationStep = T / 100;
	float maxTime = 0;
	float avgTime = 0;
	float minTime = 9e+9;
	std::cout << "Max time of kernel execution:\nstep\ttime\n";
	while (curTime <= T) {
		dim3 threadsPerBlock(BLOCK_DIM, BLOCK_DIM);
		dim3 numBlocks(N/threadsPerBlock.x + 1, M/threadsPerBlock.y + 1); 
		
		// Cuda Events for measuring of execution time
		cudaEvent_t start, stop;
		cudaEventCreate(&start);
		cudaEventCreate(&stop);
		
		cudaEventRecord(start);
		calcNode <<<numBlocks, threadsPerBlock>>> 
		                    (prev, curr, next, h_x, h_y, tau, curTime, N, M);
		cudaEventRecord(stop);
		
		// Evaluating execution time
		cudaEventSynchronize(stop);
		float milliseconds = 0;
		cudaEventElapsedTime(&milliseconds, start, stop);
		if (maxTime < milliseconds)
			std::cout << curTime/tau << "\t" << milliseconds << "\n";
		maxTime = (maxTime > milliseconds) ? maxTime : milliseconds;
		minTime = (minTime < milliseconds) ? minTime : milliseconds;
		avgTime += milliseconds / (T / tau);
		
		double *tmp = prev;
		prev = curr;
		curr = next;
		next = tmp;

		if ( fabs(curTime - counter * visualisationStep) < 1e-5 ) {
			cudaError_t err = cudaMemcpy(hostData, prev, 
			                             (N+1) * (M+1) * sizeof (double),
			                             cudaMemcpyDeviceToHost);
			if (err != cudaSuccess) {
				fprintf(stderr, "Failed to copy data from device to host",
					"(error code %s)!\n", cudaGetErrorString(err));
				exit(EXIT_FAILURE);
			}

			save("output", counter, hostData, h_x, h_y, N, M);
			counter++;
		}
		curTime += tau;
 	}
	std::cout << "Kernel execution in milliseconds:\nmax time = " << maxTime << 
	             "\navg time = " << avgTime << "\nmin time = " << minTime << "\n";
}

double mtime()
{
  struct timeval t;

  gettimeofday(&t, NULL);
  double mt = (double) (t.tv_sec) * 1000 + (double) t.tv_usec / 1000;
  return mt;
}

int main(int argc, char **argv) {
	const int N = 1000;
	const int M = 4000;
	size_t size = (N+1) * (M+1) * sizeof (double);
	cudaError_t err = cudaSuccess;
	
	double *prev = NULL;
	err = cudaMalloc((void **) &prev, size);
	if (err != cudaSuccess) {
		fprintf(stderr, "Failed to allocate device memory!\n",
		        cudaGetErrorString(err));
		exit(EXIT_FAILURE);
	}

	double *curr = NULL;	
	err = cudaMalloc((void **) &curr, size);
	if (err != cudaSuccess) {
		fprintf(stderr, "Failed to allocate device memory!\n",
		        cudaGetErrorString(err));
		exit(EXIT_FAILURE);
	}

	double *next = NULL;	
	err = cudaMalloc((void **) &next, size);
	if (err != cudaSuccess) {
		fprintf(stderr, "Failed to allocate device memory!\n",
		        cudaGetErrorString(err));
		exit(EXIT_FAILURE);
	}

	double *hostData = new double[(N+1)*(M+1)];

	cudaMemset(prev, 0, size);	
	cudaMemset(curr, 0, size);	
	cudaMemset(next, 0, size);	
	memset(hostData, 0, size);
	
	double t1 = mtime();
	calculate(prev, curr, next, hostData, N, M);
	double t2 = mtime();
	std::cout << "Time of calculate() execution = " << t2 - t1 << std::endl;
	
	cudaFree(prev);
	cudaFree(curr);
	cudaFree(next);
	delete [] hostData;
}

	.file	"tmpxft_001fd59e_00000000-6_main.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4029:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4029:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4763:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4763:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z1cdd
	.type	_Z1cdd, @function
_Z1cdd:
.LFB4020:
	.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
.LFE4020:
	.size	_Z1cdd, .-_Z1cdd
	.globl	_Z1vdd
	.type	_Z1vdd, @function
_Z1vdd:
.LFB4762:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z1cdd
	.cfi_endproc
.LFE4762:
	.size	_Z1vdd, .-_Z1vdd
	.globl	_Z5mtimev
	.type	_Z5mtimev, @function
_Z5mtimev:
.LFB4025:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	gettimeofday@PLT
	cvtsi2sdq	16(%rsp), %xmm1
	movsd	.LC0(%rip), %xmm2
	cvtsi2sdq	8(%rsp), %xmm0
	divsd	%xmm2, %xmm1
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4025:
	.size	_Z5mtimev, .-_Z5mtimev
	.globl	_Z44__device_stub__Z14calcNodeSimplePdS_S_ddddiiPdS_S_ddddii
	.type	_Z44__device_stub__Z14calcNodeSimplePdS_S_ddddiiPdS_S_ddddii, @function
_Z44__device_stub__Z14calcNodeSimplePdS_S_ddddiiPdS_S_ddddii:
.LFB4051:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	%rdi, 56(%rsp)
	leaq	80(%rsp), %rdi
	movq	%rsi, 48(%rsp)
	leaq	92(%rsp), %rsi
	movq	%rdx, 40(%rsp)
	leaq	64(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	72(%rsp), %rcx
	movl	%r8d, (%rsp)
	movsd	%xmm0, 32(%rsp)
	movsd	%xmm1, 24(%rsp)
	movsd	%xmm2, 16(%rsp)
	movsd	%xmm3, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	movl	$1, 88(%rsp)
	movq	%rax, 128(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 184(%rsp)
	movq	%rsp, %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 80(%rsp)
	movq	%rax, 92(%rsp)
	movl	$1, 100(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L11
	pushq	72(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z14calcNodeSimplePdS_S_ddddii(%rip), %rdi
	pushq	72(%rsp)
	.cfi_def_cfa_offset 240
	movq	108(%rsp), %rcx
	movl	116(%rsp), %r8d
	movq	96(%rsp), %rsi
	movl	104(%rsp), %edx
	leaq	144(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L11:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4051:
	.size	_Z44__device_stub__Z14calcNodeSimplePdS_S_ddddiiPdS_S_ddddii, .-_Z44__device_stub__Z14calcNodeSimplePdS_S_ddddiiPdS_S_ddddii
	.globl	_Z14calcNodeSimplePdS_S_ddddii
	.type	_Z14calcNodeSimplePdS_S_ddddii, @function
_Z14calcNodeSimplePdS_S_ddddii:
.LFB4052:
	.cfi_startproc
	endbr64
	jmp	_Z44__device_stub__Z14calcNodeSimplePdS_S_ddddiiPdS_S_ddddii
	.cfi_endproc
.LFE4052:
	.size	_Z14calcNodeSimplePdS_S_ddddii, .-_Z14calcNodeSimplePdS_S_ddddii
	.globl	_Z37__device_stub__Z8calcNodePdS_S_ddddiiPdS_S_ddddii
	.type	_Z37__device_stub__Z8calcNodePdS_S_ddddiiPdS_S_ddddii, @function
_Z37__device_stub__Z8calcNodePdS_S_ddddiiPdS_S_ddddii:
.LFB4053:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	%rdi, 56(%rsp)
	leaq	80(%rsp), %rdi
	movq	%rsi, 48(%rsp)
	leaq	92(%rsp), %rsi
	movq	%rdx, 40(%rsp)
	leaq	64(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	72(%rsp), %rcx
	movl	%r8d, (%rsp)
	movsd	%xmm0, 32(%rsp)
	movsd	%xmm1, 24(%rsp)
	movsd	%xmm2, 16(%rsp)
	movsd	%xmm3, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	movl	$1, 88(%rsp)
	movq	%rax, 128(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 184(%rsp)
	movq	%rsp, %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 80(%rsp)
	movq	%rax, 92(%rsp)
	movl	$1, 100(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	pushq	72(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z8calcNodePdS_S_ddddii(%rip), %rdi
	pushq	72(%rsp)
	.cfi_def_cfa_offset 240
	movq	108(%rsp), %rcx
	movl	116(%rsp), %r8d
	movq	96(%rsp), %rsi
	movl	104(%rsp), %edx
	leaq	144(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L16:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4053:
	.size	_Z37__device_stub__Z8calcNodePdS_S_ddddiiPdS_S_ddddii, .-_Z37__device_stub__Z8calcNodePdS_S_ddddiiPdS_S_ddddii
	.globl	_Z8calcNodePdS_S_ddddii
	.type	_Z8calcNodePdS_S_ddddii, @function
_Z8calcNodePdS_S_ddddii:
.LFB4054:
	.cfi_startproc
	endbr64
	jmp	_Z37__device_stub__Z8calcNodePdS_S_ddddiiPdS_S_ddddii
	.cfi_endproc
.LFE4054:
	.size	_Z8calcNodePdS_S_ddddii, .-_Z8calcNodePdS_S_ddddii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"_Z8calcNodePdS_S_ddddii"
.LC2:
	.string	"_Z14calcNodeSimplePdS_S_ddddii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4056:
	.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	.LC1(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z8calcNodePdS_S_ddddii(%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	.LC2(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z14calcNodeSimplePdS_S_ddddii(%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
.LFE4056:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC3:
	.string	"%s.%05d.vtk"
.LC4:
	.string	"Unable to open file "
.LC5:
	.string	"# vtk DataFile Version 3.0"
.LC6:
	.string	"U data"
.LC7:
	.string	"BINARY"
.LC8:
	.string	"DATASET STRUCTURED_POINTS"
.LC9:
	.string	"DIMENSIONS "
.LC10:
	.string	" "
.LC11:
	.string	" 1"
.LC12:
	.string	"SPACING "
.LC13:
	.string	"ORIGIN 0 0 0"
.LC14:
	.string	"POINT_DATA "
.LC15:
	.string	"SCALARS u double"
.LC16:
	.string	"LOOKUP_TABLE default"
	.text
	.globl	_Z4savePKciPdRKdS3_ii
	.type	_Z4savePKciPdRKdS3_ii, @function
_Z4savePKciPdRKdS3_ii:
.LFB4023:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4023
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rcx, %r14
	leaq	.LC3(%rip), %rcx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r8, %r12
	movq	%rdi, %r8
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%r9d, %ebp
	movl	%esi, %r9d
	movl	$2, %esi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$648, %rsp
	.cfi_def_cfa_offset 704
	movq	%rdx, 24(%rsp)
	leaq	582(%rsp), %rbx
	movl	$50, %edx
	movq	%rbx, %rdi
	movq	%fs:40, %rax
	movq	%rax, 632(%rsp)
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	leaq	48(%rsp), %rax
	movl	$16, %edx
	movq	%rbx, %rsi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
.LEHB0:
	call	_ZNSt13basic_fstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE0:
	movl	344(%rsp), %eax
	andl	$5, %eax
	movl	%eax, 20(%rsp)
	je	.L24
	leaq	.LC4(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
.LEHB1:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%rbx, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L31:
	movq	8(%rsp), %rdi
	call	_ZNSt13basic_fstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	632(%rsp), %rax
	subq	%fs:40, %rax
	je	.L34
	jmp	.L36
.L24:
	leaq	64(%rsp), %rax
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	(%rsp), %rdi
	leaq	.LC6(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	(%rsp), %rdi
	leaq	.LC7(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	(%rsp), %rdi
	leaq	.LC8(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	(%rsp), %rdi
	leaq	.LC9(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leal	1(%rbp), %r13d
	movq	%rax, %rdi
	movl	%r13d, %esi
	call	_ZNSolsEi@PLT
	leaq	.LC10(%rip), %r15
	movq	%rax, %rdi
	movq	%r15, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	704(%rsp), %eax
	leal	1(%rax), %ebx
	movl	%ebx, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	(%rsp), %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	(%r14), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	movq	%r15, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	(%r12), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	(%rsp), %rdi
	leaq	.LC13(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	(%rsp), %rdi
	leaq	.LC14(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	imull	%r13d, %ebx
	movq	%rax, %rdi
	movl	%ebx, %esi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	(%rsp), %rdi
	leaq	.LC15(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	(%rsp), %rdi
	leaq	.LC16(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	xorl	%r12d, %r12d
	leaq	44(%rsp), %r15
.L25:
	movl	20(%rsp), %eax
	cmpl	704(%rsp), %eax
	jg	.L29
	movq	24(%rsp), %rcx
	movslq	%r12d, %rax
	xorl	%ebx, %ebx
	leaq	(%rcx,%rax,8), %r14
.L30:
	cmpl	%ebx, %ebp
	jl	.L38
	movsd	(%r14,%rbx,8), %xmm0
	leaq	40(%rsp), %rax
	movq	%rax, %rdx
	movq	%rax, %rsi
	movsd	%xmm0, 40(%rsp)
.L26:
	decq	%rax
	cmpq	%r15, %rdx
	je	.L39
	movb	(%rdx), %cl
	movb	8(%rax), %dil
	incq	%rdx
	movb	%dil, -1(%rdx)
	movb	%cl, 8(%rax)
	jmp	.L26
.L39:
	leaq	64(%rsp), %rdi
	movl	$8, %edx
	call	_ZNSo5writeEPKcl@PLT
	incq	%rbx
	jmp	.L30
.L38:
	incl	20(%rsp)
	addl	%r13d, %r12d
	jmp	.L25
.L29:
	leaq	48(%rsp), %rdi
	call	_ZNSt13basic_fstreamIcSt11char_traitsIcEE5closeEv@PLT
.LEHE1:
	jmp	.L31
.L35:
	endbr64
	movq	%rax, %rbx
.L32:
	movq	8(%rsp), %rdi
	call	_ZNSt13basic_fstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	632(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L36:
	call	__stack_chk_fail@PLT
.L34:
	addq	$648, %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
.LFE4023:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4023:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4023-.LLSDACSB4023
.LLSDACSB4023:
	.uleb128 .LEHB0-.LFB4023
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4023
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L35-.LFB4023
	.uleb128 0
	.uleb128 .LEHB2-.LFB4023
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE4023:
	.text
	.size	_Z4savePKciPdRKdS3_ii, .-_Z4savePKciPdRKdS3_ii
	.section	.rodata.str1.1
.LC22:
	.string	"Max time of kernel execution:\nstep\ttime\n"
.LC24:
	.string	"\t"
.LC25:
	.string	"\n"
.LC30:
	.string	"(error code %s)!\n"
.LC31:
	.string	"Failed to copy data from device to host"
.LC32:
	.string	"output"
.LC34:
	.string	"Kernel execution in milliseconds:\nmax time = "
.LC35:
	.string	"\navg time = "
.LC36:
	.string	"\nmin time = "
	.text
	.globl	_Z9calculatePdS_S_S_ii
	.type	_Z9calculatePdS_S_S_ii, @function
_Z9calculatePdS_S_S_ii:
.LFB4024:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	leaq	_ZSt4cout(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%r9d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%r8d, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	leaq	.LC22(%rip), %rsi
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%rcx, 24(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	movq	.LC20(%rip), %rax
	movq	%rax, 64(%rsp)
	movq	.LC21(%rip), %rax
	movq	%rax, 72(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %eax
	leal	1(%r12), %edx
	movss	.LC17(%rip), %xmm7
	shrl	$3, %eax
	movl	$0x00000000, 20(%rsp)
	incl	%eax
	movl	$0x00000000, 12(%rsp)
	movl	%eax, 32(%rsp)
	movl	%ebp, %eax
	shrl	$3, %eax
	movq	$0x000000000, (%rsp)
	incl	%eax
	movss	%xmm7, 16(%rsp)
	movl	%eax, 36(%rsp)
	leal	1(%rbp), %eax
	imull	%edx, %eax
	cltq
	salq	$3, %rax
	movq	%rax, 40(%rsp)
.L51:
	movl	36(%rsp), %eax
	leaq	80(%rsp), %rdi
	movl	$1, 116(%rsp)
	movl	%eax, 108(%rsp)
	movl	32(%rsp), %eax
	movl	%eax, 112(%rsp)
	call	cudaEventCreate@PLT
	leaq	88(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	80(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	108(%rsp), %rdi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	116(%rsp), %esi
	movl	$1, %ecx
	movabsq	$34359738376, %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L41
	movsd	(%rsp), %xmm3
	movl	%r12d, %r8d
	movl	%ebp, %ecx
	movq	%r13, %rdx
	movsd	.LC23(%rip), %xmm2
	movsd	.LC21(%rip), %xmm1
	movq	%rbx, %rsi
	movq	%r14, %rdi
	movsd	.LC20(%rip), %xmm0
	call	_Z37__device_stub__Z8calcNodePdS_S_ddddiiPdS_S_ddddii
.L41:
	movq	88(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	88(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	88(%rsp), %rdx
	movq	80(%rsp), %rsi
	leaq	60(%rsp), %rdi
	movl	$0x00000000, 60(%rsp)
	call	cudaEventElapsedTime@PLT
	movss	60(%rsp), %xmm0
	comiss	12(%rsp), %xmm0
	jbe	.L42
	leaq	_ZSt4cout(%rip), %rdi
	movsd	(%rsp), %xmm0
	divsd	.LC23(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC24(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	60(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC25(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L42:
	movss	60(%rsp), %xmm0
	movss	12(%rsp), %xmm4
	cvtss2sd	20(%rsp), %xmm1
	movss	16(%rsp), %xmm5
	maxss	%xmm0, %xmm4
	minss	%xmm0, %xmm5
	cvtss2sd	%xmm0, %xmm0
	divsd	.LC26(%rip), %xmm0
	addsd	%xmm1, %xmm0
	cvtsi2sdl	%r15d, %xmm1
	mulsd	.LC27(%rip), %xmm1
	movss	%xmm4, 12(%rsp)
	cvtsd2ss	%xmm0, %xmm3
	movsd	(%rsp), %xmm0
	movss	%xmm5, 16(%rsp)
	movss	%xmm3, 20(%rsp)
	subsd	%xmm1, %xmm0
	movsd	.LC29(%rip), %xmm1
	andps	.LC28(%rip), %xmm0
	comisd	%xmm0, %xmm1
	jbe	.L48
	movq	24(%rsp), %rdi
	movq	40(%rsp), %rdx
	movl	$2, %ecx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L50
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC30(%rip), %rcx
	movq	%rax, %r8
	leaq	.LC31(%rip), %rdx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L50:
	leaq	64(%rsp), %rcx
	pushq	%rax
	.cfi_def_cfa_offset 200
	movl	%r15d, %esi
	movl	%ebp, %r9d
	pushq	%r12
	.cfi_def_cfa_offset 208
	movq	40(%rsp), %rdx
	leaq	.LC32(%rip), %rdi
	incl	%r15d
	leaq	88(%rsp), %r8
	call	_Z4savePKciPdRKdS3_ii
	popq	%rdx
	.cfi_def_cfa_offset 200
	popq	%rcx
	.cfi_def_cfa_offset 192
.L48:
	movsd	.LC23(%rip), %xmm6
	addsd	(%rsp), %xmm6
	movq	%rbx, %rax
	movq	%r13, %rbx
	movsd	.LC33(%rip), %xmm0
	movq	%r14, %r13
	comisd	%xmm6, %xmm0
	movsd	%xmm6, (%rsp)
	jb	.L60
	movq	%rax, %r14
	jmp	.L51
.L60:
	leaq	.LC34(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	12(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC35(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	20(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC36(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	16(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L52
	call	__stack_chk_fail@PLT
.L52:
	addq	$136, %rsp
	.cfi_def_cfa_offset 56
	leaq	.LC25(%rip), %rsi
	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
	jmp	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	.cfi_endproc
.LFE4024:
	.size	_Z9calculatePdS_S_S_ii, .-_Z9calculatePdS_S_S_ii
	.section	.rodata.str1.1
.LC37:
	.string	"Failed to allocate device memory!\n"
.LC38:
	.string	"Time of calculate() execution = "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4026:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%ecx, %ecx
	movl	$32040008, %esi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	movq	%rcx, 16(%rsp)
	call	cudaMalloc@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L68
	xorl	%edx, %edx
	leaq	24(%rsp), %rdi
	movl	$32040008, %esi
	movq	%rdx, 24(%rsp)
	call	cudaMalloc@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L68
	xorl	%eax, %eax
	leaq	32(%rsp), %rdi
	movl	$32040008, %esi
	movq	%rax, 32(%rsp)
	call	cudaMalloc@PLT
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L64
	movl	%eax, %edi
.L68:
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC37(%rip), %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L64:
	movl	$32040008, %edi
	call	_Znam@PLT
	movq	16(%rsp), %rdi
	xorl	%esi, %esi
	movl	$32040008, %edx
	movq	%rax, %rbx
	call	cudaMemset@PLT
	movq	24(%rsp), %rdi
	xorl	%esi, %esi
	movl	$32040008, %edx
	call	cudaMemset@PLT
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	movl	$32040008, %edx
	call	cudaMemset@PLT
	movl	%ebp, %eax
	movl	$8010002, %ecx
	movq	%rbx, %rdi
	rep stosl
	call	_Z5mtimev
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	$4000, %r9d
	movq	16(%rsp), %rdi
	movl	$1000, %r8d
	movq	%rbx, %rcx
	movsd	%xmm0, (%rsp)
	call	_Z9calculatePdS_S_S_ii
	call	_Z5mtimev
	leaq	.LC38(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movsd	%xmm0, 8(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	8(%rsp), %xmm0
	subsd	(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	%rbx, %rdi
	call	_ZdaPv@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L65
	call	__stack_chk_fail@PLT
.L65:
	addq	$56, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4026:
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1083129856
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC17:
	.long	1342577734
	.section	.rodata.cst8
	.align 8
.LC20:
	.long	1202590843
	.long	1065646817
	.align 8
.LC21:
	.long	1202590843
	.long	1064598241
	.align 8
.LC23:
	.long	1202590843
	.long	1063549665
	.align 8
.LC26:
	.long	0
	.long	1084178432
	.align 8
.LC27:
	.long	-1717986918
	.long	1068079513
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC28:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC29:
	.long	-1998362383
	.long	1055193269
	.align 8
.LC33:
	.long	0
	.long	1075052544
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <fstream>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <sys/time.h>

#include <hip/hip_runtime.h>

#define BLOCK_DIM 8 

__device__ double c(const double x, const double y) {
	//if ((y > 1.0) && (y <= 1.2)) return 0.8;
	//if ((y > 0.5) && (y <= 0.8) && (x > 0.2) && (x <= 0.5)) return 1.0;
	return 1.0;
}

__device__ double v(const double x, const double t) {
	//if (5*t < 2*M_PI) return sin(5*t) * exp(-30*(x-0.5)*(x-0.5));
	return 1.0;
}

__global__ void calcNodeSimple(double *prev, double *curr, double *next, 
                               const double h_x, const double h_y,
                               const double tau, const double time,
                               const int N, const int M) {
	unsigned int i = (blockIdx.x * blockDim.x) + threadIdx.x;
	unsigned int j = (blockIdx.y * blockDim.y) + threadIdx.y;
	if ( (i <= N) && (j <= M) ) {
		unsigned int ind = j*(N+1) + i; // 1D-index
		if (j == M) 
			next[ind] = v(i*h_x, time);
		else if (j == 0) 
			next[ind] = curr[ind] 
				  + c(i*h_x, j*h_y) * tau / h_y * (curr[(j+1)*(N+1) + i] - curr[ind]);
		else if (i == 0) 
			next[ind] = curr[ind] 
				  + c(i*h_x, j*h_y) * tau / h_x * (curr[j*(N+1) + i+1] - curr[ind]);
		else if (i == N) 
			next[ind] = curr[ind] 
				  - c(i*h_x, j*h_y) * tau / h_x * (curr[ind] - curr[j*(N+1) + i-1]);
		else  
			next[ind] = 2 * curr[ind] - prev[ind]
				  + c(i*h_x, j*h_y)*c(i*h_x, j*h_y) * tau*tau / (h_x*h_x) * 
				      (curr[j*(N+1) + i+1] - 2*curr[ind] + curr[j*(N+1) + i-1])
				  + c(i*h_x, j*h_y)*c(i*h_x, j*h_y) * tau*tau / (h_y*h_y) * 
				      (curr[(j+1)*(N+1) + i] - 2*curr[ind] + curr[(j-1)*(N+1) + i]);
	}
}

__global__ void calcNode(double *prev, double *curr, double *next, 
                         const double h_x, const double h_y,
                         const double tau, const double time,
                         const int N, const int M) {
	unsigned int i = (blockIdx.x * blockDim.x) + threadIdx.x;
	unsigned int j = (blockIdx.y * blockDim.y) + threadIdx.y;
	if (i <= N && j <= M) {
		unsigned int ind = j*(N+1) + i; // 1D-index
		__shared__ double sc[BLOCK_DIM+2][BLOCK_DIM+2];
		double n, u; // values on the next and current time layers in that node
		double p = prev[ind];
		// Copy values of that block to shared memory
		u = sc[threadIdx.x+1][threadIdx.y+1] = curr[ind];

		// Copy necessary values of neighbour blocks to shared memory
		if (threadIdx.x == 0) {
			sc[0][threadIdx.y+1] = 0;
			if (i != 0) sc[0][threadIdx.y+1] = curr[j*(N+1) + i-1];
		}
		if (threadIdx.x == blockDim.x-1) {
			sc[blockDim.x+1][threadIdx.y+1] = 0;
			if (i != N) sc[blockDim.x+1][threadIdx.y+1] = curr[j*(N+1) + i+1];
		}
		if (threadIdx.y == 0) {
			sc[threadIdx.x+1][0] = 0;
			if (j != 0) sc[threadIdx.x+1][0] = curr[(j-1)*(N+1) + i];
		}	
		if (threadIdx.y == blockDim.y-1) {
			sc[threadIdx.x+1][blockDim.y+1] = 0;
			if (j != M) sc[threadIdx.x+1][blockDim.y+1] = curr[(j+1)*(N+1) + i];
		}

		__syncthreads();
		// Calculate next time step
		if (j == M) 
			n = v(i*h_x, time);
		else if (j == 0) 
			n = u + c(i*h_x, j*h_y) * tau / h_y * 
			                             (sc[threadIdx.x+1][threadIdx.y+2] - u);
		else if (i == 0) 
			n = u + c(i*h_x, j*h_y) * tau / h_x * 
			                             (sc[threadIdx.x+2][threadIdx.y+1] - u);
		else if (i == N) 
			n = u - c(i*h_x, j*h_y) * tau / h_x * 
			                               (u - sc[threadIdx.x][threadIdx.y+1]);
		else
			n = 2 * u - p
			  + c(i*h_x, j*h_y)*c(i*h_x, j*h_y) * tau*tau / (h_x*h_x) * 
			      (sc[threadIdx.x+2][threadIdx.y+1] - 2*u + sc[threadIdx.x][threadIdx.y+1])
			  + c(i*h_x, j*h_y)*c(i*h_x, j*h_y) * tau*tau / (h_y*h_y) * 
			      (sc[threadIdx.x+1][threadIdx.y+2] - 2*u + sc[threadIdx.x+1][threadIdx.y]);
		
		// Copy calculated value to global memory
		next[ind] = n;
	}
}

template<typename T>
static void put(std::fstream &f, const T value) {
	union {
		char buf[sizeof(T)];
		T val;
	} helper;
	helper.val = value;
	std::reverse(helper.buf, helper.buf + sizeof(T));
	f.write(helper.buf, sizeof(T));
}

void save(const char *prefix, int step, double *a,
          const double &h_x, const double &h_y,
          const int N, const int M) {
	char buffer[50];
	sprintf(buffer, "%s.%05d.vtk", prefix, step);
	std::fstream f(buffer, std::ios::out);
	if (!f) {
		std::cerr << "Unable to open file " << buffer << std::endl;
		return;
	}
	f << "# vtk DataFile Version 3.0" << std::endl;
	f << "U data" << std::endl;
	f << "BINARY" << std::endl;
	f << "DATASET STRUCTURED_POINTS" << std::endl;
	f << "DIMENSIONS " << N+1 << " " << M+1 << " 1" << std::endl;
	f << "SPACING " << h_x << " " << h_y << " 1" << std::endl;
	f << "ORIGIN 0 0 0" << std::endl;
	f << "POINT_DATA " << (N+1) * (M+1) << std::endl;
	f << "SCALARS u double" << std::endl;
	f << "LOOKUP_TABLE default" << std::endl;
	for (int j = 0 ; j < M+1; j++){
		for (int i = 0; i < N+1; i++)
			put(f, a[j*(N+1) + i]);
	}
	f.close();
}

/**
 * Calculate the process, save results.
 */
void calculate(double *prev, double *curr, double *next,
               double *hostData, const int N, const int M) {
	const double h_x = 0.01;
	const double h_y = 0.005;
	const double tau = h_y / 2.0;
	const double T = 5.0;
	double curTime = 0.0;
	int counter = 0;
	double visualisationStep = T / 100;
	float maxTime = 0;
	float avgTime = 0;
	float minTime = 9e+9;
	std::cout << "Max time of kernel execution:\nstep\ttime\n";
	while (curTime <= T) {
		dim3 threadsPerBlock(BLOCK_DIM, BLOCK_DIM);
		dim3 numBlocks(N/threadsPerBlock.x + 1, M/threadsPerBlock.y + 1); 
		
		// Cuda Events for measuring of execution time
		hipEvent_t start, stop;
		hipEventCreate(&start);
		hipEventCreate(&stop);
		
		hipEventRecord(start);
		calcNode <<<numBlocks, threadsPerBlock>>> 
		                    (prev, curr, next, h_x, h_y, tau, curTime, N, M);
		hipEventRecord(stop);
		
		// Evaluating execution time
		hipEventSynchronize(stop);
		float milliseconds = 0;
		hipEventElapsedTime(&milliseconds, start, stop);
		if (maxTime < milliseconds)
			std::cout << curTime/tau << "\t" << milliseconds << "\n";
		maxTime = (maxTime > milliseconds) ? maxTime : milliseconds;
		minTime = (minTime < milliseconds) ? minTime : milliseconds;
		avgTime += milliseconds / (T / tau);
		
		double *tmp = prev;
		prev = curr;
		curr = next;
		next = tmp;

		if ( fabs(curTime - counter * visualisationStep) < 1e-5 ) {
			hipError_t err = hipMemcpy(hostData, prev, 
			                             (N+1) * (M+1) * sizeof (double),
			                             hipMemcpyDeviceToHost);
			if (err != hipSuccess) {
				fprintf(stderr, "Failed to copy data from device to host",
					"(error code %s)!\n", hipGetErrorString(err));
				exit(EXIT_FAILURE);
			}

			save("output", counter, hostData, h_x, h_y, N, M);
			counter++;
		}
		curTime += tau;
 	}
	std::cout << "Kernel execution in milliseconds:\nmax time = " << maxTime << 
	             "\navg time = " << avgTime << "\nmin time = " << minTime << "\n";
}

double mtime()
{
  struct timeval t;

  gettimeofday(&t, NULL);
  double mt = (double) (t.tv_sec) * 1000 + (double) t.tv_usec / 1000;
  return mt;
}

int main(int argc, char **argv) {
	const int N = 1000;
	const int M = 4000;
	size_t size = (N+1) * (M+1) * sizeof (double);
	hipError_t err = hipSuccess;
	
	double *prev = NULL;
	err = hipMalloc((void **) &prev, size);
	if (err != hipSuccess) {
		fprintf(stderr, "Failed to allocate device memory!\n",
		        hipGetErrorString(err));
		exit(EXIT_FAILURE);
	}

	double *curr = NULL;	
	err = hipMalloc((void **) &curr, size);
	if (err != hipSuccess) {
		fprintf(stderr, "Failed to allocate device memory!\n",
		        hipGetErrorString(err));
		exit(EXIT_FAILURE);
	}

	double *next = NULL;	
	err = hipMalloc((void **) &next, size);
	if (err != hipSuccess) {
		fprintf(stderr, "Failed to allocate device memory!\n",
		        hipGetErrorString(err));
		exit(EXIT_FAILURE);
	}

	double *hostData = new double[(N+1)*(M+1)];

	hipMemset(prev, 0, size);	
	hipMemset(curr, 0, size);	
	hipMemset(next, 0, size);	
	memset(hostData, 0, size);
	
	double t1 = mtime();
	calculate(prev, curr, next, hostData, N, M);
	double t2 = mtime();
	std::cout << "Time of calculate() execution = " << t2 - t1 << std::endl;
	
	hipFree(prev);
	hipFree(curr);
	hipFree(next);
	delete [] hostData;
}

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

                                        # End of file scope inline assembly
	.globl	_Z29__device_stub__calcNodeSimplePdS_S_ddddii # -- Begin function _Z29__device_stub__calcNodeSimplePdS_S_ddddii
	.type	_Z29__device_stub__calcNodeSimplePdS_S_ddddii,@function
_Z29__device_stub__calcNodeSimplePdS_S_ddddii: # @_Z29__device_stub__calcNodeSimplePdS_S_ddddii
	.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	$192, %rsp
	.cfi_def_cfa_offset 240
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	72(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	64(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	56(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	48(%rsp), %rdx
	movsd	%xmm0, (%rdx)
	leaq	40(%rsp), %r9
	movsd	%xmm1, (%r9)
	leaq	32(%rsp), %r10
	movsd	%xmm2, (%r10)
	leaq	24(%rsp), %r11
	movsd	%xmm3, (%r11)
	leaq	4(%rsp), %r14
	movl	%ecx, (%r14)
	movq	%rsp, %rcx
	movl	%r8d, (%rcx)
	leaq	112(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%r9, 32(%rbx)
	movq	%r10, 40(%rbx)
	movq	%r11, 48(%rbx)
	movq	%r14, 56(%rbx)
	movq	%rcx, 64(%rbx)
	leaq	96(%rsp), %r14
	leaq	80(%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	$_Z14calcNodeSimplePdS_S_ddddii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$208, %rsp
	.cfi_adjust_cfa_offset -208
	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	_Z29__device_stub__calcNodeSimplePdS_S_ddddii, .Lfunc_end0-_Z29__device_stub__calcNodeSimplePdS_S_ddddii
	.cfi_endproc
                                        # -- End function
	.globl	_Z23__device_stub__calcNodePdS_S_ddddii # -- Begin function _Z23__device_stub__calcNodePdS_S_ddddii
	.type	_Z23__device_stub__calcNodePdS_S_ddddii,@function
_Z23__device_stub__calcNodePdS_S_ddddii: # @_Z23__device_stub__calcNodePdS_S_ddddii
	.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	$192, %rsp
	.cfi_def_cfa_offset 240
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	72(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	64(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	56(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	48(%rsp), %rdx
	movsd	%xmm0, (%rdx)
	leaq	40(%rsp), %r9
	movsd	%xmm1, (%r9)
	leaq	32(%rsp), %r10
	movsd	%xmm2, (%r10)
	leaq	24(%rsp), %r11
	movsd	%xmm3, (%r11)
	leaq	4(%rsp), %r14
	movl	%ecx, (%r14)
	movq	%rsp, %rcx
	movl	%r8d, (%rcx)
	leaq	112(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%r9, 32(%rbx)
	movq	%r10, 40(%rbx)
	movq	%r11, 48(%rbx)
	movq	%r14, 56(%rbx)
	movq	%rcx, 64(%rbx)
	leaq	96(%rsp), %r14
	leaq	80(%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	$_Z8calcNodePdS_S_ddddii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$208, %rsp
	.cfi_adjust_cfa_offset -208
	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	_Z23__device_stub__calcNodePdS_S_ddddii, .Lfunc_end1-_Z23__device_stub__calcNodePdS_S_ddddii
	.cfi_endproc
                                        # -- End function
	.globl	_Z4savePKciPdRKdS3_ii           # -- Begin function _Z4savePKciPdRKdS3_ii
	.type	_Z4savePKciPdRKdS3_ii,@function
_Z4savePKciPdRKdS3_ii:                  # @_Z4savePKciPdRKdS3_ii
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$632, %rsp                      # imm = 0x278
	.cfi_def_cfa_offset 688
	.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	%r9d, %r14d
	movq	%r8, %rbp
	movq	%rcx, %r12
	movq	%rdx, %rbx
	movl	%esi, %ecx
	movq	%rdi, %rdx
	leaq	576(%rsp), %r15
	movl	$.L.str, %esi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	sprintf
	leaq	48(%rsp), %r13
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	$16, %edx
	callq	_ZNSt13basic_fstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
	movq	(%r13), %rax
	movq	-24(%rax), %rax
	testb	$5, 80(%rsp,%rax)
	je	.LBB2_6
# %bb.1:
.Ltmp0:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.1, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp1:
# %bb.2:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	leaq	576(%rsp), %r14
	movq	%r14, %rdi
	callq	strlen
.Ltmp2:
	movl	$_ZSt4cerr, %ebx
	movl	$_ZSt4cerr, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp3:
# %bb.3:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit25
	movq	_ZSt4cerr(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp4:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp5:
# %bb.4:                                # %.noexc
.Ltmp6:
	movsbl	%al, %esi
	movl	$_ZSt4cerr, %edi
	callq	_ZNSo3putEc
.Ltmp7:
# %bb.5:                                # %.noexc51
.Ltmp8:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp9:
	jmp	.LBB2_65
.LBB2_6:
	movq	%rbx, 24(%rsp)                  # 8-byte Spill
	leaq	64(%rsp), %rdi
.Ltmp10:
	movl	$.L.str.2, %esi
	movl	$26, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp11:
# %bb.7:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit26
	movq	64(%rsp), %rax
	movq	-24(%rax), %rdi
	leaq	64(%rsp), %rax
	addq	%rax, %rdi
.Ltmp12:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp13:
# %bb.8:                                # %.noexc53
.Ltmp14:
	movsbl	%al, %esi
	leaq	64(%rsp), %rdi
	callq	_ZNSo3putEc
.Ltmp15:
# %bb.9:                                # %.noexc54
.Ltmp16:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp17:
# %bb.10:                               # %_ZNSolsEPFRSoS_E.exit27
.Ltmp18:
	movl	$.L.str.3, %esi
	movl	$6, %edx
	leaq	64(%rsp), %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp19:
# %bb.11:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit28
	movq	64(%rsp), %rax
	movq	-24(%rax), %rdi
	leaq	64(%rsp), %rax
	addq	%rax, %rdi
.Ltmp20:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp21:
# %bb.12:                               # %.noexc57
.Ltmp22:
	movsbl	%al, %esi
	leaq	64(%rsp), %rdi
	callq	_ZNSo3putEc
.Ltmp23:
# %bb.13:                               # %.noexc58
.Ltmp24:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp25:
# %bb.14:                               # %_ZNSolsEPFRSoS_E.exit29
.Ltmp26:
	movl	$.L.str.4, %esi
	movl	$6, %edx
	leaq	64(%rsp), %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp27:
# %bb.15:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit30
	movq	64(%rsp), %rax
	movq	-24(%rax), %rdi
	leaq	64(%rsp), %rax
	addq	%rax, %rdi
.Ltmp28:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp29:
# %bb.16:                               # %.noexc61
.Ltmp30:
	movsbl	%al, %esi
	leaq	64(%rsp), %rdi
	callq	_ZNSo3putEc
.Ltmp31:
# %bb.17:                               # %.noexc62
.Ltmp32:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp33:
# %bb.18:                               # %_ZNSolsEPFRSoS_E.exit31
.Ltmp34:
	movl	$.L.str.5, %esi
	movl	$25, %edx
	leaq	64(%rsp), %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp35:
# %bb.19:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit32
	movq	64(%rsp), %rax
	movq	-24(%rax), %rdi
	leaq	64(%rsp), %rax
	addq	%rax, %rdi
.Ltmp36:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp37:
# %bb.20:                               # %.noexc65
.Ltmp38:
	movsbl	%al, %esi
	leaq	64(%rsp), %rdi
	callq	_ZNSo3putEc
.Ltmp39:
# %bb.21:                               # %.noexc66
.Ltmp40:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp41:
# %bb.22:                               # %_ZNSolsEPFRSoS_E.exit33
.Ltmp42:
	movl	$.L.str.6, %esi
	movl	$11, %edx
	leaq	64(%rsp), %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp43:
# %bb.23:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit34
	leal	1(%r14), %esi
.Ltmp44:
	leaq	64(%rsp), %rdi
	movl	%esi, 4(%rsp)                   # 4-byte Spill
	callq	_ZNSolsEi
.Ltmp45:
# %bb.24:
.Ltmp46:
	movq	%rax, %r13
	movl	$.L.str.7, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp47:
# %bb.25:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit35
	movl	688(%rsp), %r15d
	leal	1(%r15), %ebx
.Ltmp48:
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_ZNSolsEi
.Ltmp49:
# %bb.26:
.Ltmp50:
	movq	%rax, %r13
	movl	$.L.str.8, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp51:
# %bb.27:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit36
	movq	(%r13), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
.Ltmp52:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp53:
# %bb.28:                               # %.noexc69
.Ltmp54:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp55:
# %bb.29:                               # %.noexc70
.Ltmp56:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp57:
# %bb.30:                               # %_ZNSolsEPFRSoS_E.exit37
.Ltmp58:
	movl	$.L.str.9, %esi
	movl	$8, %edx
	leaq	64(%rsp), %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp59:
# %bb.31:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit38
	movsd	(%r12), %xmm0                   # xmm0 = mem[0],zero
.Ltmp60:
	leaq	64(%rsp), %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp61:
# %bb.32:                               # %_ZNSolsEd.exit
.Ltmp62:
	movq	%rax, %r12
	movl	$.L.str.7, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp63:
# %bb.33:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit39
	movsd	(%rbp), %xmm0                   # xmm0 = mem[0],zero
.Ltmp64:
	movq	%r12, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp65:
# %bb.34:                               # %_ZNSolsEd.exit40
.Ltmp66:
	movq	%rax, %r12
	movl	$.L.str.8, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp67:
# %bb.35:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit41
	movq	(%r12), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp68:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp69:
# %bb.36:                               # %.noexc73
.Ltmp70:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp71:
# %bb.37:                               # %.noexc74
.Ltmp72:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp73:
# %bb.38:                               # %_ZNSolsEPFRSoS_E.exit42
.Ltmp74:
	movl	$.L.str.10, %esi
	movl	$12, %edx
	leaq	64(%rsp), %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp75:
# %bb.39:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit43
	movq	64(%rsp), %rax
	movq	-24(%rax), %rdi
	leaq	64(%rsp), %rax
	addq	%rax, %rdi
.Ltmp76:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp77:
# %bb.40:                               # %.noexc77
.Ltmp78:
	movsbl	%al, %esi
	leaq	64(%rsp), %rdi
	callq	_ZNSo3putEc
.Ltmp79:
# %bb.41:                               # %.noexc78
.Ltmp80:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp81:
# %bb.42:                               # %_ZNSolsEPFRSoS_E.exit44
.Ltmp82:
	movl	$.L.str.11, %esi
	movl	$11, %edx
	leaq	64(%rsp), %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp83:
# %bb.43:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit45
	movl	%ebx, %esi
	imull	4(%rsp), %esi                   # 4-byte Folded Reload
.Ltmp84:
	leaq	64(%rsp), %rdi
	callq	_ZNSolsEi
.Ltmp85:
# %bb.44:
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp86:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp87:
# %bb.45:                               # %.noexc81
.Ltmp88:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp89:
# %bb.46:                               # %.noexc82
.Ltmp90:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp91:
# %bb.47:                               # %_ZNSolsEPFRSoS_E.exit46
.Ltmp92:
	movl	$.L.str.12, %esi
	movl	$16, %edx
	leaq	64(%rsp), %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp93:
# %bb.48:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit47
	movq	64(%rsp), %rax
	movq	-24(%rax), %rdi
	leaq	64(%rsp), %rax
	addq	%rax, %rdi
.Ltmp94:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp95:
# %bb.49:                               # %.noexc85
.Ltmp96:
	movsbl	%al, %esi
	leaq	64(%rsp), %rdi
	callq	_ZNSo3putEc
.Ltmp97:
# %bb.50:                               # %.noexc86
.Ltmp98:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp99:
# %bb.51:                               # %_ZNSolsEPFRSoS_E.exit48
.Ltmp100:
	movl	$.L.str.13, %esi
	movl	$20, %edx
	leaq	64(%rsp), %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp101:
# %bb.52:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit49
	movq	64(%rsp), %rax
	movq	-24(%rax), %rdi
	leaq	64(%rsp), %rax
	addq	%rax, %rdi
.Ltmp102:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp103:
# %bb.53:                               # %.noexc89
.Ltmp104:
	movsbl	%al, %esi
	leaq	64(%rsp), %rdi
	callq	_ZNSo3putEc
.Ltmp105:
# %bb.54:                               # %.noexc90
.Ltmp106:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp107:
# %bb.55:                               # %_ZNSolsEPFRSoS_E.exit50.preheader
	testl	%r15d, %r15d
	js	.LBB2_64
# %bb.56:                               # %.preheader.lr.ph
	leaq	23(%rsp), %r13
	movl	%ebx, %eax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movl	4(%rsp), %ebx                   # 4-byte Reload
	leaq	17(%rsp), %rbp
	xorl	%eax, %eax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	leaq	16(%rsp), %r12
	movq	%r14, 40(%rsp)                  # 8-byte Spill
.LBB2_57:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_59 Depth 2
                                        #       Child Loop BB2_60 Depth 3
	testl	%r14d, %r14d
	js	.LBB2_63
# %bb.58:                               # %.lr.ph
                                        #   in Loop: Header=BB2_57 Depth=1
	movl	4(%rsp), %eax                   # 4-byte Reload
                                        # kill: def $eax killed $eax def $rax
	imull	8(%rsp), %eax                   # 4-byte Folded Reload
	movq	24(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,8), %r15
	xorl	%r14d, %r14d
.LBB2_59:                               #   Parent Loop BB2_57 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_60 Depth 3
	movsd	(%r15,%r14,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, 16(%rsp)
	movq	%rbp, %rax
	movq	%r13, %rcx
.LBB2_60:                               # %.lr.ph.i.i.i
                                        #   Parent Loop BB2_57 Depth=1
                                        #     Parent Loop BB2_59 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movb	-1(%rax), %dl
	movb	(%rcx), %sil
	movb	%sil, -1(%rax)
	movb	%dl, (%rcx)
	decq	%rcx
	leaq	1(%rax), %rdx
	cmpq	%rcx, %rax
	movq	%rdx, %rax
	jb	.LBB2_60
# %bb.61:                               # %_ZSt7reverseIPcEvT_S1_.exit.i
                                        #   in Loop: Header=BB2_59 Depth=2
.Ltmp108:
	movl	$8, %edx
	leaq	64(%rsp), %rdi
	movq	%r12, %rsi
	callq	_ZNSo5writeEPKcl
.Ltmp109:
# %bb.62:                               #   in Loop: Header=BB2_59 Depth=2
	incq	%r14
	cmpq	%rbx, %r14
	jne	.LBB2_59
.LBB2_63:                               # %_ZNSolsEPFRSoS_E.exit50
                                        #   in Loop: Header=BB2_57 Depth=1
	movq	8(%rsp), %rcx                   # 8-byte Reload
	incq	%rcx
	movq	%rcx, %rax
	movq	%rcx, 8(%rsp)                   # 8-byte Spill
	cmpq	32(%rsp), %rcx                  # 8-byte Folded Reload
	movq	40(%rsp), %r14                  # 8-byte Reload
	jne	.LBB2_57
.LBB2_64:                               # %_ZNSolsEPFRSoS_E.exit50._crit_edge
.Ltmp111:
	leaq	48(%rsp), %rdi
	callq	_ZNSt13basic_fstreamIcSt11char_traitsIcEE5closeEv
.Ltmp112:
.LBB2_65:                               # %_ZNSolsEPFRSoS_E.exit
	leaq	48(%rsp), %rdi
	callq	_ZNSt13basic_fstreamIcSt11char_traitsIcEED1Ev
	addq	$632, %rsp                      # imm = 0x278
	.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
.LBB2_66:
	.cfi_def_cfa_offset 688
.Ltmp113:
	jmp	.LBB2_67
.LBB2_68:
.Ltmp110:
.LBB2_67:
	movq	%rax, %rbx
	leaq	48(%rsp), %rdi
	callq	_ZNSt13basic_fstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	_Z4savePKciPdRKdS3_ii, .Lfunc_end2-_Z4savePKciPdRKdS3_ii
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp107-.Ltmp0                #   Call between .Ltmp0 and .Ltmp107
	.uleb128 .Ltmp113-.Lfunc_begin0         #     jumps to .Ltmp113
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp108-.Lfunc_begin0         # >> Call Site 3 <<
	.uleb128 .Ltmp109-.Ltmp108              #   Call between .Ltmp108 and .Ltmp109
	.uleb128 .Ltmp110-.Lfunc_begin0         #     jumps to .Ltmp110
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp111-.Lfunc_begin0         # >> Call Site 4 <<
	.uleb128 .Ltmp112-.Ltmp111              #   Call between .Ltmp111 and .Ltmp112
	.uleb128 .Ltmp113-.Lfunc_begin0         #     jumps to .Ltmp113
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp112-.Lfunc_begin0         # >> Call Site 5 <<
	.uleb128 .Lfunc_end2-.Ltmp112           #   Call between .Ltmp112 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z9calculatePdS_S_S_ii
.LCPI3_0:
	.long	0x50061c46                      # float 8.99999948E+9
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI3_1:
	.quad	0x3f847ae147ae147b              # double 0.01
.LCPI3_2:
	.quad	0x3f747ae147ae147b              # double 0.0050000000000000001
.LCPI3_3:
	.quad	0x3f647ae147ae147b              # double 0.0025000000000000001
.LCPI3_4:
	.quad	0x409f400000000000              # double 2000
.LCPI3_5:
	.quad	0xbfa999999999999a              # double -0.050000000000000003
.LCPI3_7:
	.quad	0x3ee4f8b588e368f1              # double 1.0000000000000001E-5
.LCPI3_8:
	.quad	0x4014000000000000              # double 5
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI3_6:
	.quad	0x7fffffffffffffff              # double NaN
	.quad	0x7fffffffffffffff              # double NaN
	.text
	.globl	_Z9calculatePdS_S_S_ii
	.type	_Z9calculatePdS_S_S_ii,@function
_Z9calculatePdS_S_S_ii:                 # @_Z9calculatePdS_S_S_ii
	.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	$120, %rsp
	.cfi_def_cfa_offset 176
	.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	%r9d, %ebx
	movl	%r8d, %r15d
	movq	%rcx, 96(%rsp)                  # 8-byte Spill
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r13
	movabsq	$4576918229304087675, %rax      # imm = 0x3F847AE147AE147B
	leaq	112(%rsp), %rcx
	movq	%rax, (%rcx)
	movabsq	$4572414629676717179, %rax      # imm = 0x3F747AE147AE147B
	leaq	104(%rsp), %rcx
	movq	%rax, (%rcx)
	movl	$_ZSt4cout, %edi
	movl	$.L.str.14, %esi
	movl	$40, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%r15d, %eax
	shrl	$3, %eax
	movl	%ebx, %ecx
	shrl	$3, %ecx
	incl	%ecx
	shlq	$32, %rcx
	leaq	(%rcx,%rax), %rbp
	incq	%rbp
	movq	%r15, 56(%rsp)                  # 8-byte Spill
	leal	1(%r15), %eax
	movq	%rbx, %rcx
	movq	%rbx, 64(%rsp)                  # 8-byte Spill
	leal	1(%rbx), %ecx
	imull	%eax, %ecx
	movslq	%ecx, %rax
	shlq	$3, %rax
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	movss	.LCPI3_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 28(%rsp)                 # 4-byte Spill
	xorps	%xmm0, %xmm0
	movss	%xmm0, 16(%rsp)                 # 4-byte Spill
	xorl	%ebx, %ebx
	xorps	%xmm0, %xmm0
	movsd	%xmm0, 32(%rsp)                 # 8-byte Spill
	xorps	%xmm0, %xmm0
	movss	%xmm0, 24(%rsp)                 # 4-byte Spill
.LBB3_1:                                # =>This Inner Loop Header: Depth=1
	movq	%r13, %r15
	leaq	72(%rsp), %rdi
	callq	hipEventCreate
	leaq	40(%rsp), %rdi
	callq	hipEventCreate
	movq	72(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	%rbp, %rdi
	movl	$1, %esi
	movabsq	$34359738376, %rdx              # imm = 0x800000008
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_3
# %bb.2:                                #   in Loop: Header=BB3_1 Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	movsd	.LCPI3_1(%rip), %xmm0           # xmm0 = mem[0],zero
	movsd	.LCPI3_2(%rip), %xmm1           # xmm1 = mem[0],zero
	movsd	.LCPI3_3(%rip), %xmm2           # xmm2 = mem[0],zero
	movsd	32(%rsp), %xmm3                 # 8-byte Reload
                                        # xmm3 = mem[0],zero
	movq	56(%rsp), %rcx                  # 8-byte Reload
                                        # kill: def $ecx killed $ecx killed $rcx
	movq	64(%rsp), %r8                   # 8-byte Reload
                                        # kill: def $r8d killed $r8d killed $r8
	callq	_Z23__device_stub__calcNodePdS_S_ddddii
.LBB3_3:                                #   in Loop: Header=BB3_1 Depth=1
	movq	40(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	40(%rsp), %rdi
	callq	hipEventSynchronize
	movl	$0, 20(%rsp)
	movq	72(%rsp), %rsi
	movq	40(%rsp), %rdx
	leaq	20(%rsp), %rdi
	callq	hipEventElapsedTime
	movss	20(%rsp), %xmm2                 # xmm2 = mem[0],zero,zero,zero
	ucomiss	16(%rsp), %xmm2                 # 4-byte Folded Reload
	jbe	.LBB3_5
# %bb.4:                                #   in Loop: Header=BB3_1 Depth=1
	movsd	32(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	divsd	.LCPI3_3(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r13
	movl	$.L.str.15, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	20(%rsp), %xmm0
	movq	%r13, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.16, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movss	20(%rsp), %xmm2                 # xmm2 = mem[0],zero,zero,zero
.LBB3_5:                                #   in Loop: Header=BB3_1 Depth=1
	xorps	%xmm3, %xmm3
	cvtss2sd	%xmm2, %xmm3
	divsd	.LCPI3_4(%rip), %xmm3
	xorps	%xmm0, %xmm0
	cvtsi2sd	%ebx, %xmm0
	mulsd	.LCPI3_5(%rip), %xmm0
	addsd	32(%rsp), %xmm0                 # 8-byte Folded Reload
	andpd	.LCPI3_6(%rip), %xmm0
	movsd	.LCPI3_7(%rip), %xmm1           # xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	movq	96(%rsp), %r13                  # 8-byte Reload
	jbe	.LBB3_8
# %bb.6:                                #   in Loop: Header=BB3_1 Depth=1
	movsd	%xmm3, 88(%rsp)                 # 8-byte Spill
	movss	%xmm2, 52(%rsp)                 # 4-byte Spill
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	80(%rsp), %rdx                  # 8-byte Reload
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB3_10
# %bb.7:                                #   in Loop: Header=BB3_1 Depth=1
	movq	64(%rsp), %rax                  # 8-byte Reload
	movl	%eax, (%rsp)
	movl	$.L.str.19, %edi
	movl	%ebx, %esi
	movq	%r13, %rdx
	leaq	112(%rsp), %rcx
	leaq	104(%rsp), %r8
	movq	56(%rsp), %r9                   # 8-byte Reload
                                        # kill: def $r9d killed $r9d killed $r9
	callq	_Z4savePKciPdRKdS3_ii
	incl	%ebx
	movss	52(%rsp), %xmm2                 # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	movsd	88(%rsp), %xmm3                 # 8-byte Reload
                                        # xmm3 = mem[0],zero
.LBB3_8:                                #   in Loop: Header=BB3_1 Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	24(%rsp), %xmm0                 # 4-byte Folded Reload
	addsd	%xmm0, %xmm3
	xorps	%xmm0, %xmm0
	cvtsd2ss	%xmm3, %xmm0
	movss	%xmm0, 24(%rsp)                 # 4-byte Spill
	movss	16(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	maxss	%xmm2, %xmm0
	movss	%xmm0, 16(%rsp)                 # 4-byte Spill
	movsd	32(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	addsd	.LCPI3_3(%rip), %xmm0
	movsd	%xmm0, 32(%rsp)                 # 8-byte Spill
	movsd	.LCPI3_8(%rip), %xmm1           # xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	movss	28(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	minss	%xmm2, %xmm0
	movss	%xmm0, 28(%rsp)                 # 4-byte Spill
	movq	%r12, %r13
	movq	%r14, %r12
	movq	%r15, %r14
	jae	.LBB3_1
# %bb.9:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.20, %esi
	movl	$45, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	16(%rsp), %xmm0                 # 4-byte Folded Reload
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.21, %esi
	movl	$12, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	24(%rsp), %xmm0                 # 4-byte Folded Reload
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.22, %esi
	movl	$12, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	28(%rsp), %xmm0                 # 4-byte Folded Reload
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.16, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	addq	$120, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB3_10:
	.cfi_def_cfa_offset 176
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.17, %esi
	movl	$.L.str.18, %edx
	movq	%rbx, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	fprintf
	movl	$1, %edi
	callq	exit
.Lfunc_end3:
	.size	_Z9calculatePdS_S_S_ii, .Lfunc_end3-_Z9calculatePdS_S_S_ii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z5mtimev
.LCPI4_0:
	.quad	0x408f400000000000              # double 1000
	.text
	.globl	_Z5mtimev
	.type	_Z5mtimev,@function
_Z5mtimev:                              # @_Z5mtimev
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -16
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	cvtsi2sdq	(%rbx), %xmm1
	movsd	.LCPI4_0(%rip), %xmm2           # xmm2 = mem[0],zero
	cvtsi2sdq	8(%rbx), %xmm0
	mulsd	%xmm2, %xmm1
	divsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z5mtimev, .Lfunc_end4-_Z5mtimev
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI5_0:
	.quad	0x408f400000000000              # double 1000
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	leaq	32(%rsp), %rdi
	movq	$0, (%rdi)
	movl	$32040008, %esi                 # imm = 0x1E8E448
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB5_4
# %bb.1:
	leaq	24(%rsp), %rdi
	movq	$0, (%rdi)
	movl	$32040008, %esi                 # imm = 0x1E8E448
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB5_4
# %bb.2:
	leaq	16(%rsp), %rdi
	movq	$0, (%rdi)
	movl	$32040008, %esi                 # imm = 0x1E8E448
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB5_4
# %bb.3:
	movl	$32040008, %edi                 # imm = 0x1E8E448
	callq	_Znam
	movq	%rax, %rbx
	movq	32(%rsp), %rdi
	movl	$32040008, %edx                 # imm = 0x1E8E448
	xorl	%esi, %esi
	callq	hipMemset
	movq	24(%rsp), %rdi
	movl	$32040008, %edx                 # imm = 0x1E8E448
	xorl	%esi, %esi
	callq	hipMemset
	movq	16(%rsp), %rdi
	movl	$32040008, %edx                 # imm = 0x1E8E448
	xorl	%esi, %esi
	callq	hipMemset
	movl	$32040008, %edx                 # imm = 0x1E8E448
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	leaq	40(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	cvtsi2sdq	(%r14), %xmm0
	movsd	.LCPI5_0(%rip), %xmm2           # xmm2 = mem[0],zero
	mulsd	%xmm2, %xmm0
	cvtsi2sdq	8(%r14), %xmm1
	divsd	%xmm2, %xmm1
	addsd	%xmm0, %xmm1
	movsd	%xmm1, 8(%rsp)                  # 8-byte Spill
	movq	32(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
	movq	%rbx, %rcx
	movl	$1000, %r8d                     # imm = 0x3E8
	movl	$4000, %r9d                     # imm = 0xFA0
	callq	_Z9calculatePdS_S_S_ii
	leaq	40(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	xorps	%xmm0, %xmm0
	cvtsi2sdq	(%r14), %xmm0
	xorps	%xmm2, %xmm2
	cvtsi2sdq	8(%r14), %xmm2
	movsd	.LCPI5_0(%rip), %xmm1           # xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	divsd	%xmm1, %xmm2
	addsd	%xmm0, %xmm2
	subsd	8(%rsp), %xmm2                  # 8-byte Folded Reload
	movsd	%xmm2, 8(%rsp)                  # 8-byte Spill
	movl	$_ZSt4cout, %edi
	movl	$.L.str.24, %esi
	movl	$32, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movsd	8(%rsp), %xmm0                  # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	%rbx, %rdi
	callq	_ZdaPv
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB5_4:
	.cfi_def_cfa_offset 80
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.23, %esi
	movq	%rbx, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	fprintf
	movl	$1, %edi
	callq	exit
.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
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.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:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14calcNodeSimplePdS_S_ddddii, %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	$_Z8calcNodePdS_S_ddddii, %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_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	_Z14calcNodeSimplePdS_S_ddddii,@object # @_Z14calcNodeSimplePdS_S_ddddii
	.section	.rodata,"a",@progbits
	.globl	_Z14calcNodeSimplePdS_S_ddddii
	.p2align	3, 0x0
_Z14calcNodeSimplePdS_S_ddddii:
	.quad	_Z29__device_stub__calcNodeSimplePdS_S_ddddii
	.size	_Z14calcNodeSimplePdS_S_ddddii, 8

	.type	_Z8calcNodePdS_S_ddddii,@object # @_Z8calcNodePdS_S_ddddii
	.globl	_Z8calcNodePdS_S_ddddii
	.p2align	3, 0x0
_Z8calcNodePdS_S_ddddii:
	.quad	_Z23__device_stub__calcNodePdS_S_ddddii
	.size	_Z8calcNodePdS_S_ddddii, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"%s.%05d.vtk"
	.size	.L.str, 12

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Unable to open file "
	.size	.L.str.1, 21

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"# vtk DataFile Version 3.0"
	.size	.L.str.2, 27

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"U data"
	.size	.L.str.3, 7

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

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"DATASET STRUCTURED_POINTS"
	.size	.L.str.5, 26

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"DIMENSIONS "
	.size	.L.str.6, 12

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

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	" 1"
	.size	.L.str.8, 3

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"SPACING "
	.size	.L.str.9, 9

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"ORIGIN 0 0 0"
	.size	.L.str.10, 13

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"POINT_DATA "
	.size	.L.str.11, 12

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"SCALARS u double"
	.size	.L.str.12, 17

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"LOOKUP_TABLE default"
	.size	.L.str.13, 21

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"Max time of kernel execution:\nstep\ttime\n"
	.size	.L.str.14, 41

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

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"\n"
	.size	.L.str.16, 2

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"Failed to copy data from device to host"
	.size	.L.str.17, 40

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"(error code %s)!\n"
	.size	.L.str.18, 18

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"output"
	.size	.L.str.19, 7

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"Kernel execution in milliseconds:\nmax time = "
	.size	.L.str.20, 46

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"\navg time = "
	.size	.L.str.21, 13

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"\nmin time = "
	.size	.L.str.22, 13

	.type	.L.str.23,@object               # @.str.23
.L.str.23:
	.asciz	"Failed to allocate device memory!\n"
	.size	.L.str.23, 35

	.type	.L.str.24,@object               # @.str.24
.L.str.24:
	.asciz	"Time of calculate() execution = "
	.size	.L.str.24, 33

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z14calcNodeSimplePdS_S_ddddii"
	.size	.L__unnamed_1, 31

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z8calcNodePdS_S_ddddii"
	.size	.L__unnamed_2, 24

	.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 _Z29__device_stub__calcNodeSimplePdS_S_ddddii
	.addrsig_sym _Z23__device_stub__calcNodePdS_S_ddddii
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z14calcNodeSimplePdS_S_ddddii
	.addrsig_sym _Z8calcNodePdS_S_ddddii
	.addrsig_sym _ZSt4cerr
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z14calcNodeSimplePdS_S_ddddii ; -- Begin function _Z14calcNodeSimplePdS_S_ddddii
	.globl	_Z14calcNodeSimplePdS_S_ddddii
	.p2align	8
	.type	_Z14calcNodeSimplePdS_S_ddddii,@function
_Z14calcNodeSimplePdS_S_ddddii:         ; @_Z14calcNodeSimplePdS_S_ddddii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x4c
	s_load_b64 s[16:17], s[0:1], 0x38
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v0, 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_1) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[2:3], null, s14, s2, v[1:2]
	v_mad_u64_u32 v[3:4], null, s15, s3, v[0:1]
	v_cmp_ge_u32_e32 vcc_lo, s16, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_u32_e64 s2, s17, v3
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_18
; %bb.1:
	s_clause 0x1
	s_load_b256 s[4:11], s[0:1], 0x0
	s_load_b128 s[12:15], s[0:1], 0x20
	s_add_i32 s2, s16, 1
                                        ; implicit-def: $vgpr5_vgpr6
	s_mov_b32 s0, exec_lo
	v_mul_lo_u32 v11, v3, s2
	s_delay_alu instid0(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v11, v2
	v_cmpx_ne_u32_e64 s17, v3
	s_xor_b32 s1, exec_lo, s0
	s_cbranch_execz .LBB0_15
; %bb.2:
                                        ; implicit-def: $vgpr5_vgpr6
	s_mov_b32 s0, exec_lo
	v_cmpx_ne_u32_e32 0, v3
	s_xor_b32 s3, exec_lo, s0
	s_cbranch_execz .LBB0_12
; %bb.3:
                                        ; implicit-def: $vgpr5_vgpr6
	s_mov_b32 s0, exec_lo
	v_cmpx_ne_u32_e32 0, v2
	s_xor_b32 s17, exec_lo, s0
	s_cbranch_execz .LBB0_9
; %bb.4:
	v_mov_b32_e32 v1, 0
	v_add_nc_u32_e32 v7, -1, v0
                                        ; implicit-def: $vgpr5_vgpr6
	s_mov_b32 s0, exec_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[9:10], 3, v[0:1]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v3, vcc_lo, s6, v9
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v4, vcc_lo, s7, v10, vcc_lo
	global_load_b64 v[3:4], v[3:4], off
	v_cmpx_ne_u32_e64 s16, v2
	s_xor_b32 s16, exec_lo, s0
	s_cbranch_execz .LBB0_6
; %bb.5:
	v_mul_f64 v[5:6], s[14:15], s[14:15]
	v_mul_f64 v[12:13], s[10:11], s[10:11]
	v_dual_mov_b32 v15, v1 :: v_dual_add_nc_u32 v14, 1, v0
	v_mul_f64 v[16:17], s[12:13], s[12:13]
	v_dual_mov_b32 v8, v1 :: v_dual_add_nc_u32 v11, s2, v11
	v_mov_b32_e32 v21, v1
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[14:15], 3, v[14:15]
	s_lshl_b32 s0, s2, 1
	v_lshlrev_b64 v[7:8], 3, v[7:8]
	v_add_nc_u32_e32 v20, v11, v2
	v_subrev_nc_u32_e32 v11, s0, v11
	v_mov_b32_e32 v27, v1
	v_add_co_u32 v14, vcc_lo, s6, v14
	v_add_co_ci_u32_e32 v15, vcc_lo, s7, v15, vcc_lo
	s_delay_alu instid0(VALU_DEP_4)
	v_add_nc_u32_e32 v26, v11, v2
	v_add_co_u32 v9, vcc_lo, s4, v9
	global_load_b64 v[14:15], v[14:15], off
	v_lshlrev_b64 v[20:21], 3, v[20:21]
	v_add_co_ci_u32_e32 v10, vcc_lo, s5, v10, vcc_lo
	v_add_co_u32 v7, vcc_lo, s6, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s7, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_u32 v20, vcc_lo, s6, v20
	v_add_co_ci_u32_e32 v21, vcc_lo, s7, v21, vcc_lo
	global_load_b64 v[9:10], v[9:10], off
	s_clause 0x1
	global_load_b64 v[7:8], v[7:8], off
	global_load_b64 v[20:21], v[20:21], off
	v_lshlrev_b64 v[26:27], 3, v[26:27]
	v_div_scale_f64 v[18:19], null, v[12:13], v[12:13], v[5:6]
	v_div_scale_f64 v[22:23], null, v[16:17], v[16:17], v[5:6]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v26, vcc_lo, s6, v26
	v_add_co_ci_u32_e32 v27, vcc_lo, s7, v27, vcc_lo
	v_div_scale_f64 v[34:35], vcc_lo, v[5:6], v[12:13], v[5:6]
	global_load_b64 v[26:27], v[26:27], off
	v_rcp_f64_e32 v[24:25], v[18:19]
	v_rcp_f64_e32 v[28:29], v[22:23]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[30:31], -v[18:19], v[24:25], 1.0
	v_fma_f64 v[32:33], -v[22:23], v[28:29], 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[24:25], v[24:25], v[30:31], v[24:25]
	v_fma_f64 v[28:29], v[28:29], v[32:33], v[28:29]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[30:31], -v[18:19], v[24:25], 1.0
	v_fma_f64 v[32:33], -v[22:23], v[28:29], 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fma_f64 v[24:25], v[24:25], v[30:31], v[24:25]
	v_div_scale_f64 v[30:31], s0, v[5:6], v[16:17], v[5:6]
	v_fma_f64 v[28:29], v[28:29], v[32:33], v[28:29]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[32:33], v[34:35], v[24:25]
	v_mul_f64 v[36:37], v[30:31], v[28:29]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[18:19], -v[18:19], v[32:33], v[34:35]
	v_fma_f64 v[22:23], -v[22:23], v[36:37], v[30:31]
	s_waitcnt vmcnt(4)
	v_fma_f64 v[14:15], v[3:4], -2.0, v[14:15]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_div_fmas_f64 v[18:19], v[18:19], v[24:25], v[32:33]
	s_mov_b32 vcc_lo, s0
	v_div_fmas_f64 v[22:23], v[22:23], v[28:29], v[36:37]
	s_waitcnt vmcnt(3)
	v_fma_f64 v[9:10], v[3:4], 2.0, -v[9:10]
	s_waitcnt vmcnt(1)
	v_fma_f64 v[2:3], v[3:4], -2.0, v[20:21]
	v_add_f64 v[7:8], v[14:15], v[7:8]
	v_div_fixup_f64 v[11:12], v[18:19], v[12:13], v[5:6]
	v_div_fixup_f64 v[4:5], v[22:23], v[16:17], v[5:6]
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[2:3], v[2:3], v[26:27]
	v_fma_f64 v[6:7], v[11:12], v[7:8], v[9:10]
	s_delay_alu instid0(VALU_DEP_1)
	v_fma_f64 v[5:6], v[4:5], v[2:3], v[6:7]
                                        ; implicit-def: $vgpr7
                                        ; implicit-def: $vgpr3_vgpr4
.LBB0_6:                                ; %Flow
	s_and_not1_saveexec_b32 s0, s16
	s_cbranch_execz .LBB0_8
; %bb.7:
	v_div_scale_f64 v[5:6], null, s[10:11], s[10:11], s[14:15]
	v_mov_b32_e32 v8, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[7:8], 3, v[7:8]
	v_add_co_u32 v7, vcc_lo, s6, v7
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v8, vcc_lo, s7, v8, vcc_lo
	v_div_scale_f64 v[13:14], vcc_lo, s[14:15], s[10:11], s[14:15]
	global_load_b64 v[7:8], v[7:8], off
	v_rcp_f64_e32 v[9:10], v[5:6]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[11:12], -v[5:6], v[9:10], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[9:10], v[9:10], v[11:12], v[9:10]
	v_fma_f64 v[11:12], -v[5:6], v[9:10], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[9:10], v[9:10], v[11:12], v[9:10]
	v_mul_f64 v[11:12], v[13:14], v[9:10]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[5:6], -v[5:6], v[11:12], v[13:14]
	v_div_fmas_f64 v[5:6], v[5:6], v[9:10], v[11:12]
	s_waitcnt vmcnt(0)
	v_add_f64 v[7:8], v[3:4], -v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f64 v[5:6], v[5:6], s[10:11], s[14:15]
	v_fma_f64 v[5:6], -v[5:6], v[7:8], v[3:4]
.LBB0_8:                                ; %Flow150
	s_or_b32 exec_lo, exec_lo, s0
.LBB0_9:                                ; %Flow151
	s_and_not1_saveexec_b32 s0, s17
	s_cbranch_execz .LBB0_11
; %bb.10:
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_div_scale_f64 v[2:3], null, s[10:11], s[10:11], s[14:15]
	v_dual_mov_b32 v1, 0 :: v_dual_add_nc_u32 v4, 1, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v5, v1
	v_lshlrev_b64 v[6:7], 3, v[0:1]
	v_lshlrev_b64 v[4:5], 3, v[4:5]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v6, vcc_lo, s6, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, s7, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v4, vcc_lo, s6, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v5, vcc_lo
	s_clause 0x1
	global_load_b64 v[6:7], v[6:7], off
	global_load_b64 v[4:5], v[4:5], off
	v_div_scale_f64 v[12:13], vcc_lo, s[14:15], s[10:11], s[14:15]
	v_rcp_f64_e32 v[8:9], v[2:3]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[10:11], -v[2:3], v[8:9], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[8:9], v[8:9], v[10:11], v[8:9]
	v_fma_f64 v[10:11], -v[2:3], v[8:9], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[8:9], v[8:9], v[10:11], v[8:9]
	v_mul_f64 v[10:11], v[12:13], v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[2:3], -v[2:3], v[10:11], v[12:13]
	v_div_fmas_f64 v[2:3], v[2:3], v[8:9], v[10:11]
	s_waitcnt vmcnt(0)
	v_add_f64 v[4:5], v[4:5], -v[6:7]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f64 v[2:3], v[2:3], s[10:11], s[14:15]
	v_fma_f64 v[5:6], v[2:3], v[4:5], v[6:7]
.LBB0_11:                               ; %Flow152
	s_or_b32 exec_lo, exec_lo, s0
                                        ; implicit-def: $vgpr2_vgpr3
.LBB0_12:                               ; %Flow153
	s_and_not1_saveexec_b32 s0, s3
	s_cbranch_execz .LBB0_14
; %bb.13:
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_div_scale_f64 v[3:4], null, s[12:13], s[12:13], s[14:15]
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_mov_b32 v6, v1 :: v_dual_add_nc_u32 v5, s2, v2
	v_lshlrev_b64 v[7:8], 3, v[0:1]
	v_lshlrev_b64 v[5:6], 3, v[5:6]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v7, vcc_lo, s6, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s7, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v5, vcc_lo, s6, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, s7, v6, vcc_lo
	s_clause 0x1
	global_load_b64 v[7:8], v[7:8], off
	global_load_b64 v[5:6], v[5:6], off
	v_div_scale_f64 v[13:14], vcc_lo, s[14:15], s[12:13], s[14:15]
	v_rcp_f64_e32 v[9:10], v[3:4]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[11:12], -v[3:4], v[9:10], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[9:10], v[9:10], v[11:12], v[9:10]
	v_fma_f64 v[11:12], -v[3:4], v[9:10], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[9:10], v[9:10], v[11:12], v[9:10]
	v_mul_f64 v[11:12], v[13:14], v[9:10]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[2:3], -v[3:4], v[11:12], v[13:14]
	v_div_fmas_f64 v[2:3], v[2:3], v[9:10], v[11:12]
	s_waitcnt vmcnt(0)
	v_add_f64 v[4:5], v[5:6], -v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f64 v[2:3], v[2:3], s[12:13], s[14:15]
	v_fma_f64 v[5:6], v[2:3], v[4:5], v[7:8]
.LBB0_14:                               ; %Flow154
	s_or_b32 exec_lo, exec_lo, s0
.LBB0_15:                               ; %Flow155
	s_and_not1_saveexec_b32 s0, s1
; %bb.16:
	v_mov_b32_e32 v5, 0
	v_dual_mov_b32 v6, 0x3ff00000 :: v_dual_mov_b32 v1, 0
; %bb.17:                               ; %.sink.split
	s_or_b32 exec_lo, exec_lo, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 3, v[0:1]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s8, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s9, v1, vcc_lo
	global_store_b64 v[0:1], v[5:6], off
.LBB0_18:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14calcNodeSimplePdS_S_ddddii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 320
		.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 38
		.amdhsa_next_free_sgpr 18
		.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	_Z14calcNodeSimplePdS_S_ddddii, .Lfunc_end0-_Z14calcNodeSimplePdS_S_ddddii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1460
; NumSgprs: 20
; NumVgprs: 38
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 4
; NumSGPRsForWavesPerEU: 20
; NumVGPRsForWavesPerEU: 38
; 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	_Z8calcNodePdS_S_ddddii ; -- Begin function _Z8calcNodePdS_S_ddddii
	.globl	_Z8calcNodePdS_S_ddddii
	.p2align	8
	.type	_Z8calcNodePdS_S_ddddii,@function
_Z8calcNodePdS_S_ddddii:                ; @_Z8calcNodePdS_S_ddddii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x4c
	s_load_b64 s[16:17], s[0:1], 0x38
	v_and_b32_e32 v12, 0x3ff, v0
	v_bfe_u32 v9, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s12, s2, 0xffff
	s_lshr_b32 s3, s2, 16
	v_mad_u64_u32 v[6:7], null, s14, s12, v[12:13]
	v_mad_u64_u32 v[7:8], null, s15, s3, v[9:10]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_ge_u32_e32 vcc_lo, s16, v6
	v_cmp_ge_u32_e64 s2, s17, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, vcc_lo, s2
	s_and_saveexec_b32 s4, s2
	s_cbranch_execz .LBB1_28
; %bb.1:
	s_add_i32 s2, s16, 1
	s_load_b256 s[4:11], s[0:1], 0x0
	v_mul_lo_u32 v8, v7, s2
	v_mov_b32_e32 v11, 0
	v_lshlrev_b32_e32 v13, 3, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_mad_u32_u24 v15, 0x50, v12, v13
	v_add_nc_u32_e32 v10, v8, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 3, v[10:11]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s6, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s7, v1, vcc_lo
	v_add_co_u32 v4, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v1, vcc_lo
	s_mov_b32 s4, exec_lo
	global_load_b64 v[2:3], v[2:3], off
	global_load_b64 v[4:5], v[4:5], off
	s_waitcnt vmcnt(1)
	ds_store_b64 v15, v[2:3] offset:88
	v_cmpx_eq_u32_e32 0, v12
	s_cbranch_execz .LBB1_4
; %bb.2:
	v_mov_b32_e32 v16, v11
	v_mov_b32_e32 v17, v11
	v_cmp_ne_u32_e32 vcc_lo, 0, v6
	ds_store_b64 v13, v[16:17] offset:8
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_4
; %bb.3:
	v_dual_mov_b32 v17, 0 :: v_dual_add_nc_u32 v16, -1, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[16:17], 3, v[16:17]
	v_add_co_u32 v16, vcc_lo, s6, v16
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v17, vcc_lo, s7, v17, vcc_lo
	global_load_b64 v[16:17], v[16:17], off
	s_waitcnt vmcnt(0)
	ds_store_b64 v13, v[16:17] offset:8
.LBB1_4:
	s_or_b32 exec_lo, exec_lo, s4
	s_add_i32 s4, s12, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	v_cmp_eq_u32_e32 vcc_lo, s4, v12
	s_and_saveexec_b32 s4, vcc_lo
	s_cbranch_execz .LBB1_7
; %bb.5:
	v_mov_b32_e32 v13, 0
	s_mulk_i32 s12, 0x50
	v_cmp_ne_u32_e32 vcc_lo, s16, v6
	v_lshl_add_u32 v11, v9, 3, s12
	s_delay_alu instid0(VALU_DEP_3)
	v_mov_b32_e32 v14, v13
	ds_store_b64 v11, v[13:14] offset:88
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_7
; %bb.6:
	v_dual_mov_b32 v17, v13 :: v_dual_add_nc_u32 v16, 1, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[13:14], 3, v[16:17]
	v_add_co_u32 v13, vcc_lo, s6, v13
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v14, vcc_lo, s7, v14, vcc_lo
	global_load_b64 v[13:14], v[13:14], off
	s_waitcnt vmcnt(0)
	ds_store_b64 v11, v[13:14] offset:88
.LBB1_7:
	s_or_b32 exec_lo, exec_lo, s4
	s_load_b128 s[12:15], s[0:1], 0x20
	v_mul_u32_u24_e32 v13, 0x50, v12
	s_mov_b32 s0, exec_lo
	v_cmpx_eq_u32_e32 0, v9
	s_cbranch_execz .LBB1_10
; %bb.8:
	v_mov_b32_e32 v11, 0
	v_cmp_ne_u32_e32 vcc_lo, 0, v7
	s_delay_alu instid0(VALU_DEP_2)
	v_mov_b32_e32 v12, v11
	ds_store_b64 v13, v[11:12] offset:80
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_10
; %bb.9:
	v_subrev_nc_u32_e32 v8, s2, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_mov_b32 v12, v11 :: v_dual_add_nc_u32 v11, v8, v6
	v_lshlrev_b64 v[11:12], 3, v[11:12]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v11, vcc_lo, s6, v11
	v_add_co_ci_u32_e32 v12, vcc_lo, s7, v12, vcc_lo
	global_load_b64 v[11:12], v[11:12], off
	s_waitcnt vmcnt(0)
	ds_store_b64 v13, v[11:12] offset:80
.LBB1_10:
	s_or_b32 exec_lo, exec_lo, s0
	s_add_i32 s0, s3, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	v_cmp_eq_u32_e32 vcc_lo, s0, v9
	s_and_saveexec_b32 s0, vcc_lo
	s_cbranch_execz .LBB1_13
; %bb.11:
	v_mov_b32_e32 v8, 0
	v_lshl_add_u32 v11, s3, 3, v13
	v_cmp_ne_u32_e32 vcc_lo, s17, v7
	s_delay_alu instid0(VALU_DEP_3)
	v_mov_b32_e32 v9, v8
	ds_store_b64 v11, v[8:9] offset:88
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_13
; %bb.12:
	v_dual_mov_b32 v10, v8 :: v_dual_add_nc_u32 v9, s2, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[8:9], 3, v[9:10]
	v_add_co_u32 v8, vcc_lo, s6, v8
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v9, vcc_lo, s7, v9, vcc_lo
	global_load_b64 v[8:9], v[8:9], off
	s_waitcnt vmcnt(0)
	ds_store_b64 v11, v[8:9] offset:88
.LBB1_13:
	s_or_b32 exec_lo, exec_lo, s0
	v_mov_b32_e32 v8, 0
	v_mov_b32_e32 v9, 0x3ff00000
	s_mov_b32 s1, exec_lo
	s_waitcnt vmcnt(0) lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	v_cmpx_ne_u32_e64 s17, v7
	s_cbranch_execz .LBB1_27
; %bb.14:
                                        ; implicit-def: $vgpr8_vgpr9
	s_mov_b32 s0, exec_lo
	v_cmpx_ne_u32_e32 0, v7
	s_xor_b32 s2, exec_lo, s0
	s_cbranch_execz .LBB1_24
; %bb.15:
                                        ; implicit-def: $vgpr8_vgpr9
	s_mov_b32 s0, exec_lo
	v_cmpx_ne_u32_e32 0, v6
	s_xor_b32 s3, exec_lo, s0
	s_cbranch_execz .LBB1_21
; %bb.16:
                                        ; implicit-def: $vgpr8_vgpr9
	s_mov_b32 s0, exec_lo
	v_cmpx_ne_u32_e64 s16, v6
	s_xor_b32 s4, exec_lo, s0
	s_cbranch_execz .LBB1_18
; %bb.17:
	v_mul_f64 v[12:13], s[14:15], s[14:15]
	v_mul_f64 v[16:17], s[10:11], s[10:11]
	v_mul_f64 v[18:19], s[12:13], s[12:13]
	v_fma_f64 v[4:5], v[2:3], 2.0, -v[4:5]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_scale_f64 v[6:7], null, v[16:17], v[16:17], v[12:13]
	v_div_scale_f64 v[10:11], null, v[18:19], v[18:19], v[12:13]
	v_div_scale_f64 v[26:27], vcc_lo, v[12:13], v[16:17], v[12:13]
	v_div_scale_f64 v[28:29], s0, v[12:13], v[18:19], v[12:13]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_rcp_f64_e32 v[8:9], v[6:7]
	v_rcp_f64_e32 v[20:21], v[10:11]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[22:23], -v[6:7], v[8:9], 1.0
	v_fma_f64 v[24:25], -v[10:11], v[20:21], 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[8:9], v[8:9], v[22:23], v[8:9]
	v_fma_f64 v[20:21], v[20:21], v[24:25], v[20:21]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[22:23], -v[6:7], v[8:9], 1.0
	v_fma_f64 v[24:25], -v[10:11], v[20:21], 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[22:23], v[8:9], v[22:23], v[8:9]
	v_fma_f64 v[20:21], v[20:21], v[24:25], v[20:21]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[24:25], v[26:27], v[22:23]
	v_mul_f64 v[30:31], v[28:29], v[20:21]
	s_delay_alu instid0(VALU_DEP_2)
	v_fma_f64 v[26:27], -v[6:7], v[24:25], v[26:27]
	ds_load_2addr_b64 v[6:9], v15 offset0:12 offset1:21
	v_fma_f64 v[28:29], -v[10:11], v[30:31], v[28:29]
	s_waitcnt lgkmcnt(0)
	v_fma_f64 v[32:33], v[2:3], -2.0, v[8:9]
	ds_load_2addr_b64 v[8:11], v15 offset0:1 offset1:10
	v_fma_f64 v[2:3], v[2:3], -2.0, v[6:7]
	v_div_fmas_f64 v[22:23], v[26:27], v[22:23], v[24:25]
	s_mov_b32 vcc_lo, s0
	v_div_fmas_f64 v[14:15], v[28:29], v[20:21], v[30:31]
	s_waitcnt lgkmcnt(0)
	v_add_f64 v[8:9], v[32:33], v[8:9]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_f64 v[2:3], v[2:3], v[10:11]
	v_div_fixup_f64 v[16:17], v[22:23], v[16:17], v[12:13]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_div_fixup_f64 v[6:7], v[14:15], v[18:19], v[12:13]
                                        ; implicit-def: $vgpr15
	v_fma_f64 v[4:5], v[16:17], v[8:9], v[4:5]
	s_delay_alu instid0(VALU_DEP_1)
	v_fma_f64 v[8:9], v[6:7], v[2:3], v[4:5]
                                        ; implicit-def: $vgpr2_vgpr3
.LBB1_18:                               ; %Flow
	s_and_not1_saveexec_b32 s0, s4
	s_cbranch_execz .LBB1_20
; %bb.19:
	v_div_scale_f64 v[4:5], null, s[10:11], s[10:11], s[14:15]
	v_div_scale_f64 v[10:11], vcc_lo, s[14:15], s[10:11], s[14:15]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[6:7], v[4:5]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[8:9], -v[4:5], 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[4:5], 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[4:5], -v[4:5], v[8:9], v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[4:5], v[4:5], v[6:7], v[8:9]
	ds_load_b64 v[6:7], v15 offset:8
	s_waitcnt lgkmcnt(0)
	v_add_f64 v[6:7], v[2:3], -v[6:7]
	v_div_fixup_f64 v[4:5], v[4:5], s[10:11], s[14:15]
	v_fma_f64 v[8:9], -v[4:5], v[6:7], v[2:3]
.LBB1_20:                               ; %Flow143
	s_or_b32 exec_lo, exec_lo, s0
                                        ; implicit-def: $vgpr15
                                        ; implicit-def: $vgpr2_vgpr3
.LBB1_21:                               ; %Flow144
	s_and_not1_saveexec_b32 s0, s3
	s_cbranch_execz .LBB1_23
; %bb.22:
	v_div_scale_f64 v[4:5], null, s[10:11], s[10:11], s[14:15]
	v_div_scale_f64 v[10:11], vcc_lo, s[14:15], s[10:11], s[14:15]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[6:7], v[4:5]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[8:9], -v[4:5], 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[4:5], 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[4:5], -v[4:5], v[8:9], v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[4:5], v[4:5], v[6:7], v[8:9]
	ds_load_b64 v[6:7], v15 offset:168
	s_waitcnt lgkmcnt(0)
	v_add_f64 v[6:7], v[6:7], -v[2:3]
	v_div_fixup_f64 v[4:5], v[4:5], s[10:11], s[14:15]
	v_fma_f64 v[8:9], v[4:5], v[6:7], v[2:3]
.LBB1_23:                               ; %Flow145
	s_or_b32 exec_lo, exec_lo, s0
                                        ; implicit-def: $vgpr15
                                        ; implicit-def: $vgpr2_vgpr3
.LBB1_24:                               ; %Flow146
	s_and_not1_saveexec_b32 s0, s2
	s_cbranch_execz .LBB1_26
; %bb.25:
	v_div_scale_f64 v[4:5], null, s[12:13], s[12:13], s[14:15]
	v_div_scale_f64 v[10:11], vcc_lo, s[14:15], s[12:13], s[14:15]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[6:7], v[4:5]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[8:9], -v[4:5], 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[4:5], 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[4:5], -v[4:5], v[8:9], v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[4:5], v[4:5], v[6:7], v[8:9]
	ds_load_b64 v[6:7], v15 offset:96
	s_waitcnt lgkmcnt(0)
	v_add_f64 v[6:7], v[6:7], -v[2:3]
	v_div_fixup_f64 v[4:5], v[4:5], s[12:13], s[14:15]
	v_fma_f64 v[8:9], v[4:5], v[6:7], v[2:3]
.LBB1_26:                               ; %Flow147
	s_or_b32 exec_lo, exec_lo, s0
.LBB1_27:
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s1
	v_add_co_u32 v0, vcc_lo, s8, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s9, v1, vcc_lo
	global_store_b64 v[0:1], v[8:9], off
.LBB1_28:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8calcNodePdS_S_ddddii
		.amdhsa_group_segment_fixed_size 800
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 320
		.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 34
		.amdhsa_next_free_sgpr 18
		.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	_Z8calcNodePdS_S_ddddii, .Lfunc_end1-_Z8calcNodePdS_S_ddddii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1576
; NumSgprs: 20
; NumVgprs: 34
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 800 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 4
; NumSGPRsForWavesPerEU: 20
; NumVGPRsForWavesPerEU: 34
; 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
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           8
        .value_kind:     by_value
      - .offset:         32
        .size:           8
        .value_kind:     by_value
      - .offset:         40
        .size:           8
        .value_kind:     by_value
      - .offset:         48
        .size:           8
        .value_kind:     by_value
      - .offset:         56
        .size:           4
        .value_kind:     by_value
      - .offset:         60
        .size:           4
        .value_kind:     by_value
      - .offset:         64
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         68
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         72
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         76
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         78
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         80
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         82
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         84
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         86
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         112
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         120
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         128
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 320
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14calcNodeSimplePdS_S_ddddii
    .private_segment_fixed_size: 0
    .sgpr_count:     20
    .sgpr_spill_count: 0
    .symbol:         _Z14calcNodeSimplePdS_S_ddddii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     38
    .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
      - .offset:         24
        .size:           8
        .value_kind:     by_value
      - .offset:         32
        .size:           8
        .value_kind:     by_value
      - .offset:         40
        .size:           8
        .value_kind:     by_value
      - .offset:         48
        .size:           8
        .value_kind:     by_value
      - .offset:         56
        .size:           4
        .value_kind:     by_value
      - .offset:         60
        .size:           4
        .value_kind:     by_value
      - .offset:         64
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         68
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         72
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         76
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         78
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         80
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         82
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         84
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         86
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         112
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         120
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         128
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 800
    .kernarg_segment_align: 8
    .kernarg_segment_size: 320
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8calcNodePdS_S_ddddii
    .private_segment_fixed_size: 0
    .sgpr_count:     20
    .sgpr_spill_count: 0
    .symbol:         _Z8calcNodePdS_S_ddddii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     34
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
