
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <cuda.h>

#include <stdio.h>
#include <device_functions.h>

//#include "device_launch_parameters.h"

#include <cuda_runtime_api.h>

#include <iostream>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cmath>
#include <time.h>
using namespace std;

const int range = 128;
const int workPerThread = 64;//cannot be smaller than the range
int halfRange = range / 2;
float cube[range*range*range];
int weight[range*range*range];

bool ou[range][range][range];
//float p = 0.8;

__global__
void calculate(float *cubecu, int *weightcu, float *pixelcu, float *rotcu,float mx,float my,float mz,int range,int workPerThread)// float *mxcu, float *mycu, float *mzcu, int *rangecu)
{
	float pos1[3];
	float pos2[3];
	int pos3[3];
	int i, j, k,l,m;
	float tmp1;
	int posInCube;
	int zdim;
	__shared__ float rotcus[9];//,range;
	__shared__ float pixelcus[10000];
	int xtot = 99;
	int ytot = 99;
	int total = xtot*ytot;
	int pixelstart= (threadIdx.y*blockDim.x + threadIdx.x)*64;
	int pixelend=pixelstart+64;
	if (pixelend > total)
		pixelend = total;
	for (i=pixelstart;i<pixelend;i++)//parallel fetch the depth image
		pixelcus[i] = pixelcu[i];
	if ((threadIdx.x == 0) && (threadIdx.y == 0) && (threadIdx.z == 0))
	{
		for (i = 0; i < 9; i++)
			rotcus[i] = rotcu[i];
		//for (i = 0; i <total; i++)
			//pixelcus[i] = pixelcu[i];
	}
	__syncthreads();
	i = blockDim.x*blockIdx.x + threadIdx.x;
	j = blockDim.y*blockIdx.y + threadIdx.y;
	for (zdim = 0; zdim < workPerThread; zdim++)
	{
		//k = blockDim.z*blockIdx.z + threadIdx.z;
		k = workPerThread * blockIdx.z + zdim;
		//cubecu[k*range*range + j*range + i] = rotcus[0];
		pos1[0] = i*0.2 / (range)-0.1 - mx;
		pos1[1] = j*0.2 / (range)-my;
		pos1[2] = k*0.2 / (range)-0.1 - mz;
		for (l = 0; l < 3; l++)
		{
			pos2[l] = 0;
			for (m = 0; m < 3; m++)
			{
				pos2[l] = pos2[l] + rotcus[l * 3 + m] * pos1[m];
			}
		}
		pos3[0] = int((pos2[0] + 0.1) / 0.002 + 0.5);
		pos3[1] = int(pos2[1] / 0.002 + 0.5);
		//if ((blockIdx.x == 0) && (blockIdx.y == 0) && (blockIdx.z == 0) && (threadIdx.x == 0) && (threadIdx.y == 0) && (threadIdx.z == 0))
			//cubecu[k*range*range + j*range + i]=rotcus[0];
			//cubecu[0] = 2.0;
		if (((pos3[0] * ytot + pos3[1]) < xtot*ytot) && ((pos3[0] * ytot + pos3[1]) >= 0))
			if (pixelcus[pos3[0] * ytot + pos3[1]] > -0.01)
			{
				//cubecu[k*range*range + j*range + i] = range;
				tmp1 = (pixelcus[pos3[0] * ytot + pos3[1]] - pos2[2]) / 0.001;
				if ((tmp1 > 1) || (tmp1 < -1))
					tmp1 = 0;
				posInCube = i*range*range + j*range + k;
				cubecu[posInCube] = (cubecu[posInCube] * weightcu[posInCube] + tmp1) / (weightcu[posInCube] + 1);
				weightcu[posInCube] = weightcu[posInCube] + 1;
			}
	}
}

void pro(string a1, float *cubecu, int *weightcu)//calculate rotation matrix and call the 'calculate' function
{
	int xtot, ytot;
	int i, j;
	float mx, my, mz, rx, ry, rz,an;
	float rot[9];
	float pixel[100 * 100];
	float *pixelcu, *rotcu;
	a1 += "data.txt";
	ifstream fin1(a1);
	fin1 >> mx;
	fin1 >> my;
	fin1 >> mz;
	fin1 >> rx;
	fin1 >> ry;
	fin1 >> rz;
	fin1 >> an;
	fin1 >> xtot;
	fin1 >> ytot;
	for (i = 0; i<xtot; i++)
		for (j = 0; j<ytot; j++)
		{
			fin1 >> pixel[j+i*ytot];
		}
	fin1.close();

	rot[0] = 1 - 2 * ry*ry - 2 * rz*rz;
	rot[1] = 2 * rx*ry - 2 * rz*an;
	rot[2] = 2 * rx*rz + 2 * ry*an;
	rot[3] = 2 * rx*ry + 2 * rz*an;
	rot[4] = 1 - 2 * rx*rx - 2 * rz*rz;
	rot[5] = 2 * ry*rz - 2 * rx*an;
	rot[6] = 2 * rx*rz - 2 * ry*an;
	rot[7] = 2 * ry*rz + 2 * rx*an;
	rot[8] = 1 - 2 * rx*rx - 2 * ry*ry;
	dim3 gb(range/32, range/32, range/workPerThread);
	dim3 tb(32, 32, 1);//I set the dimension of x and y as 32 because the max threadNum per block is 1024
	cudaMalloc((void **)&pixelcu, xtot*ytot * sizeof(float));
	cudaMemcpy(pixelcu, pixel, xtot*ytot*sizeof(float), cudaMemcpyHostToDevice);
	cudaMalloc((void **)&rotcu, 9 * sizeof(float));
	cudaMemcpy(rotcu, rot, 9 * sizeof(float), cudaMemcpyHostToDevice);

	calculate <<<gb, tb >>> (cubecu, weightcu, pixelcu, rotcu, mx, my, mz, range,workPerThread);
	//cudaFree(&mxcu); cudaFree(&mycu); cudaFree(&mzcu); cudaFree(&rangecu);
	cudaThreadSynchronize();
	cudaFree(pixelcu);
	cudaFree(rotcu);
}

int main()
{
	char tmp;
	int totalVertexOut;
	int i, j, k;
	float *cubecu;
	int *weightcu;

	clock_t startt = clock();
	if (cudaSuccess != cudaMalloc((void **)&cubecu, range*range*range * sizeof(float)))
		cout << "error1";
	if (cudaSuccess != cudaMemset(cubecu, 0, range*range*range * sizeof(float)))
		cout << "error2";
	
	if (cudaSuccess != cudaMalloc((void **)&weightcu, range*range*range * sizeof(int)))
		cout << "error3";

	if (cudaSuccess != cudaMemset(weightcu, 0, range*range*range * sizeof(int)))
		cout << "error4";
	//----------------load the pixels and calculate the 3D matrix-----------------------

	pro("bun000",cubecu,weightcu);
	pro("bun090",cubecu,weightcu);
	pro("bun180", cubecu, weightcu);
	pro("bun270", cubecu, weightcu);
	pro("bun045", cubecu, weightcu);
	pro("ear_back", cubecu, weightcu);
	pro("top2", cubecu, weightcu);
	pro("top3", cubecu, weightcu);
	pro("bun315", cubecu, weightcu);
	pro("chin", cubecu, weightcu);
	//-----------------------------------------------------
	cudaMemcpy(cube, cubecu, range*range*range * sizeof(float), cudaMemcpyDeviceToHost);
	cudaMemcpy(weight, weightcu, range*range*range * sizeof(int), cudaMemcpyDeviceToHost);
	cudaFree(cubecu);
	cudaFree(weightcu);
	tmp = char(10);
	ofstream fout1("bunoutparallel.ply");
	totalVertexOut = 0;

	//----------------struct the final output model------------------------

	for (i = 0; i<range - 1; i++)
		for (j = 0; j<range - 1; j++)
			for (k = 0; k<range - 1; k++)
			{
				ou[i][j][k] = false;
				if (weight[i*range*range+j*range+k]>0)
				{
					if (weight[(i+1)*range*range+j*range+k]>0)
						if (cube[i*range*range + j*range + k] * cube[(i + 1)*range*range + j*range + k]<0)
							ou[i][j][k] = true;
					if (weight[i*range*range+(j+1)*range+k]>0)
						if (cube[i *range*range + j*range + k] * cube[i*range*range + (j + 1)*range + k]<0)
							ou[i][j][k] = true;
					if (weight[i*range*range +j*range+(k+1)]>0)
						if (cube[i*range*range + j*range + k] * cube[i*range*range + j*range + (k + 1)]<0)
							ou[i][j][k] = true;
					if (ou[i][j][k] == true)
						totalVertexOut++;
				}
				else
					ou[i][j][k] = false;
			}

	//-----------------------------------------------------------
	clock_t endt = clock();
	fout1 << "ply" << tmp << "format ascii 1.0" << tmp;
	fout1 << "element vertex " << totalVertexOut << tmp;
	fout1 << "property float x" << tmp;
	fout1 << "property float y" << tmp;
	fout1 << "property float z" << tmp;
	fout1 << "end_header" << tmp;

	for (i = 0; i<range - 1; i++)
		for (j = 0; j<range - 1; j++)
			for (k = 0; k<range - 1; k++)
				if (ou[i][j][k] == true)
				{
					fout1 << i - halfRange << ' ' << j - halfRange << ' ' << k - halfRange << tmp;
				}

	fout1.close();
	ofstream fout2("calculateTime");
	double time = (double)(endt - startt) / CLOCKS_PER_SEC;
	fout2 << "cubesize:" << range << '*' << range << '*' << range << '\n';
	fout2 << "time used (without initialize and output part):" << time << '\n';
	fout2.close();
	return 0;
}

	.file	"tmpxft_002f1743_00000000-6_kernel.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3770:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3770:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSirsERf.isra.0, @function
_ZNSirsERf.isra.0:
.LFB4503:
	.cfi_startproc
	jmp	_ZNSi10_M_extractIfEERSiRT_@PLT
	.cfi_endproc
.LFE4503:
	.size	_ZNSirsERf.isra.0, .-_ZNSirsERf.isra.0
	.globl	_Z39__device_stub__Z9calculatePfPiS_S_fffiiPfPiS_S_fffii
	.type	_Z39__device_stub__Z9calculatePfPiS_S_fffiiPfPiS_S_fffii, @function
_Z39__device_stub__Z9calculatePfPiS_S_fffiiPfPiS_S_fffii:
.LFB3792:
	.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
	movq	%rcx, 32(%rsp)
	leaq	72(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movss	%xmm0, 28(%rsp)
	movss	%xmm1, 24(%rsp)
	movss	%xmm2, 20(%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	28(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 184(%rsp)
	leaq	12(%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	.L3
	pushq	72(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z9calculatePfPiS_S_fffii(%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
.L3:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3792:
	.size	_Z39__device_stub__Z9calculatePfPiS_S_fffiiPfPiS_S_fffii, .-_Z39__device_stub__Z9calculatePfPiS_S_fffiiPfPiS_S_fffii
	.globl	_Z9calculatePfPiS_S_fffii
	.type	_Z9calculatePfPiS_S_fffii, @function
_Z9calculatePfPiS_S_fffii:
.LFB3793:
	.cfi_startproc
	endbr64
	jmp	_Z39__device_stub__Z9calculatePfPiS_S_fffiiPfPiS_S_fffii
	.cfi_endproc
.LFE3793:
	.size	_Z9calculatePfPiS_S_fffii, .-_Z9calculatePfPiS_S_fffii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z9calculatePfPiS_S_fffii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3795:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z9calculatePfPiS_S_fffii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3795:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC1:
	.string	"basic_string::append"
.LC2:
	.string	"data.txt"
	.text
	.globl	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
	.type	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi, @function
_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi:
.LFB3766:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3766
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36920
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3800, %rsp
	.cfi_def_cfa_offset 40720
	movq	%fs:40, %rax
	movq	%rax, 40648(%rsp)
	movabsq	$4611686018427387903, %rax
	subq	8(%rdi), %rax
	cmpq	$7, %rax
	ja	.L12
	movq	40648(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	leaq	.LC1(%rip), %rdi
.LEHB0:
	call	_ZSt20__throw_length_errorPKc@PLT
.L12:
	movq	%rdi, %rbp
	leaq	128(%rsp), %rbx
	movq	%rsi, %r12
	movq	%rdx, %r13
	leaq	.LC2(%rip), %rsi
	movl	$8, %edx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_appendEPKcm@PLT
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	movl	$8, %edx
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode@PLT
.LEHE0:
	leaq	20(%rsp), %rsi
	movq	%rbx, %rdi
.LEHB1:
	call	_ZNSirsERf.isra.0
	leaq	24(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZNSirsERf.isra.0
	leaq	28(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZNSirsERf.isra.0
	leaq	32(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZNSirsERf.isra.0
	leaq	36(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZNSirsERf.isra.0
	leaq	40(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZNSirsERf.isra.0
	leaq	44(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZNSirsERf.isra.0
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZNSirsERi@PLT
	leaq	16(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZNSirsERi@PLT
	xorl	%ebp, %ebp
	leaq	648(%rsp), %r15
.L14:
	cmpl	%ebp, 12(%rsp)
	jle	.L31
	xorl	%r14d, %r14d
.L16:
	movl	16(%rsp), %eax
	cmpl	%r14d, %eax
	jle	.L32
	imull	%ebp, %eax
	movq	%rbx, %rdi
	addl	%r14d, %eax
	cltq
	leaq	(%r15,%rax,4), %rsi
	call	_ZNSirsERf.isra.0
	incl	%r14d
	jmp	.L16
.L32:
	incl	%ebp
	jmp	.L14
.L31:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
	movss	36(%rsp), %xmm0
	movss	40(%rsp), %xmm4
	movabsq	$17179869188, %rax
	leaq	48(%rsp), %rdi
	movss	32(%rsp), %xmm5
	movss	44(%rsp), %xmm9
	movq	%rax, 68(%rsp)
	movabsq	$137438953504, %rax
	movaps	%xmm0, %xmm1
	movaps	%xmm0, %xmm7
	movaps	%xmm4, %xmm6
	movl	12(%rsp), %esi
	addss	%xmm0, %xmm1
	addss	%xmm4, %xmm6
	movaps	%xmm4, %xmm11
	movss	.LC3(%rip), %xmm2
	imull	16(%rsp), %esi
	movl	$2, 76(%rsp)
	movaps	%xmm2, %xmm3
	movq	%rax, 80(%rsp)
	mulss	%xmm1, %xmm7
	movaps	%xmm1, %xmm10
	movl	$1, 88(%rsp)
	mulss	%xmm6, %xmm11
	movslq	%esi, %rsi
	mulss	%xmm9, %xmm6
	salq	$2, %rsi
	mulss	%xmm4, %xmm1
	mulss	%xmm9, %xmm10
	subss	%xmm7, %xmm3
	subss	%xmm11, %xmm3
	movss	%xmm3, 92(%rsp)
	movaps	%xmm5, %xmm3
	addss	%xmm5, %xmm3
	mulss	%xmm3, %xmm0
	mulss	%xmm3, %xmm5
	movaps	%xmm0, %xmm8
	addss	%xmm6, %xmm0
	subss	%xmm6, %xmm8
	subss	%xmm5, %xmm2
	movss	%xmm0, 104(%rsp)
	movss	%xmm8, 96(%rsp)
	movaps	%xmm4, %xmm8
	movaps	%xmm2, %xmm0
	subss	%xmm7, %xmm2
	mulss	%xmm3, %xmm8
	subss	%xmm11, %xmm0
	mulss	%xmm9, %xmm3
	movss	%xmm2, 124(%rsp)
	movss	%xmm0, 108(%rsp)
	movaps	%xmm1, %xmm0
	movaps	%xmm8, %xmm12
	subss	%xmm10, %xmm8
	addss	%xmm10, %xmm12
	subss	%xmm3, %xmm0
	addss	%xmm3, %xmm1
	movss	%xmm8, 116(%rsp)
	movss	%xmm12, 100(%rsp)
	movss	%xmm0, 112(%rsp)
	movss	%xmm1, 120(%rsp)
	call	cudaMalloc@PLT
	movl	12(%rsp), %edx
	imull	16(%rsp), %edx
	movl	$1, %ecx
	leaq	648(%rsp), %rsi
	movq	48(%rsp), %rdi
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	leaq	56(%rsp), %rdi
	movl	$36, %esi
	call	cudaMalloc@PLT
	movq	56(%rsp), %rdi
	leaq	92(%rsp), %rsi
	movl	$1, %ecx
	movl	$36, %edx
	call	cudaMemcpy@PLT
	movl	88(%rsp), %ecx
	movq	80(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	68(%rsp), %rdi
	movl	76(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L17
.L19:
	call	cudaThreadSynchronize@PLT
	jmp	.L33
.L17:
	movq	56(%rsp), %rcx
	movq	48(%rsp), %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	movss	28(%rsp), %xmm2
	movss	24(%rsp), %xmm1
	movl	$64, %r9d
	movl	$128, %r8d
	movss	20(%rsp), %xmm0
	call	_Z39__device_stub__Z9calculatePfPiS_S_fffiiPfPiS_S_fffii
	jmp	.L19
.L33:
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
.LEHE1:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	40648(%rsp), %rax
	subq	%fs:40, %rax
	je	.L22
	jmp	.L28
.L25:
	endbr64
	movq	%rax, %rbp
.L20:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	40648(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	movq	%rbp, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L28:
	call	__stack_chk_fail@PLT
.L22:
	addq	$40664, %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
.LFE3766:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3766:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3766-.LLSDACSB3766
.LLSDACSB3766:
	.uleb128 .LEHB0-.LFB3766
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3766
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L25-.LFB3766
	.uleb128 0
	.uleb128 .LEHB2-.LFB3766
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE3766:
	.text
	.size	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi, .-_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
	.section	.rodata._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.str1.1,"aMS",@progbits,1
.LC4:
	.string	"basic_string: construction from null is not valid"
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC5IS3_EEPKcRKS3_,comdat
	.align 2
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_:
.LFB4123:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	jne	.L35
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	leaq	.LC4(%rip), %rdi
	call	_ZSt19__throw_logic_errorPKc@PLT
.L35:
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movq	%rsi, %rbp
	call	strlen@PLT
	movq	%rax, (%rsp)
	leaq	0(%rbp,%rax), %r12
	cmpq	$15, %rax
	jbe	.L37
	movq	%rsp, %rsi
	xorl	%edx, %edx
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
	movq	%rax, (%rbx)
	movq	(%rsp), %rax
	movq	%rax, 16(%rbx)
.L37:
	movq	(%rbx), %rdi
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	(%rsp), %rax
	movq	(%rbx), %rdx
	movq	%rax, 8(%rbx)
	movb	$0, (%rdx,%rax)
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L38
.L40:
	call	__stack_chk_fail@PLT
.L38:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4123:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
	.set	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.section	.rodata.str1.1
.LC5:
	.string	"error1"
.LC6:
	.string	"error2"
.LC7:
	.string	"error3"
.LC8:
	.string	"error4"
.LC9:
	.string	"bun000"
.LC10:
	.string	"bun090"
.LC11:
	.string	"bun180"
.LC12:
	.string	"bun270"
.LC13:
	.string	"bun045"
.LC14:
	.string	"ear_back"
.LC15:
	.string	"top2"
.LC16:
	.string	"top3"
.LC17:
	.string	"bun315"
.LC18:
	.string	"chin"
.LC19:
	.string	"bunoutparallel.ply"
.LC21:
	.string	"ply"
.LC22:
	.string	"format ascii 1.0"
.LC23:
	.string	"element vertex "
.LC24:
	.string	"property float x"
.LC25:
	.string	"property float y"
.LC26:
	.string	"property float z"
.LC27:
	.string	"end_header"
.LC28:
	.string	"calculateTime"
.LC30:
	.string	"cubesize:"
.LC31:
	.string	"time used (without initialize and output part):"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3767:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3767
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1096, %rsp
	.cfi_def_cfa_offset 1152
	movq	%fs:40, %rax
	movq	%rax, 1080(%rsp)
	xorl	%eax, %eax
	call	clock@PLT
	leaq	40(%rsp), %rdi
	movl	$8388608, %esi
	movq	%rax, 24(%rsp)
.LEHB3:
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L42
	leaq	.LC5(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L42:
	movq	40(%rsp), %rdi
	xorl	%esi, %esi
	movl	$8388608, %edx
	call	cudaMemset@PLT
	testl	%eax, %eax
	je	.L43
	leaq	.LC6(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L43:
	leaq	48(%rsp), %rdi
	movl	$8388608, %esi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L44
	leaq	.LC7(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L44:
	movq	48(%rsp), %rdi
	xorl	%esi, %esi
	movl	$8388608, %edx
	call	cudaMemset@PLT
	testl	%eax, %eax
	je	.L45
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L45:
	movq	48(%rsp), %r13
	movq	40(%rsp), %r12
	leaq	568(%rsp), %rbx
	leaq	39(%rsp), %rbp
	movq	%rbp, %rdx
	leaq	.LC9(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE3:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbx, %rdi
.LEHB4:
	call	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.LEHE4:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	48(%rsp), %r13
	movq	%rbp, %rdx
	movq	%rbx, %rdi
	movq	40(%rsp), %r12
	leaq	.LC10(%rip), %rsi
.LEHB5:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE5:
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
.LEHB6:
	call	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.LEHE6:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	48(%rsp), %r13
	movq	%rbp, %rdx
	movq	%rbx, %rdi
	movq	40(%rsp), %r12
	leaq	.LC11(%rip), %rsi
.LEHB7:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE7:
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
.LEHB8:
	call	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.LEHE8:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	48(%rsp), %r13
	movq	%rbp, %rdx
	movq	%rbx, %rdi
	movq	40(%rsp), %r12
	leaq	.LC12(%rip), %rsi
.LEHB9:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE9:
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
.LEHB10:
	call	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.LEHE10:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	48(%rsp), %r13
	movq	%rbp, %rdx
	movq	%rbx, %rdi
	movq	40(%rsp), %r12
	leaq	.LC13(%rip), %rsi
.LEHB11:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE11:
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
.LEHB12:
	call	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.LEHE12:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	48(%rsp), %r13
	movq	%rbp, %rdx
	movq	%rbx, %rdi
	movq	40(%rsp), %r12
	leaq	.LC14(%rip), %rsi
.LEHB13:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE13:
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
.LEHB14:
	call	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.LEHE14:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	48(%rsp), %r13
	movq	%rbp, %rdx
	movq	%rbx, %rdi
	movq	40(%rsp), %r12
	leaq	.LC15(%rip), %rsi
.LEHB15:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE15:
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
.LEHB16:
	call	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.LEHE16:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	48(%rsp), %r13
	movq	%rbp, %rdx
	movq	%rbx, %rdi
	movq	40(%rsp), %r12
	leaq	.LC16(%rip), %rsi
.LEHB17:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE17:
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
.LEHB18:
	call	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.LEHE18:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	48(%rsp), %r13
	movq	%rbp, %rdx
	movq	%rbx, %rdi
	movq	40(%rsp), %r12
	leaq	.LC17(%rip), %rsi
.LEHB19:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE19:
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
.LEHB20:
	call	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.LEHE20:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	48(%rsp), %r13
	movq	%rbp, %rdx
	movq	%rbx, %rdi
	movq	40(%rsp), %r12
	leaq	.LC18(%rip), %rsi
.LEHB21:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE21:
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
.LEHB22:
	call	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.LEHE22:
	movq	%rbx, %rdi
	leaq	cube(%rip), %rbx
	leaq	weight(%rip), %rbp
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbx, %rdi
	leaq	4(%rbp), %r15
	leaq	4(%rbx), %r12
	movq	40(%rsp), %rsi
	movl	$2, %ecx
	movl	$8388608, %edx
.LEHB23:
	call	cudaMemcpy@PLT
	movq	48(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbp, %rdi
	movl	$8388608, %edx
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	leaq	56(%rsp), %rax
	movl	$16, %edx
	leaq	.LC19(%rip), %rsi
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE23:
	leaq	ou(%rip), %rax
	xorl	%ecx, %ecx
	xorps	%xmm0, %xmm0
	movq	%rax, 16(%rsp)
	movq	%rax, %r11
	xorl	%eax, %eax
	movl	%eax, 12(%rsp)
.L46:
	movl	%ecx, %r8d
	movq	%r11, %r10
	xorl	%edi, %edi
	sall	$7, %r8d
.L59:
	leaq	(%rdi,%rcx), %rax
	movq	%r10, %rdx
	leal	16384(%r8), %r14d
	xorl	%esi, %esi
	salq	$9, %rax
	leal	128(%r8), %r13d
.L56:
	cmpl	$0, 0(%rbp,%rax)
	movb	$0, (%rdx)
	jle	.L55
	leal	(%r14,%rsi), %r9d
	movslq	%r9d, %r9
	cmpl	$0, 0(%rbp,%r9,4)
	jle	.L48
	movss	(%rbx,%rax), %xmm1
	mulss	(%rbx,%r9,4), %xmm1
	comiss	%xmm1, %xmm0
	jbe	.L48
	movb	$1, (%rdx)
.L48:
	leal	0(%r13,%rsi), %r9d
	movslq	%r9d, %r9
	cmpl	$0, 0(%rbp,%r9,4)
	jle	.L50
	movss	(%rbx,%rax), %xmm1
	mulss	(%rbx,%r9,4), %xmm1
	comiss	%xmm1, %xmm0
	jbe	.L50
	movb	$1, (%rdx)
.L50:
	cmpl	$0, (%r15,%rax)
	jle	.L52
	movss	(%rbx,%rax), %xmm1
	mulss	(%r12,%rax), %xmm1
	comiss	%xmm1, %xmm0
	jbe	.L52
	movb	$1, (%rdx)
	jmp	.L54
.L52:
	cmpb	$0, (%rdx)
	je	.L55
.L54:
	incl	12(%rsp)
.L55:
	incl	%esi
	incq	%rdx
	addq	$4, %rax
	cmpl	$127, %esi
	jne	.L56
	incq	%rdi
	subq	$-128, %r10
	subl	$-128, %r8d
	cmpq	$127, %rdi
	jne	.L59
	subq	$-128, %rcx
	addq	$16384, %r11
	cmpq	$16256, %rcx
	jne	.L46
	call	clock@PLT
	movq	(%rsp), %rdi
	leaq	.LC21(%rip), %rsi
	movq	%rax, %rbx
.LEHB24:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movq	%rax, %rdi
	leaq	.LC22(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movq	(%rsp), %rdi
	leaq	.LC23(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	12(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movq	(%rsp), %rdi
	leaq	.LC24(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movq	(%rsp), %rdi
	leaq	.LC25(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movq	(%rsp), %rdi
	leaq	.LC26(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movq	(%rsp), %rdi
	leaq	.LC27(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	xorl	%r13d, %r13d
.L60:
	movq	16(%rsp), %r14
	movl	%r13d, %r15d
	xorl	%r12d, %r12d
.L65:
	xorl	%ebp, %ebp
.L62:
	cmpb	$0, (%r14,%rbp)
	je	.L61
	movq	(%rsp), %rdi
	movl	%r15d, %esi
	subl	halfRange(%rip), %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movl	$32, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movl	%r12d, %esi
	movq	%rax, %rdi
	subl	halfRange(%rip), %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movl	$32, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movl	%ebp, %esi
	movq	%rax, %rdi
	subl	halfRange(%rip), %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
.L61:
	incq	%rbp
	cmpq	$127, %rbp
	jne	.L62
	incl	%r12d
	subq	$-128, %r14
	cmpl	$127, %r12d
	jne	.L65
	addq	$16384, 16(%rsp)
	incq	%r13
	cmpq	$127, %r13
	jne	.L60
	movq	(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
	leaq	568(%rsp), %rbp
	movl	$16, %edx
	leaq	.LC28(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE24:
	movq	24(%rsp), %rax
	leaq	.LC30(%rip), %rsi
	movq	%rbp, %rdi
	subq	%rax, %rbx
	cvtsi2sdq	%rbx, %xmm0
	divsd	.LC29(%rip), %xmm0
	movq	%xmm0, %rbx
.LEHB25:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$128, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movl	$42, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movq	%rax, %rdi
	movl	$128, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movl	$42, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movq	%rax, %rdi
	movl	$128, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	leaq	.LC31(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%rbx, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movq	%rbp, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
.LEHE25:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	leaq	56(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	1080(%rsp), %rax
	subq	%fs:40, %rax
	je	.L89
	jmp	.L121
.L91:
	endbr64
	jmp	.L126
.L92:
	endbr64
	jmp	.L126
.L93:
	endbr64
	jmp	.L126
.L94:
	endbr64
	jmp	.L126
.L95:
	endbr64
	jmp	.L126
.L96:
	endbr64
	jmp	.L126
.L97:
	endbr64
	jmp	.L126
.L98:
	endbr64
	jmp	.L126
.L99:
	endbr64
	jmp	.L126
.L100:
	endbr64
.L126:
	movq	%rax, %rbp
.L84:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	movq	1080(%rsp), %rax
	subq	%fs:40, %rax
	je	.L124
	jmp	.L121
.L102:
	endbr64
	movq	%rax, %rbx
.L86:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L87
.L101:
	endbr64
	movq	%rax, %rbx
.L87:
	movq	(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	%rbx, %rdi
	movq	1080(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L121
.L124:
.LEHB26:
	call	_Unwind_Resume@PLT
.LEHE26:
.L121:
	call	__stack_chk_fail@PLT
.L89:
	addq	$1096, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3767:
	.section	.gcc_except_table
.LLSDA3767:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3767-.LLSDACSB3767
.LLSDACSB3767:
	.uleb128 .LEHB3-.LFB3767
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB3767
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L91-.LFB3767
	.uleb128 0
	.uleb128 .LEHB5-.LFB3767
	.uleb128 .LEHE5-.LEHB5
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB6-.LFB3767
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L92-.LFB3767
	.uleb128 0
	.uleb128 .LEHB7-.LFB3767
	.uleb128 .LEHE7-.LEHB7
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB8-.LFB3767
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L93-.LFB3767
	.uleb128 0
	.uleb128 .LEHB9-.LFB3767
	.uleb128 .LEHE9-.LEHB9
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB10-.LFB3767
	.uleb128 .LEHE10-.LEHB10
	.uleb128 .L94-.LFB3767
	.uleb128 0
	.uleb128 .LEHB11-.LFB3767
	.uleb128 .LEHE11-.LEHB11
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB12-.LFB3767
	.uleb128 .LEHE12-.LEHB12
	.uleb128 .L95-.LFB3767
	.uleb128 0
	.uleb128 .LEHB13-.LFB3767
	.uleb128 .LEHE13-.LEHB13
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB14-.LFB3767
	.uleb128 .LEHE14-.LEHB14
	.uleb128 .L96-.LFB3767
	.uleb128 0
	.uleb128 .LEHB15-.LFB3767
	.uleb128 .LEHE15-.LEHB15
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB16-.LFB3767
	.uleb128 .LEHE16-.LEHB16
	.uleb128 .L97-.LFB3767
	.uleb128 0
	.uleb128 .LEHB17-.LFB3767
	.uleb128 .LEHE17-.LEHB17
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB18-.LFB3767
	.uleb128 .LEHE18-.LEHB18
	.uleb128 .L98-.LFB3767
	.uleb128 0
	.uleb128 .LEHB19-.LFB3767
	.uleb128 .LEHE19-.LEHB19
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB20-.LFB3767
	.uleb128 .LEHE20-.LEHB20
	.uleb128 .L99-.LFB3767
	.uleb128 0
	.uleb128 .LEHB21-.LFB3767
	.uleb128 .LEHE21-.LEHB21
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB22-.LFB3767
	.uleb128 .LEHE22-.LEHB22
	.uleb128 .L100-.LFB3767
	.uleb128 0
	.uleb128 .LEHB23-.LFB3767
	.uleb128 .LEHE23-.LEHB23
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB24-.LFB3767
	.uleb128 .LEHE24-.LEHB24
	.uleb128 .L101-.LFB3767
	.uleb128 0
	.uleb128 .LEHB25-.LFB3767
	.uleb128 .LEHE25-.LEHB25
	.uleb128 .L102-.LFB3767
	.uleb128 0
	.uleb128 .LEHB26-.LFB3767
	.uleb128 .LEHE26-.LEHB26
	.uleb128 0
	.uleb128 0
.LLSDACSE3767:
	.section	.text.startup
	.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
	.globl	ou
	.bss
	.align 32
	.type	ou, @object
	.size	ou, 2097152
ou:
	.zero	2097152
	.globl	weight
	.align 32
	.type	weight, @object
	.size	weight, 8388608
weight:
	.zero	8388608
	.globl	cube
	.align 32
	.type	cube, @object
	.size	cube, 8388608
cube:
	.zero	8388608
	.globl	halfRange
	.data
	.align 4
	.type	halfRange, @object
	.size	halfRange, 4
halfRange:
	.long	64
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC3:
	.long	1065353216
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC29:
	.long	0
	.long	1093567616
	.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 "hip/hip_runtime.h"



#include <stdio.h>
#include <hip/device_functions.h>

//#include "device_launch_parameters.h"

#include <hip/hip_runtime_api.h>

#include <iostream>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cmath>
#include <time.h>
using namespace std;

const int range = 128;
const int workPerThread = 64;//cannot be smaller than the range
int halfRange = range / 2;
float cube[range*range*range];
int weight[range*range*range];

bool ou[range][range][range];
//float p = 0.8;

__global__
void calculate(float *cubecu, int *weightcu, float *pixelcu, float *rotcu,float mx,float my,float mz,int range,int workPerThread)// float *mxcu, float *mycu, float *mzcu, int *rangecu)
{
	float pos1[3];
	float pos2[3];
	int pos3[3];
	int i, j, k,l,m;
	float tmp1;
	int posInCube;
	int zdim;
	__shared__ float rotcus[9];//,range;
	__shared__ float pixelcus[10000];
	int xtot = 99;
	int ytot = 99;
	int total = xtot*ytot;
	int pixelstart= (threadIdx.y*blockDim.x + threadIdx.x)*64;
	int pixelend=pixelstart+64;
	if (pixelend > total)
		pixelend = total;
	for (i=pixelstart;i<pixelend;i++)//parallel fetch the depth image
		pixelcus[i] = pixelcu[i];
	if ((threadIdx.x == 0) && (threadIdx.y == 0) && (threadIdx.z == 0))
	{
		for (i = 0; i < 9; i++)
			rotcus[i] = rotcu[i];
		//for (i = 0; i <total; i++)
			//pixelcus[i] = pixelcu[i];
	}
	__syncthreads();
	i = blockDim.x*blockIdx.x + threadIdx.x;
	j = blockDim.y*blockIdx.y + threadIdx.y;
	for (zdim = 0; zdim < workPerThread; zdim++)
	{
		//k = blockDim.z*blockIdx.z + threadIdx.z;
		k = workPerThread * blockIdx.z + zdim;
		//cubecu[k*range*range + j*range + i] = rotcus[0];
		pos1[0] = i*0.2 / (range)-0.1 - mx;
		pos1[1] = j*0.2 / (range)-my;
		pos1[2] = k*0.2 / (range)-0.1 - mz;
		for (l = 0; l < 3; l++)
		{
			pos2[l] = 0;
			for (m = 0; m < 3; m++)
			{
				pos2[l] = pos2[l] + rotcus[l * 3 + m] * pos1[m];
			}
		}
		pos3[0] = int((pos2[0] + 0.1) / 0.002 + 0.5);
		pos3[1] = int(pos2[1] / 0.002 + 0.5);
		//if ((blockIdx.x == 0) && (blockIdx.y == 0) && (blockIdx.z == 0) && (threadIdx.x == 0) && (threadIdx.y == 0) && (threadIdx.z == 0))
			//cubecu[k*range*range + j*range + i]=rotcus[0];
			//cubecu[0] = 2.0;
		if (((pos3[0] * ytot + pos3[1]) < xtot*ytot) && ((pos3[0] * ytot + pos3[1]) >= 0))
			if (pixelcus[pos3[0] * ytot + pos3[1]] > -0.01)
			{
				//cubecu[k*range*range + j*range + i] = range;
				tmp1 = (pixelcus[pos3[0] * ytot + pos3[1]] - pos2[2]) / 0.001;
				if ((tmp1 > 1) || (tmp1 < -1))
					tmp1 = 0;
				posInCube = i*range*range + j*range + k;
				cubecu[posInCube] = (cubecu[posInCube] * weightcu[posInCube] + tmp1) / (weightcu[posInCube] + 1);
				weightcu[posInCube] = weightcu[posInCube] + 1;
			}
	}
}

void pro(string a1, float *cubecu, int *weightcu)//calculate rotation matrix and call the 'calculate' function
{
	int xtot, ytot;
	int i, j;
	float mx, my, mz, rx, ry, rz,an;
	float rot[9];
	float pixel[100 * 100];
	float *pixelcu, *rotcu;
	a1 += "data.txt";
	ifstream fin1(a1);
	fin1 >> mx;
	fin1 >> my;
	fin1 >> mz;
	fin1 >> rx;
	fin1 >> ry;
	fin1 >> rz;
	fin1 >> an;
	fin1 >> xtot;
	fin1 >> ytot;
	for (i = 0; i<xtot; i++)
		for (j = 0; j<ytot; j++)
		{
			fin1 >> pixel[j+i*ytot];
		}
	fin1.close();

	rot[0] = 1 - 2 * ry*ry - 2 * rz*rz;
	rot[1] = 2 * rx*ry - 2 * rz*an;
	rot[2] = 2 * rx*rz + 2 * ry*an;
	rot[3] = 2 * rx*ry + 2 * rz*an;
	rot[4] = 1 - 2 * rx*rx - 2 * rz*rz;
	rot[5] = 2 * ry*rz - 2 * rx*an;
	rot[6] = 2 * rx*rz - 2 * ry*an;
	rot[7] = 2 * ry*rz + 2 * rx*an;
	rot[8] = 1 - 2 * rx*rx - 2 * ry*ry;
	dim3 gb(range/32, range/32, range/workPerThread);
	dim3 tb(32, 32, 1);//I set the dimension of x and y as 32 because the max threadNum per block is 1024
	hipMalloc((void **)&pixelcu, xtot*ytot * sizeof(float));
	hipMemcpy(pixelcu, pixel, xtot*ytot*sizeof(float), hipMemcpyHostToDevice);
	hipMalloc((void **)&rotcu, 9 * sizeof(float));
	hipMemcpy(rotcu, rot, 9 * sizeof(float), hipMemcpyHostToDevice);

	calculate <<<gb, tb >>> (cubecu, weightcu, pixelcu, rotcu, mx, my, mz, range,workPerThread);
	//cudaFree(&mxcu); cudaFree(&mycu); cudaFree(&mzcu); cudaFree(&rangecu);
	hipDeviceSynchronize();
	hipFree(pixelcu);
	hipFree(rotcu);
}

int main()
{
	char tmp;
	int totalVertexOut;
	int i, j, k;
	float *cubecu;
	int *weightcu;

	clock_t startt = clock();
	if (hipSuccess != hipMalloc((void **)&cubecu, range*range*range * sizeof(float)))
		cout << "error1";
	if (hipSuccess != hipMemset(cubecu, 0, range*range*range * sizeof(float)))
		cout << "error2";
	
	if (hipSuccess != hipMalloc((void **)&weightcu, range*range*range * sizeof(int)))
		cout << "error3";

	if (hipSuccess != hipMemset(weightcu, 0, range*range*range * sizeof(int)))
		cout << "error4";
	//----------------load the pixels and calculate the 3D matrix-----------------------

	pro("bun000",cubecu,weightcu);
	pro("bun090",cubecu,weightcu);
	pro("bun180", cubecu, weightcu);
	pro("bun270", cubecu, weightcu);
	pro("bun045", cubecu, weightcu);
	pro("ear_back", cubecu, weightcu);
	pro("top2", cubecu, weightcu);
	pro("top3", cubecu, weightcu);
	pro("bun315", cubecu, weightcu);
	pro("chin", cubecu, weightcu);
	//-----------------------------------------------------
	hipMemcpy(cube, cubecu, range*range*range * sizeof(float), hipMemcpyDeviceToHost);
	hipMemcpy(weight, weightcu, range*range*range * sizeof(int), hipMemcpyDeviceToHost);
	hipFree(cubecu);
	hipFree(weightcu);
	tmp = char(10);
	ofstream fout1("bunoutparallel.ply");
	totalVertexOut = 0;

	//----------------struct the final output model------------------------

	for (i = 0; i<range - 1; i++)
		for (j = 0; j<range - 1; j++)
			for (k = 0; k<range - 1; k++)
			{
				ou[i][j][k] = false;
				if (weight[i*range*range+j*range+k]>0)
				{
					if (weight[(i+1)*range*range+j*range+k]>0)
						if (cube[i*range*range + j*range + k] * cube[(i + 1)*range*range + j*range + k]<0)
							ou[i][j][k] = true;
					if (weight[i*range*range+(j+1)*range+k]>0)
						if (cube[i *range*range + j*range + k] * cube[i*range*range + (j + 1)*range + k]<0)
							ou[i][j][k] = true;
					if (weight[i*range*range +j*range+(k+1)]>0)
						if (cube[i*range*range + j*range + k] * cube[i*range*range + j*range + (k + 1)]<0)
							ou[i][j][k] = true;
					if (ou[i][j][k] == true)
						totalVertexOut++;
				}
				else
					ou[i][j][k] = false;
			}

	//-----------------------------------------------------------
	clock_t endt = clock();
	fout1 << "ply" << tmp << "format ascii 1.0" << tmp;
	fout1 << "element vertex " << totalVertexOut << tmp;
	fout1 << "property float x" << tmp;
	fout1 << "property float y" << tmp;
	fout1 << "property float z" << tmp;
	fout1 << "end_header" << tmp;

	for (i = 0; i<range - 1; i++)
		for (j = 0; j<range - 1; j++)
			for (k = 0; k<range - 1; k++)
				if (ou[i][j][k] == true)
				{
					fout1 << i - halfRange << ' ' << j - halfRange << ' ' << k - halfRange << tmp;
				}

	fout1.close();
	ofstream fout2("calculateTime");
	double time = (double)(endt - startt) / CLOCKS_PER_SEC;
	fout2 << "cubesize:" << range << '*' << range << '*' << range << '\n';
	fout2 << "time used (without initialize and output part):" << time << '\n';
	fout2.close();
	return 0;
}

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

                                        # End of file scope inline assembly
	.globl	_Z24__device_stub__calculatePfPiS_S_fffii # -- Begin function _Z24__device_stub__calculatePfPiS_S_fffii
	.type	_Z24__device_stub__calculatePfPiS_S_fffii,@function
_Z24__device_stub__calculatePfPiS_S_fffii: # @_Z24__device_stub__calculatePfPiS_S_fffii
	.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
	movq	%rcx, (%rdx)
	leaq	28(%rsp), %rcx
	movss	%xmm0, (%rcx)
	leaq	24(%rsp), %r10
	movss	%xmm1, (%r10)
	leaq	20(%rsp), %r11
	movss	%xmm2, (%r11)
	leaq	16(%rsp), %r14
	movl	%r8d, (%r14)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	112(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r10, 40(%rbx)
	movq	%r11, 48(%rbx)
	movq	%r14, 56(%rbx)
	movq	%r8, 64(%rbx)
	leaq	96(%rsp), %r14
	leaq	80(%rsp), %r15
	leaq	40(%rsp), %r12
	leaq	32(%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	$_Z9calculatePfPiS_S_fffii, %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	_Z24__device_stub__calculatePfPiS_S_fffii, .Lfunc_end0-_Z24__device_stub__calculatePfPiS_S_fffii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.LCPI1_0:
	.long	0x3f800000                      # float 1
	.text
	.globl	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
	.type	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi,@function
_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi: # @_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %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	$40624, %rsp                    # imm = 0x9EB0
	.cfi_def_cfa_offset 40672
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	$.L.str, %esi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
	leaq	104(%rsp), %r12
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode
.Ltmp0:
	leaq	60(%rsp), %rsi
	movq	%r12, %rdi
	callq	_ZNSi10_M_extractIfEERSiRT_
.Ltmp1:
# %bb.1:                                # %_ZNSirsERf.exit
.Ltmp2:
	leaq	104(%rsp), %rdi
	leaq	56(%rsp), %rsi
	callq	_ZNSi10_M_extractIfEERSiRT_
.Ltmp3:
# %bb.2:                                # %_ZNSirsERf.exit20
.Ltmp4:
	leaq	104(%rsp), %rdi
	leaq	52(%rsp), %rsi
	callq	_ZNSi10_M_extractIfEERSiRT_
.Ltmp5:
# %bb.3:                                # %_ZNSirsERf.exit21
.Ltmp6:
	leaq	104(%rsp), %rdi
	leaq	48(%rsp), %rsi
	callq	_ZNSi10_M_extractIfEERSiRT_
.Ltmp7:
# %bb.4:                                # %_ZNSirsERf.exit22
.Ltmp8:
	leaq	104(%rsp), %rdi
	leaq	44(%rsp), %rsi
	callq	_ZNSi10_M_extractIfEERSiRT_
.Ltmp9:
# %bb.5:                                # %_ZNSirsERf.exit23
.Ltmp10:
	leaq	104(%rsp), %rdi
	leaq	40(%rsp), %rsi
	callq	_ZNSi10_M_extractIfEERSiRT_
.Ltmp11:
# %bb.6:                                # %_ZNSirsERf.exit24
.Ltmp12:
	leaq	104(%rsp), %rdi
	leaq	36(%rsp), %rsi
	callq	_ZNSi10_M_extractIfEERSiRT_
.Ltmp13:
# %bb.7:                                # %_ZNSirsERf.exit25
.Ltmp14:
	leaq	104(%rsp), %rdi
	leaq	12(%rsp), %rsi
	callq	_ZNSirsERi
.Ltmp15:
# %bb.8:
.Ltmp16:
	leaq	104(%rsp), %rdi
	leaq	8(%rsp), %rsi
	callq	_ZNSirsERi
.Ltmp17:
# %bb.9:                                # %.preheader29
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.LBB1_17
# %bb.10:                               # %.preheader.preheader
	xorl	%r12d, %r12d
	movl	8(%rsp), %eax
	leaq	104(%rsp), %r15
.LBB1_11:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_13 Depth 2
	testl	%eax, %eax
	jle	.LBB1_16
# %bb.12:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB1_11 Depth=1
	xorl	%r13d, %r13d
.LBB1_13:                               # %.lr.ph
                                        #   Parent Loop BB1_11 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	imull	%r12d, %eax
	cltq
	addq	%r13, %rax
	leaq	(%rsp,%rax,4), %rsi
	addq	$624, %rsi                      # imm = 0x270
.Ltmp18:
	movq	%r15, %rdi
	callq	_ZNSi10_M_extractIfEERSiRT_
.Ltmp19:
# %bb.14:                               # %_ZNSirsERf.exit26
                                        #   in Loop: Header=BB1_13 Depth=2
	movl	8(%rsp), %eax
	incq	%r13
	cmpl	%eax, %r13d
	jl	.LBB1_13
# %bb.15:                               # %._crit_edge.loopexit
                                        #   in Loop: Header=BB1_11 Depth=1
	movl	12(%rsp), %ecx
.LBB1_16:                               # %._crit_edge
                                        #   in Loop: Header=BB1_11 Depth=1
	incl	%r12d
	cmpl	%ecx, %r12d
	jl	.LBB1_11
.LBB1_17:                               # %._crit_edge32
.Ltmp21:
	leaq	104(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
.Ltmp22:
# %bb.18:
	movss	44(%rsp), %xmm3                 # xmm3 = mem[0],zero,zero,zero
	movaps	%xmm3, %xmm1
	addss	%xmm3, %xmm1
	movaps	%xmm3, %xmm0
	mulss	%xmm1, %xmm0
	movss	.LCPI1_0(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
	movaps	%xmm2, %xmm7
	subss	%xmm0, %xmm7
	movss	40(%rsp), %xmm8                 # xmm8 = mem[0],zero,zero,zero
	movaps	%xmm8, %xmm4
	movaps	%xmm8, %xmm5
	movaps	%xmm1, %xmm6
	mulss	%xmm8, %xmm1
	addss	%xmm8, %xmm8
	mulss	%xmm8, %xmm4
	subss	%xmm4, %xmm7
	movss	%xmm7, 64(%rsp)
	movss	48(%rsp), %xmm7                 # xmm7 = mem[0],zero,zero,zero
	movaps	%xmm7, %xmm9
	addss	%xmm7, %xmm9
	mulss	%xmm9, %xmm3
	movss	36(%rsp), %xmm10                # xmm10 = mem[0],zero,zero,zero
	mulss	%xmm10, %xmm8
	movaps	%xmm3, %xmm11
	subss	%xmm8, %xmm11
	movss	%xmm11, 68(%rsp)
	mulss	%xmm9, %xmm5
	mulss	%xmm10, %xmm6
	movaps	%xmm5, %xmm11
	addss	%xmm6, %xmm11
	movss	%xmm11, 72(%rsp)
	addss	%xmm3, %xmm8
	movss	%xmm8, 76(%rsp)
	mulss	%xmm9, %xmm7
	subss	%xmm7, %xmm2
	movaps	%xmm2, %xmm3
	subss	%xmm4, %xmm3
	movss	%xmm3, 80(%rsp)
	mulss	%xmm10, %xmm9
	movaps	%xmm1, %xmm3
	subss	%xmm9, %xmm3
	movss	%xmm3, 84(%rsp)
	subss	%xmm6, %xmm5
	movss	%xmm5, 88(%rsp)
	addss	%xmm1, %xmm9
	movss	%xmm9, 92(%rsp)
	subss	%xmm0, %xmm2
	movss	%xmm2, 96(%rsp)
	movslq	12(%rsp), %rax
	movslq	8(%rsp), %rsi
	imulq	%rax, %rsi
	shlq	$2, %rsi
.Ltmp24:
	leaq	24(%rsp), %rdi
	callq	hipMalloc
.Ltmp25:
# %bb.19:
	movq	24(%rsp), %rdi
	movslq	12(%rsp), %rax
	movslq	8(%rsp), %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
.Ltmp26:
	leaq	624(%rsp), %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp27:
# %bb.20:
.Ltmp28:
	leaq	16(%rsp), %rdi
	movl	$36, %esi
	callq	hipMalloc
.Ltmp29:
# %bb.21:
	movq	16(%rsp), %rdi
.Ltmp30:
	leaq	64(%rsp), %rsi
	movl	$36, %edx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp31:
# %bb.22:
.Ltmp32:
	movabsq	$17179869188, %rdi              # imm = 0x400000004
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$2, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp33:
# %bb.23:
	testl	%eax, %eax
	jne	.LBB1_25
# %bb.24:
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rcx
	movss	60(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	movss	56(%rsp), %xmm1                 # xmm1 = mem[0],zero,zero,zero
	movss	52(%rsp), %xmm2                 # xmm2 = mem[0],zero,zero,zero
.Ltmp34:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	$128, %r8d
	movl	$64, %r9d
	callq	_Z24__device_stub__calculatePfPiS_S_fffii
.Ltmp35:
.LBB1_25:
.Ltmp36:
	callq	hipDeviceSynchronize
.Ltmp37:
# %bb.26:
	movq	24(%rsp), %rdi
.Ltmp38:
	callq	hipFree
.Ltmp39:
# %bb.27:
	movq	16(%rsp), %rdi
.Ltmp40:
	callq	hipFree
.Ltmp41:
# %bb.28:
	leaq	104(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	addq	$40624, %rsp                    # imm = 0x9EB0
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB1_32:
	.cfi_def_cfa_offset 40672
.Ltmp42:
	jmp	.LBB1_30
.LBB1_31:                               # %.loopexit.split-lp
.Ltmp23:
	jmp	.LBB1_30
.LBB1_29:                               # %.loopexit
.Ltmp20:
.LBB1_30:
	movq	%rax, %rbx
	leaq	104(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi, .Lfunc_end1-_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table1:
.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 .Ltmp17-.Ltmp0                 #   Call between .Ltmp0 and .Ltmp17
	.uleb128 .Ltmp23-.Lfunc_begin0          #     jumps to .Ltmp23
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp18-.Lfunc_begin0          # >> Call Site 3 <<
	.uleb128 .Ltmp19-.Ltmp18                #   Call between .Ltmp18 and .Ltmp19
	.uleb128 .Ltmp20-.Lfunc_begin0          #     jumps to .Ltmp20
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp21-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp22-.Ltmp21                #   Call between .Ltmp21 and .Ltmp22
	.uleb128 .Ltmp23-.Lfunc_begin0          #     jumps to .Ltmp23
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp24-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp41-.Ltmp24                #   Call between .Ltmp24 and .Ltmp41
	.uleb128 .Ltmp42-.Lfunc_begin0          #     jumps to .Ltmp42
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp41-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Lfunc_end1-.Ltmp41            #   Call between .Ltmp41 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI2_0:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %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	$1400, %rsp                     # imm = 0x578
	.cfi_def_cfa_offset 1456
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	callq	clock
	movq	%rax, %rbx
	leaq	24(%rsp), %rdi
	movl	$8388608, %esi                  # imm = 0x800000
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB2_2
# %bb.1:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB2_2:
	movq	24(%rsp), %rdi
	movl	$8388608, %edx                  # imm = 0x800000
	xorl	%esi, %esi
	callq	hipMemset
	testl	%eax, %eax
	je	.LBB2_4
# %bb.3:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB2_4:
	leaq	16(%rsp), %rdi
	movl	$8388608, %esi                  # imm = 0x800000
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB2_6
# %bb.5:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB2_6:
	movq	16(%rsp), %rdi
	movl	$8388608, %edx                  # imm = 0x800000
	xorl	%esi, %esi
	callq	hipMemset
	testl	%eax, %eax
	je	.LBB2_8
# %bb.7:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB2_8:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	leaq	360(%rsp), %r15
	movq	%r15, -16(%r15)
	leaq	344(%rsp), %r14
	movl	$.L.str.5, %esi
	movl	$.L.str.5+6, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
.Ltmp43:
	movq	%r14, %rdi
	callq	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.Ltmp44:
# %bb.9:
	movq	344(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_11
# %bb.10:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB2_11:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	leaq	328(%rsp), %r15
	movq	%r15, -16(%r15)
	leaq	312(%rsp), %r14
	movl	$.L.str.6, %esi
	movl	$.L.str.6+6, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
.Ltmp46:
	movq	%r14, %rdi
	callq	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.Ltmp47:
# %bb.12:
	movq	312(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_14
# %bb.13:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i134
	callq	_ZdlPv
.LBB2_14:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit136
	leaq	296(%rsp), %r15
	movq	%r15, -16(%r15)
	leaq	280(%rsp), %r14
	movl	$.L.str.7, %esi
	movl	$.L.str.7+6, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
.Ltmp49:
	movq	%r14, %rdi
	callq	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.Ltmp50:
# %bb.15:
	movq	280(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_17
# %bb.16:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i138
	callq	_ZdlPv
.LBB2_17:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit140
	leaq	264(%rsp), %r15
	movq	%r15, -16(%r15)
	leaq	248(%rsp), %r14
	movl	$.L.str.8, %esi
	movl	$.L.str.8+6, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
.Ltmp52:
	movq	%r14, %rdi
	callq	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.Ltmp53:
# %bb.18:
	movq	248(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_20
# %bb.19:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i142
	callq	_ZdlPv
.LBB2_20:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit144
	leaq	232(%rsp), %r15
	movq	%r15, -16(%r15)
	leaq	216(%rsp), %r14
	movl	$.L.str.9, %esi
	movl	$.L.str.9+6, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
.Ltmp55:
	movq	%r14, %rdi
	callq	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.Ltmp56:
# %bb.21:
	movq	216(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_23
# %bb.22:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i146
	callq	_ZdlPv
.LBB2_23:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit148
	leaq	200(%rsp), %r15
	movq	%r15, -16(%r15)
	leaq	184(%rsp), %r14
	movl	$.L.str.10, %esi
	movl	$.L.str.10+8, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
.Ltmp58:
	movq	%r14, %rdi
	callq	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.Ltmp59:
# %bb.24:
	movq	184(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_26
# %bb.25:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i150
	callq	_ZdlPv
.LBB2_26:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit152
	leaq	168(%rsp), %r15
	movq	%r15, -16(%r15)
	leaq	152(%rsp), %r14
	movl	$.L.str.11, %esi
	movl	$.L.str.11+4, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
.Ltmp61:
	movq	%r14, %rdi
	callq	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.Ltmp62:
# %bb.27:
	movq	152(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_29
# %bb.28:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i154
	callq	_ZdlPv
.LBB2_29:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit156
	leaq	136(%rsp), %r15
	movq	%r15, -16(%r15)
	leaq	120(%rsp), %r14
	movl	$.L.str.12, %esi
	movl	$.L.str.12+4, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
.Ltmp64:
	movq	%r14, %rdi
	callq	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.Ltmp65:
# %bb.30:
	movq	120(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_32
# %bb.31:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i158
	callq	_ZdlPv
.LBB2_32:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit160
	leaq	104(%rsp), %r15
	movq	%r15, -16(%r15)
	leaq	88(%rsp), %r14
	movl	$.L.str.13, %esi
	movl	$.L.str.13+6, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
.Ltmp67:
	movq	%r14, %rdi
	callq	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.Ltmp68:
# %bb.33:
	movq	88(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_35
# %bb.34:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i162
	callq	_ZdlPv
.LBB2_35:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit164
	leaq	72(%rsp), %r15
	movq	%r15, -16(%r15)
	leaq	56(%rsp), %r14
	movl	$.L.str.14, %esi
	movl	$.L.str.14+4, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
.Ltmp70:
	movq	%r14, %rdi
	callq	_Z3proNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPfPi
.Ltmp71:
# %bb.36:
	movq	56(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_38
# %bb.37:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i166
	callq	_ZdlPv
.LBB2_38:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit168
	movq	24(%rsp), %rsi
	movl	$cube, %edi
	movl	$8388608, %edx                  # imm = 0x800000
	movl	$2, %ecx
	callq	hipMemcpy
	movq	16(%rsp), %rsi
	movl	$weight, %edi
	movl	$8388608, %edx                  # imm = 0x800000
	movl	$2, %ecx
	callq	hipMemcpy
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	leaq	376(%rsp), %rdi
	movl	$.L.str.15, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
	xorl	%eax, %eax
	movl	$ou, %ecx
	xorps	%xmm0, %xmm0
	xorl	%edx, %edx
	xorl	%ebp, %ebp
.LBB2_39:                               # %.preheader293
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_40 Depth 2
                                        #       Child Loop BB2_41 Depth 3
	movq	%rax, %rsi
	movq	%rcx, %rdi
	xorl	%r8d, %r8d
.LBB2_40:                               # %.preheader292
                                        #   Parent Loop BB2_39 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_41 Depth 3
	xorl	%r9d, %r9d
.LBB2_41:                               #   Parent Loop BB2_39 Depth=1
                                        #     Parent Loop BB2_40 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movb	$0, (%rdi,%r9)
	cmpl	$0, weight(%rsi,%r9,4)
	jle	.LBB2_53
# %bb.42:                               #   in Loop: Header=BB2_41 Depth=3
	cmpl	$0, weight+65536(%rsi,%r9,4)
	jle	.LBB2_45
# %bb.43:                               #   in Loop: Header=BB2_41 Depth=3
	movss	cube(%rsi,%r9,4), %xmm1         # xmm1 = mem[0],zero,zero,zero
	mulss	cube+65536(%rsi,%r9,4), %xmm1
	ucomiss	%xmm1, %xmm0
	jbe	.LBB2_45
# %bb.44:                               #   in Loop: Header=BB2_41 Depth=3
	movb	$1, (%rdi,%r9)
	movb	$1, %r10b
	jmp	.LBB2_46
.LBB2_45:                               #   in Loop: Header=BB2_41 Depth=3
	xorl	%r10d, %r10d
.LBB2_46:                               #   in Loop: Header=BB2_41 Depth=3
	cmpl	$0, weight+512(%rsi,%r9,4)
	jle	.LBB2_49
# %bb.47:                               #   in Loop: Header=BB2_41 Depth=3
	movss	cube(%rsi,%r9,4), %xmm1         # xmm1 = mem[0],zero,zero,zero
	mulss	cube+512(%rsi,%r9,4), %xmm1
	ucomiss	%xmm1, %xmm0
	jbe	.LBB2_49
# %bb.48:                               #   in Loop: Header=BB2_41 Depth=3
	movb	$1, (%rdi,%r9)
	movb	$1, %r10b
.LBB2_49:                               #   in Loop: Header=BB2_41 Depth=3
	cmpl	$0, weight+4(%rsi,%r9,4)
	jle	.LBB2_52
# %bb.50:                               #   in Loop: Header=BB2_41 Depth=3
	movss	cube(%rsi,%r9,4), %xmm1         # xmm1 = mem[0],zero,zero,zero
	mulss	cube+4(%rsi,%r9,4), %xmm1
	ucomiss	%xmm1, %xmm0
	jbe	.LBB2_52
# %bb.51:                               #   in Loop: Header=BB2_41 Depth=3
	movb	$1, (%rdi,%r9)
	movb	$1, %r10b
.LBB2_52:                               #   in Loop: Header=BB2_41 Depth=3
	movzbl	%r10b, %r10d
	addl	%r10d, %ebp
.LBB2_53:                               #   in Loop: Header=BB2_41 Depth=3
	incq	%r9
	cmpq	$127, %r9
	jne	.LBB2_41
# %bb.54:                               #   in Loop: Header=BB2_40 Depth=2
	incq	%r8
	subq	$-128, %rdi
	addq	$512, %rsi                      # imm = 0x200
	cmpq	$127, %r8
	jne	.LBB2_40
# %bb.55:                               #   in Loop: Header=BB2_39 Depth=1
	incq	%rdx
	addq	$16384, %rcx                    # imm = 0x4000
	addq	$65536, %rax                    # imm = 0x10000
	cmpq	$127, %rdx
	jne	.LBB2_39
# %bb.56:
	callq	clock
	movq	%rax, %r14
.Ltmp73:
	leaq	376(%rsp), %r15
	movl	$.L.str.16, %esi
	movl	$3, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp74:
# %bb.57:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movb	$10, 888(%rsp)
	movq	376(%rsp), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 392(%rsp,%rax)
	je	.LBB2_60
# %bb.58:
.Ltmp75:
	leaq	376(%rsp), %rdi
	leaq	888(%rsp), %rsi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp76:
# %bb.59:
	movq	%rax, %r15
	jmp	.LBB2_61
.LBB2_60:
.Ltmp77:
	movq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp78:
.LBB2_61:
.Ltmp79:
	movl	$.L.str.17, %esi
	movl	$16, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp80:
# %bb.62:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit201
	movb	$10, 888(%rsp)
	movq	(%r15), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 16(%r15,%rax)
	je	.LBB2_64
# %bb.63:
.Ltmp81:
	leaq	888(%rsp), %rsi
	movl	$1, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp82:
	jmp	.LBB2_65
.LBB2_64:
.Ltmp83:
	movq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp84:
.LBB2_65:
.Ltmp85:
	leaq	376(%rsp), %rdi
	movl	$.L.str.18, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp86:
# %bb.66:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit208
.Ltmp87:
	leaq	376(%rsp), %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp88:
# %bb.67:
	movb	$10, 888(%rsp)
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%rax,%rcx)
	je	.LBB2_69
# %bb.68:
.Ltmp89:
	leaq	888(%rsp), %rsi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp90:
	jmp	.LBB2_70
.LBB2_69:
.Ltmp91:
	movq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp92:
.LBB2_70:
.Ltmp93:
	leaq	376(%rsp), %rdi
	movl	$.L.str.19, %esi
	movl	$16, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp94:
# %bb.71:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit215
	movb	$10, 888(%rsp)
	movq	376(%rsp), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 392(%rsp,%rax)
	je	.LBB2_73
# %bb.72:
.Ltmp95:
	leaq	376(%rsp), %rdi
	leaq	888(%rsp), %rsi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp96:
	jmp	.LBB2_74
.LBB2_73:
.Ltmp97:
	leaq	376(%rsp), %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp98:
.LBB2_74:
.Ltmp99:
	leaq	376(%rsp), %rdi
	movl	$.L.str.20, %esi
	movl	$16, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp100:
# %bb.75:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit222
	movb	$10, 888(%rsp)
	movq	376(%rsp), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 392(%rsp,%rax)
	je	.LBB2_77
# %bb.76:
.Ltmp101:
	leaq	376(%rsp), %rdi
	leaq	888(%rsp), %rsi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp102:
	jmp	.LBB2_78
.LBB2_77:
.Ltmp103:
	leaq	376(%rsp), %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp104:
.LBB2_78:
.Ltmp105:
	leaq	376(%rsp), %rdi
	movl	$.L.str.21, %esi
	movl	$16, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp106:
# %bb.79:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit229
	movb	$10, 888(%rsp)
	movq	376(%rsp), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 392(%rsp,%rax)
	je	.LBB2_81
# %bb.80:
.Ltmp107:
	leaq	376(%rsp), %rdi
	leaq	888(%rsp), %rsi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp108:
	jmp	.LBB2_82
.LBB2_81:
.Ltmp109:
	leaq	376(%rsp), %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp110:
.LBB2_82:
.Ltmp111:
	leaq	376(%rsp), %rdi
	movl	$.L.str.22, %esi
	movl	$10, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp112:
# %bb.83:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit236
	movb	$10, 888(%rsp)
	movq	376(%rsp), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 392(%rsp,%rax)
	je	.LBB2_85
# %bb.84:
.Ltmp113:
	leaq	376(%rsp), %rdi
	leaq	888(%rsp), %rsi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp114:
	jmp	.LBB2_86
.LBB2_85:
.Ltmp115:
	leaq	376(%rsp), %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp116:
.LBB2_86:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c.exit241
	movq	%r14, 32(%rsp)                  # 8-byte Spill
	movq	%rbx, 40(%rsp)                  # 8-byte Spill
	movl	$ou, %ebp
	xorl	%ebx, %ebx
	leaq	888(%rsp), %r12
.LBB2_87:                               # %.preheader291
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_88 Depth 2
                                        #       Child Loop BB2_89 Depth 3
	movq	%rbp, 48(%rsp)                  # 8-byte Spill
	xorl	%r14d, %r14d
.LBB2_88:                               # %.preheader
                                        #   Parent Loop BB2_87 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_89 Depth 3
	xorl	%r15d, %r15d
.LBB2_89:                               #   Parent Loop BB2_87 Depth=1
                                        #     Parent Loop BB2_88 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpb	$0, (%rbp,%r15)
	je	.LBB2_104
# %bb.90:                               #   in Loop: Header=BB2_89 Depth=3
	movl	%ebx, %esi
	subl	halfRange(%rip), %esi
.Ltmp117:
	leaq	376(%rsp), %rdi
	callq	_ZNSolsEi
.Ltmp118:
# %bb.91:                               #   in Loop: Header=BB2_89 Depth=3
	movq	%rax, %r13
	movb	$32, 888(%rsp)
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 16(%r13,%rax)
	je	.LBB2_94
# %bb.92:                               #   in Loop: Header=BB2_89 Depth=3
.Ltmp119:
	movl	$1, %edx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp120:
# %bb.93:                               #   in Loop: Header=BB2_89 Depth=3
	movq	%rax, %r13
	jmp	.LBB2_95
.LBB2_94:                               #   in Loop: Header=BB2_89 Depth=3
.Ltmp121:
	movq	%r13, %rdi
	movl	$32, %esi
	callq	_ZNSo3putEc
.Ltmp122:
.LBB2_95:                               #   in Loop: Header=BB2_89 Depth=3
	movl	%r14d, %esi
	subl	halfRange(%rip), %esi
.Ltmp123:
	movq	%r13, %rdi
	callq	_ZNSolsEi
.Ltmp124:
# %bb.96:                               #   in Loop: Header=BB2_89 Depth=3
	movq	%rax, %r13
	movb	$32, 888(%rsp)
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 16(%r13,%rax)
	je	.LBB2_99
# %bb.97:                               #   in Loop: Header=BB2_89 Depth=3
.Ltmp125:
	movl	$1, %edx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp126:
# %bb.98:                               #   in Loop: Header=BB2_89 Depth=3
	movq	%rax, %r13
	jmp	.LBB2_100
.LBB2_99:                               #   in Loop: Header=BB2_89 Depth=3
.Ltmp127:
	movq	%r13, %rdi
	movl	$32, %esi
	callq	_ZNSo3putEc
.Ltmp128:
.LBB2_100:                              #   in Loop: Header=BB2_89 Depth=3
	movl	halfRange(%rip), %eax
	movl	%r15d, %esi
	subl	%eax, %esi
.Ltmp129:
	movq	%r13, %rdi
	callq	_ZNSolsEi
.Ltmp130:
# %bb.101:                              #   in Loop: Header=BB2_89 Depth=3
	movb	$10, 888(%rsp)
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%rax,%rcx)
	je	.LBB2_103
# %bb.102:                              #   in Loop: Header=BB2_89 Depth=3
.Ltmp131:
	movl	$1, %edx
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp132:
	jmp	.LBB2_104
.LBB2_103:                              #   in Loop: Header=BB2_89 Depth=3
.Ltmp133:
	movq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp134:
.LBB2_104:                              #   in Loop: Header=BB2_89 Depth=3
	incq	%r15
	cmpq	$127, %r15
	jne	.LBB2_89
# %bb.105:                              #   in Loop: Header=BB2_88 Depth=2
	incq	%r14
	subq	$-128, %rbp
	cmpq	$127, %r14
	jne	.LBB2_88
# %bb.106:                              #   in Loop: Header=BB2_87 Depth=1
	incq	%rbx
	movq	48(%rsp), %rbp                  # 8-byte Reload
	addq	$16384, %rbp                    # imm = 0x4000
	cmpq	$127, %rbx
	jne	.LBB2_87
# %bb.107:
.Ltmp136:
	leaq	376(%rsp), %r15
	movq	%r15, %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
.Ltmp137:
	movq	40(%rsp), %rbx                  # 8-byte Reload
	movq	32(%rsp), %r14                  # 8-byte Reload
# %bb.108:
.Ltmp139:
	leaq	888(%rsp), %rdi
	movl	$.L.str.23, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp140:
# %bb.109:
.Ltmp142:
	leaq	888(%rsp), %rdi
	movl	$.L.str.24, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp143:
# %bb.110:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit258
.Ltmp144:
	leaq	888(%rsp), %rdi
	movl	$128, %esi
	callq	_ZNSolsEi
.Ltmp145:
# %bb.111:
	movq	%rax, %r12
	movb	$42, 15(%rsp)
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 16(%r12,%rax)
	je	.LBB2_114
# %bb.112:
.Ltmp146:
	leaq	15(%rsp), %rsi
	movl	$1, %edx
	movq	%r12, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp147:
# %bb.113:
	movq	%rax, %r12
	jmp	.LBB2_115
.LBB2_114:
.Ltmp148:
	movq	%r12, %rdi
	movl	$42, %esi
	callq	_ZNSo3putEc
.Ltmp149:
.LBB2_115:
.Ltmp150:
	movq	%r12, %rdi
	movl	$128, %esi
	callq	_ZNSolsEi
.Ltmp151:
# %bb.116:
	movq	%rax, %r12
	movb	$42, 15(%rsp)
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 16(%r12,%rax)
	je	.LBB2_119
# %bb.117:
.Ltmp152:
	leaq	15(%rsp), %rsi
	movl	$1, %edx
	movq	%r12, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp153:
# %bb.118:
	movq	%rax, %r12
	jmp	.LBB2_120
.LBB2_119:
.Ltmp154:
	movq	%r12, %rdi
	movl	$42, %esi
	callq	_ZNSo3putEc
.Ltmp155:
.LBB2_120:
.Ltmp156:
	movq	%r12, %rdi
	movl	$128, %esi
	callq	_ZNSolsEi
.Ltmp157:
# %bb.121:
	movb	$10, 15(%rsp)
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%rax,%rcx)
	je	.LBB2_123
# %bb.122:
.Ltmp158:
	leaq	15(%rsp), %rsi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp159:
	jmp	.LBB2_124
.LBB2_123:
.Ltmp160:
	movq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp161:
.LBB2_124:
.Ltmp162:
	leaq	888(%rsp), %rdi
	movl	$.L.str.25, %esi
	movl	$47, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp163:
# %bb.125:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit275
.Ltmp164:
	subq	%rbx, %r14
	cvtsi2sd	%r14, %xmm0
	divsd	.LCPI2_0(%rip), %xmm0
	leaq	888(%rsp), %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp165:
# %bb.126:                              # %_ZNSolsEd.exit
	movb	$10, 15(%rsp)
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%rax,%rcx)
	je	.LBB2_128
# %bb.127:
.Ltmp166:
	leaq	15(%rsp), %rsi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp167:
	jmp	.LBB2_129
.LBB2_128:
.Ltmp168:
	movq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp169:
.LBB2_129:
.Ltmp170:
	leaq	888(%rsp), %rbx
	movq	%rbx, %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
.Ltmp171:
# %bb.130:
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %r14
	leaq	896(%rsp), %rdi
	movq	%r14, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %r12
	movq	-24(%r14), %rax
	movq	%r12, 888(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	movl	$248, %r13d
	addq	%r13, %rbx
	movq	%rbx, %rdi
	callq	_ZNSt8ios_baseD2Ev
	leaq	384(%rsp), %rdi
	movq	%r14, -8(%rdi)
	movq	-24(%r14), %rax
	movq	%r12, 376(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	addq	%r13, %r15
	movq	%r15, %rdi
	callq	_ZNSt8ios_baseD2Ev
	xorl	%eax, %eax
	addq	$1400, %rsp                     # imm = 0x578
	.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_131:
	.cfi_def_cfa_offset 1456
.Ltmp141:
	jmp	.LBB2_147
.LBB2_132:
.Ltmp72:
	movq	%rax, %rbx
	movq	56(%rsp), %rdi
	jmp	.LBB2_142
.LBB2_133:
.Ltmp69:
	movq	%rax, %rbx
	movq	88(%rsp), %rdi
	jmp	.LBB2_142
.LBB2_134:
.Ltmp66:
	movq	%rax, %rbx
	movq	120(%rsp), %rdi
	jmp	.LBB2_142
.LBB2_135:
.Ltmp63:
	movq	%rax, %rbx
	movq	152(%rsp), %rdi
	jmp	.LBB2_142
.LBB2_136:
.Ltmp60:
	movq	%rax, %rbx
	movq	184(%rsp), %rdi
	jmp	.LBB2_142
.LBB2_137:
.Ltmp57:
	movq	%rax, %rbx
	movq	216(%rsp), %rdi
	jmp	.LBB2_142
.LBB2_138:
.Ltmp54:
	movq	%rax, %rbx
	movq	248(%rsp), %rdi
	jmp	.LBB2_142
.LBB2_139:
.Ltmp51:
	movq	%rax, %rbx
	movq	280(%rsp), %rdi
	jmp	.LBB2_142
.LBB2_140:
.Ltmp48:
	movq	%rax, %rbx
	movq	312(%rsp), %rdi
	jmp	.LBB2_142
.LBB2_141:
.Ltmp45:
	movq	%rax, %rbx
	movq	344(%rsp), %rdi
.LBB2_142:
	cmpq	%r15, %rdi
	je	.LBB2_149
# %bb.143:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i169
	callq	_ZdlPv
	jmp	.LBB2_149
.LBB2_144:
.Ltmp172:
	movq	%rax, %rbx
	leaq	888(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
	jmp	.LBB2_148
.LBB2_145:                              # %.loopexit.split-lp
.Ltmp138:
	jmp	.LBB2_147
.LBB2_146:                              # %.loopexit
.Ltmp135:
.LBB2_147:
	movq	%rax, %rbx
.LBB2_148:
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	leaq	384(%rsp), %rdi
	movq	%rax, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	-24(%rax), %rax
	movq	%rcx, 376(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	624(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
.LBB2_149:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit171
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp43-.Lfunc_begin1          #   Call between .Lfunc_begin1 and .Ltmp43
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp43-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp44-.Ltmp43                #   Call between .Ltmp43 and .Ltmp44
	.uleb128 .Ltmp45-.Lfunc_begin1          #     jumps to .Ltmp45
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp44-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp46-.Ltmp44                #   Call between .Ltmp44 and .Ltmp46
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp46-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp47-.Ltmp46                #   Call between .Ltmp46 and .Ltmp47
	.uleb128 .Ltmp48-.Lfunc_begin1          #     jumps to .Ltmp48
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp47-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp49-.Ltmp47                #   Call between .Ltmp47 and .Ltmp49
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp49-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Ltmp50-.Ltmp49                #   Call between .Ltmp49 and .Ltmp50
	.uleb128 .Ltmp51-.Lfunc_begin1          #     jumps to .Ltmp51
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp50-.Lfunc_begin1          # >> Call Site 7 <<
	.uleb128 .Ltmp52-.Ltmp50                #   Call between .Ltmp50 and .Ltmp52
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp52-.Lfunc_begin1          # >> Call Site 8 <<
	.uleb128 .Ltmp53-.Ltmp52                #   Call between .Ltmp52 and .Ltmp53
	.uleb128 .Ltmp54-.Lfunc_begin1          #     jumps to .Ltmp54
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp53-.Lfunc_begin1          # >> Call Site 9 <<
	.uleb128 .Ltmp55-.Ltmp53                #   Call between .Ltmp53 and .Ltmp55
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp55-.Lfunc_begin1          # >> Call Site 10 <<
	.uleb128 .Ltmp56-.Ltmp55                #   Call between .Ltmp55 and .Ltmp56
	.uleb128 .Ltmp57-.Lfunc_begin1          #     jumps to .Ltmp57
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp56-.Lfunc_begin1          # >> Call Site 11 <<
	.uleb128 .Ltmp58-.Ltmp56                #   Call between .Ltmp56 and .Ltmp58
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp58-.Lfunc_begin1          # >> Call Site 12 <<
	.uleb128 .Ltmp59-.Ltmp58                #   Call between .Ltmp58 and .Ltmp59
	.uleb128 .Ltmp60-.Lfunc_begin1          #     jumps to .Ltmp60
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp59-.Lfunc_begin1          # >> Call Site 13 <<
	.uleb128 .Ltmp61-.Ltmp59                #   Call between .Ltmp59 and .Ltmp61
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp61-.Lfunc_begin1          # >> Call Site 14 <<
	.uleb128 .Ltmp62-.Ltmp61                #   Call between .Ltmp61 and .Ltmp62
	.uleb128 .Ltmp63-.Lfunc_begin1          #     jumps to .Ltmp63
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp62-.Lfunc_begin1          # >> Call Site 15 <<
	.uleb128 .Ltmp64-.Ltmp62                #   Call between .Ltmp62 and .Ltmp64
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp64-.Lfunc_begin1          # >> Call Site 16 <<
	.uleb128 .Ltmp65-.Ltmp64                #   Call between .Ltmp64 and .Ltmp65
	.uleb128 .Ltmp66-.Lfunc_begin1          #     jumps to .Ltmp66
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp65-.Lfunc_begin1          # >> Call Site 17 <<
	.uleb128 .Ltmp67-.Ltmp65                #   Call between .Ltmp65 and .Ltmp67
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp67-.Lfunc_begin1          # >> Call Site 18 <<
	.uleb128 .Ltmp68-.Ltmp67                #   Call between .Ltmp67 and .Ltmp68
	.uleb128 .Ltmp69-.Lfunc_begin1          #     jumps to .Ltmp69
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp68-.Lfunc_begin1          # >> Call Site 19 <<
	.uleb128 .Ltmp70-.Ltmp68                #   Call between .Ltmp68 and .Ltmp70
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp70-.Lfunc_begin1          # >> Call Site 20 <<
	.uleb128 .Ltmp71-.Ltmp70                #   Call between .Ltmp70 and .Ltmp71
	.uleb128 .Ltmp72-.Lfunc_begin1          #     jumps to .Ltmp72
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp71-.Lfunc_begin1          # >> Call Site 21 <<
	.uleb128 .Ltmp73-.Ltmp71                #   Call between .Ltmp71 and .Ltmp73
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp73-.Lfunc_begin1          # >> Call Site 22 <<
	.uleb128 .Ltmp116-.Ltmp73               #   Call between .Ltmp73 and .Ltmp116
	.uleb128 .Ltmp138-.Lfunc_begin1         #     jumps to .Ltmp138
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp117-.Lfunc_begin1         # >> Call Site 23 <<
	.uleb128 .Ltmp134-.Ltmp117              #   Call between .Ltmp117 and .Ltmp134
	.uleb128 .Ltmp135-.Lfunc_begin1         #     jumps to .Ltmp135
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp136-.Lfunc_begin1         # >> Call Site 24 <<
	.uleb128 .Ltmp137-.Ltmp136              #   Call between .Ltmp136 and .Ltmp137
	.uleb128 .Ltmp138-.Lfunc_begin1         #     jumps to .Ltmp138
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp139-.Lfunc_begin1         # >> Call Site 25 <<
	.uleb128 .Ltmp140-.Ltmp139              #   Call between .Ltmp139 and .Ltmp140
	.uleb128 .Ltmp141-.Lfunc_begin1         #     jumps to .Ltmp141
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp142-.Lfunc_begin1         # >> Call Site 26 <<
	.uleb128 .Ltmp171-.Ltmp142              #   Call between .Ltmp142 and .Ltmp171
	.uleb128 .Ltmp172-.Lfunc_begin1         #     jumps to .Ltmp172
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp171-.Lfunc_begin1         # >> Call Site 27 <<
	.uleb128 .Lfunc_end2-.Ltmp171           #   Call between .Ltmp171 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB3_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB3_3
.LBB3_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB3_3:
	testq	%r14, %r14
	je	.LBB3_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB3_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB3_7
.LBB3_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB3_7:                                # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end3-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9calculatePfPiS_S_fffii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end4:
	.size	__hip_module_ctor, .Lfunc_end4-__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	.LBB5_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
.LBB5_2:
	retq
.Lfunc_end5:
	.size	__hip_module_dtor, .Lfunc_end5-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	halfRange,@object               # @halfRange
	.data
	.globl	halfRange
	.p2align	2, 0x0
halfRange:
	.long	64                              # 0x40
	.size	halfRange, 4

	.type	cube,@object                    # @cube
	.bss
	.globl	cube
	.p2align	4, 0x0
cube:
	.zero	8388608
	.size	cube, 8388608

	.type	weight,@object                  # @weight
	.globl	weight
	.p2align	4, 0x0
weight:
	.zero	8388608
	.size	weight, 8388608

	.type	ou,@object                      # @ou
	.globl	ou
	.p2align	4, 0x0
ou:
	.zero	2097152
	.size	ou, 2097152

	.type	_Z9calculatePfPiS_S_fffii,@object # @_Z9calculatePfPiS_S_fffii
	.section	.rodata,"a",@progbits
	.globl	_Z9calculatePfPiS_S_fffii
	.p2align	3, 0x0
_Z9calculatePfPiS_S_fffii:
	.quad	_Z24__device_stub__calculatePfPiS_S_fffii
	.size	_Z9calculatePfPiS_S_fffii, 8

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

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

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

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

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

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

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

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

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

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

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

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"top2"
	.size	.L.str.11, 5

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"top3"
	.size	.L.str.12, 5

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

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"chin"
	.size	.L.str.14, 5

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"bunoutparallel.ply"
	.size	.L.str.15, 19

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

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"format ascii 1.0"
	.size	.L.str.17, 17

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"element vertex "
	.size	.L.str.18, 16

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"property float x"
	.size	.L.str.19, 17

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"property float y"
	.size	.L.str.20, 17

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"property float z"
	.size	.L.str.21, 17

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"end_header"
	.size	.L.str.22, 11

	.type	.L.str.23,@object               # @.str.23
.L.str.23:
	.asciz	"calculateTime"
	.size	.L.str.23, 14

	.type	.L.str.24,@object               # @.str.24
.L.str.24:
	.asciz	"cubesize:"
	.size	.L.str.24, 10

	.type	.L.str.25,@object               # @.str.25
.L.str.25:
	.asciz	"time used (without initialize and output part):"
	.size	.L.str.25, 48

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z9calculatePfPiS_S_fffii"
	.size	.L__unnamed_1, 26

	.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 _Z24__device_stub__calculatePfPiS_S_fffii
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym cube
	.addrsig_sym weight
	.addrsig_sym _Z9calculatePfPiS_S_fffii
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z9calculatePfPiS_S_fffii ; -- Begin function _Z9calculatePfPiS_S_fffii
	.globl	_Z9calculatePfPiS_S_fffii
	.p2align	8
	.type	_Z9calculatePfPiS_S_fffii,@function
_Z9calculatePfPiS_S_fffii:              ; @_Z9calculatePfPiS_S_fffii
; %bb.0:
	s_load_b32 s2, s[0:1], 0x44
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v2, 0x3ff, v0
	s_add_u32 s16, s0, 56
	s_addc_u32 s17, s1, 0
	s_load_b256 s[4:11], s[0:1], 0x0
	s_mov_b32 s12, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s3, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u32_u24 v7, v1, s3, v2
	v_lshlrev_b32_e32 v3, 6, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v4, 64, v3
	v_cmp_gt_i32_e32 vcc_lo, 0x260a, v3
	v_cndmask_b32_e32 v6, 0x2649, v4, vcc_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_lt_i32_e64 v3, v6
	s_cbranch_execz .LBB0_3
; %bb.1:                                ; %.lr.ph.preheader
	v_ashrrev_i32_e32 v4, 31, v3
	v_lshlrev_b32_e32 v7, 8, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[4:5], 2, v[3:4]
	v_add_co_u32 v4, vcc_lo, s8, v4
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v5, vcc_lo, s9, v5, vcc_lo
	s_mov_b32 s8, 0
.LBB0_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b32 v8, v[4:5], off
	v_add_nc_u32_e32 v3, 1, v3
	v_add_co_u32 v4, vcc_lo, v4, 4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_i32_e64 s2, v3, v6
	s_or_b32 s8, s2, s8
	s_waitcnt vmcnt(0)
	ds_store_b32 v7, v8
	v_add_nc_u32_e32 v7, 4, v7
	s_and_not1_b32 exec_lo, exec_lo, s8
	s_cbranch_execnz .LBB0_2
.LBB0_3:                                ; %Flow156
	s_or_b32 exec_lo, exec_lo, s12
	v_bfe_u32 v0, v0, 20, 10
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_or3_b32 v0, v2, v1, v0
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB0_6
; %bb.4:                                ; %.preheader.preheader
	s_movk_i32 s8, 0xffdc
.LBB0_5:                                ; %.preheader
                                        ; =>This Inner Loop Header: Depth=1
	s_load_b32 s9, s[10:11], 0x0
	v_mov_b32_e32 v0, s8
	s_add_i32 s8, s8, 4
	s_add_u32 s10, s10, 4
	s_addc_u32 s11, s11, 0
	s_cmp_lg_u32 s8, 0
	s_waitcnt lgkmcnt(0)
	v_mov_b32_e32 v3, s9
	ds_store_b32 v0, v3 offset:40036
	s_cbranch_scc1 .LBB0_5
.LBB0_6:                                ; %Flow154
	s_or_b32 exec_lo, exec_lo, s2
	s_load_b32 s20, s[0:1], 0x30
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cmp_lt_i32 s20, 1
	s_cbranch_scc1 .LBB0_16
; %bb.7:                                ; %.lr.ph105
	v_mad_u64_u32 v[7:8], null, s13, s3, v[2:3]
	s_load_b32 s2, s[16:17], 0xc
	s_load_b128 s[8:11], s[0:1], 0x20
	s_mov_b32 s12, 0x9999999a
	s_mov_b32 s13, 0xbfb99999
	s_mov_b32 s16, 0x47ae147b
	s_mov_b32 s17, 0xbf847ae1
	s_mul_i32 s21, s15, s20
	v_cvt_f64_i32_e32 v[5:6], v7
	s_mov_b32 s22, 0
	s_mov_b32 s15, 0x3f50624d
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s0, s2, 16
	s_mov_b32 s2, 0x9999999a
	v_mad_u64_u32 v[2:3], null, s14, s0, v[1:2]
	s_mov_b32 s3, 0x3fc99999
	v_cvt_f64_i32_e32 v[3:4], s11
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cvt_f64_i32_e32 v[0:1], v2
	v_mul_f64 v[5:6], v[5:6], s[2:3]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[0:1], v[0:1], s[2:3]
	v_div_scale_f64 v[8:9], null, v[3:4], v[3:4], v[5:6]
	v_div_scale_f64 v[20:21], vcc_lo, v[5:6], v[3:4], v[5:6]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_scale_f64 v[10:11], null, v[3:4], v[3:4], v[0:1]
	v_rcp_f64_e32 v[12:13], v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_rcp_f64_e32 v[14:15], v[10:11]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[16:17], -v[8:9], v[12:13], 1.0
	v_fma_f64 v[18:19], -v[10:11], v[14:15], 1.0
	v_fma_f64 v[12:13], v[12:13], v[16:17], v[12:13]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[14:15], v[14:15], v[18:19], v[14:15]
	v_fma_f64 v[16:17], -v[8:9], v[12:13], 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[18:19], -v[10:11], v[14:15], 1.0
	v_fma_f64 v[12:13], v[12:13], v[16:17], v[12:13]
	v_div_scale_f64 v[16:17], s0, v[0:1], v[3:4], v[0:1]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[14:15], v[14:15], v[18:19], v[14:15]
	v_mul_f64 v[18:19], v[20:21], v[12:13]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[22:23], v[16:17], v[14:15]
	v_fma_f64 v[8:9], -v[8:9], v[18:19], v[20:21]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[10:11], -v[10:11], v[22:23], v[16:17]
	v_div_fmas_f64 v[8:9], v[8:9], v[12:13], v[18:19]
	s_mov_b32 vcc_lo, s0
	v_cvt_f64_f32_e32 v[12:13], s9
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_fmas_f64 v[10:11], v[10:11], v[14:15], v[22:23]
	v_div_fixup_f64 v[5:6], v[8:9], v[3:4], v[5:6]
	v_cvt_f64_f32_e32 v[8:9], s8
	s_mov_b32 s8, 0x9999999a
	s_mov_b32 s9, 0x3fb99999
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_fixup_f64 v[0:1], v[10:11], v[3:4], v[0:1]
	v_add_f64 v[5:6], v[5:6], s[12:13]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[0:1], v[0:1], -v[12:13]
	v_add_f64 v[5:6], v[5:6], -v[8:9]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cvt_f32_f64_e32 v9, v[0:1]
	v_mad_u64_u32 v[0:1], null, v7, s11, v[2:3]
	v_mul_lo_u32 v11, v0, s11
                                        ; implicit-def: $vgpr0_vgpr1_vgpr2
	s_delay_alu instid0(VALU_DEP_4)
	v_cvt_f32_f64_e32 v10, v[5:6]
	v_cvt_f64_f32_e32 v[5:6], s10
	s_mov_b32 s10, 0xd2f1a9fc
	s_mov_b32 s11, 0x3f60624d
.LBB0_8:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
                                        ;       Child Loop BB0_10 Depth 3
	s_add_i32 s23, s22, s21
	s_mov_b32 s14, 0x9c40
	v_cvt_f64_i32_e32 v[7:8], s23
	s_mov_b32 s24, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[7:8], v[7:8], s[2:3]
	v_div_scale_f64 v[12:13], null, v[3:4], v[3:4], v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[14:15], v[12:13]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[16:17], -v[12:13], v[14:15], 1.0
	v_fma_f64 v[14:15], v[14:15], v[16:17], v[14:15]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[16:17], -v[12:13], v[14:15], 1.0
	v_fma_f64 v[14:15], v[14:15], v[16:17], v[14:15]
	v_div_scale_f64 v[16:17], vcc_lo, v[7:8], v[3:4], v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[18:19], v[16:17], v[14:15]
	v_fma_f64 v[12:13], -v[12:13], v[18:19], v[16:17]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[12:13], v[12:13], v[14:15], v[18:19]
	v_div_fixup_f64 v[7:8], v[12:13], v[3:4], v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[7:8], v[7:8], s[12:13]
	v_add_f64 v[7:8], v[7:8], -v[5:6]
	s_delay_alu instid0(VALU_DEP_1)
	v_cvt_f32_f64_e32 v7, v[7:8]
.LBB0_9:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_10 Depth 3
	s_cmp_lg_u32 s24, 2
	s_mov_b64 s[18:19], 0
	s_cselect_b32 vcc_lo, -1, 0
	s_cmp_lg_u32 s24, 1
	v_cndmask_b32_e32 v2, 0, v2, vcc_lo
	s_cselect_b32 vcc_lo, -1, 0
	s_cmp_lg_u32 s24, 0
	v_cndmask_b32_e32 v1, 0, v1, vcc_lo
	s_cselect_b32 vcc_lo, -1, 0
	s_mov_b32 s25, s14
	v_cndmask_b32_e32 v0, 0, v0, vcc_lo
.LBB0_10:                               ;   Parent Loop BB0_8 Depth=1
                                        ;     Parent Loop BB0_9 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	s_cmp_eq_u32 s24, 1
	s_cselect_b32 vcc_lo, -1, 0
	v_mov_b32_e32 v8, s25
	s_cmp_eq_u32 s24, 2
	v_cndmask_b32_e32 v12, v0, v1, vcc_lo
	s_cselect_b32 s0, -1, 0
	s_cmp_eq_u32 s18, 1
	ds_load_b32 v8, v8
	s_cselect_b32 s1, -1, 0
	s_cmp_eq_u32 s18, 2
	v_cndmask_b32_e64 v13, v10, v9, s1
	s_cselect_b32 s1, -1, 0
	v_cndmask_b32_e64 v12, v12, v2, s0
	s_cmp_eq_u32 s24, 0
	s_delay_alu instid0(VALU_DEP_2)
	v_cndmask_b32_e64 v13, v13, v7, s1
	s_cselect_b32 s1, -1, 0
	s_add_u32 s18, s18, 1
	s_addc_u32 s19, s19, 0
	s_add_i32 s25, s25, 4
	s_cmp_lg_u32 s18, 3
	s_waitcnt lgkmcnt(0)
	v_fmac_f32_e32 v12, v13, v8
	s_delay_alu instid0(VALU_DEP_1)
	v_cndmask_b32_e32 v1, v1, v12, vcc_lo
	v_cndmask_b32_e64 v2, v2, v12, s0
	v_cndmask_b32_e64 v0, v0, v12, s1
	s_cbranch_scc1 .LBB0_10
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	s_add_i32 s24, s24, 1
	s_add_i32 s14, s14, 12
	s_cmp_lg_u32 s24, 3
	s_cbranch_scc1 .LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	v_cvt_f64_f32_e32 v[7:8], v0
	v_cvt_f64_f32_e32 v[12:13], v1
	s_mov_b32 s1, exec_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[7:8], v[7:8], s[8:9]
	v_div_scale_f64 v[16:17], null, s[10:11], s[10:11], v[12:13]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_div_scale_f64 v[14:15], null, s[10:11], s[10:11], v[7:8]
	v_rcp_f64_e32 v[20:21], v[16:17]
	v_div_scale_f64 v[26:27], vcc_lo, v[7:8], s[10:11], v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_rcp_f64_e32 v[18:19], v[14:15]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[24:25], -v[16:17], v[20:21], 1.0
	v_fma_f64 v[22:23], -v[14:15], v[18:19], 1.0
	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[18:19], v[18:19], v[22:23], v[18:19]
	v_fma_f64 v[24:25], -v[16:17], 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[14:15], v[18:19], 1.0
	v_fma_f64 v[20:21], v[20:21], v[24:25], v[20:21]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fma_f64 v[18:19], v[18:19], v[22:23], v[18:19]
	v_div_scale_f64 v[22:23], s0, v[12:13], s[10:11], v[12:13]
	v_mul_f64 v[24:25], v[26:27], v[18:19]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[28:29], v[22:23], v[20:21]
	v_fma_f64 v[14:15], -v[14:15], v[24:25], v[26:27]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[16:17], -v[16:17], v[28:29], v[22:23]
	v_div_fmas_f64 v[14:15], v[14:15], v[18:19], v[24:25]
	s_mov_b32 vcc_lo, s0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_div_fmas_f64 v[16:17], v[16:17], v[20:21], v[28:29]
	v_div_fixup_f64 v[7:8], v[14:15], s[10:11], v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_div_fixup_f64 v[12:13], v[16:17], s[10:11], v[12:13]
	v_add_f64 v[7:8], v[7:8], 0.5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[12:13], v[12:13], 0.5
	v_cvt_i32_f64_e32 v14, v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_i32_f64_e32 v12, v[12:13]
	v_mad_u64_u32 v[7:8], null, 0x63, v14, v[12:13]
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u32_e32 0x2649, v7
	s_cbranch_execz .LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	v_lshlrev_b32_e32 v7, 2, v7
	ds_load_b32 v7, v7
	s_waitcnt lgkmcnt(0)
	v_cvt_f64_f32_e32 v[12:13], v7
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_lt_f64_e32 vcc_lo, s[16:17], v[12:13]
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_8 Depth=1
	v_dual_sub_f32 v7, v7, v2 :: v_dual_add_nc_u32 v18, s23, v11
	s_mov_b32 s14, s10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f64_f32_e32 v[7:8], v7
	v_ashrrev_i32_e32 v19, 31, v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[18:19], 2, v[18:19]
	v_add_co_u32 v20, vcc_lo, s6, v18
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v21, vcc_lo, s7, v19, vcc_lo
	v_add_co_u32 v18, vcc_lo, s4, v18
	v_add_co_ci_u32_e32 v19, vcc_lo, s5, v19, vcc_lo
	global_load_b32 v24, v[20:21], off
	global_load_b32 v25, v[18:19], off
	v_div_scale_f64 v[12:13], null, s[14:15], s[14:15], v[7:8]
	v_div_scale_f64 v[22:23], vcc_lo, v[7:8], s[14:15], v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[14:15], v[12:13]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[16:17], -v[12:13], v[14:15], 1.0
	v_fma_f64 v[14:15], v[14:15], v[16:17], v[14:15]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[16:17], -v[12:13], v[14:15], 1.0
	v_fma_f64 v[14:15], v[14:15], v[16:17], v[14:15]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[16:17], v[22:23], v[14:15]
	v_fma_f64 v[12:13], -v[12:13], v[16:17], v[22:23]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[12:13], v[12:13], v[14:15], v[16:17]
	v_div_fixup_f64 v[7:8], v[12:13], s[14:15], v[7:8]
	s_waitcnt vmcnt(1)
	v_add_nc_u32_e32 v12, 1, v24
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cvt_f32_i32_e32 v13, v12
	v_cvt_f32_f64_e32 v7, v[7:8]
	v_cvt_f32_i32_e32 v8, v24
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e32 vcc_lo, 1.0, v7
	v_cmp_gt_f32_e64 s0, -1.0, v7
	s_or_b32 s0, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v7, v7, 0, s0
	s_waitcnt vmcnt(0)
	v_fmac_f32_e32 v7, v25, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_scale_f32 v8, null, v13, v13, v7
	v_rcp_f32_e32 v14, v8
	s_waitcnt_depctr 0xfff
	v_fma_f32 v15, -v8, v14, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v14, v15, v14
	v_div_scale_f32 v16, vcc_lo, v7, v13, v7
	v_mul_f32_e32 v15, v16, v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v17, -v8, v15, v16
	v_fmac_f32_e32 v15, v17, v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v8, -v8, v15, v16
	v_div_fmas_f32 v8, v8, v14, v15
	s_delay_alu instid0(VALU_DEP_1)
	v_div_fixup_f32 v7, v8, v13, v7
	global_store_b32 v[18:19], v7, off
	global_store_b32 v[20:21], v12, off
.LBB0_15:                               ;   in Loop: Header=BB0_8 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_add_i32 s22, s22, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u32 s22, s20
	s_cbranch_scc1 .LBB0_8
.LBB0_16:                               ; %._crit_edge106
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9calculatePfPiS_S_fffii
		.amdhsa_group_segment_fixed_size 40036
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 312
		.amdhsa_user_sgpr_count 13
		.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 1
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 2
		.amdhsa_next_free_vgpr 30
		.amdhsa_next_free_sgpr 26
		.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	_Z9calculatePfPiS_S_fffii, .Lfunc_end0-_Z9calculatePfPiS_S_fffii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1880
; NumSgprs: 28
; NumVgprs: 30
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 40036 bytes/workgroup (compile time only)
; SGPRBlocks: 3
; VGPRBlocks: 3
; NumSGPRsForWavesPerEU: 28
; NumVGPRsForWavesPerEU: 30
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 13
; 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: 1
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 2
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     by_value
      - .offset:         44
        .size:           4
        .value_kind:     by_value
      - .offset:         48
        .size:           4
        .value_kind:     by_value
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         60
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         64
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         68
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         70
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         72
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         74
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         76
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         78
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         112
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         120
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 40036
    .kernarg_segment_align: 8
    .kernarg_segment_size: 312
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9calculatePfPiS_S_fffii
    .private_segment_fixed_size: 0
    .sgpr_count:     28
    .sgpr_spill_count: 0
    .symbol:         _Z9calculatePfPiS_S_fffii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     30
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
