
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <cmath>
#include <chrono>

using namespace std::chrono;


#define CSC(call)  													\
do {																\
	cudaError_t res = call;											\
	if (res != cudaSuccess) {										\
		fprintf(stderr, "ERROR in %s:%d. Message: %s\n",			\
				__FILE__, __LINE__, cudaGetErrorString(res));		\
		exit(0);													\
	}																\
} while(0)


float normaAvg[32];
float avg[32][3];

void CustomFormulaComputation(float* res, int numClasses, uchar4 curPixel)
{
	float rgb[3];
	float tmp[3];
	float sum, denominator;

	float normaPix = sqrt((float)(curPixel.x * curPixel.x + curPixel.y * curPixel.y + curPixel.z * curPixel.z));

	for (int curClass = 0; curClass < numClasses; ++curClass)
	{
		rgb[0] = curPixel.x * avg[curClass][0];
		rgb[1] = curPixel.y * avg[curClass][1];
		rgb[2] = curPixel.z * avg[curClass][2];

		denominator = normaPix * normaAvg[curClass];
		rgb[0] /= denominator;
		rgb[1] /= denominator;
		rgb[2] /= denominator;
		
		sum = 0.0;
		for (int i = 0; i < 3; ++i) tmp[i] = 0.0;

		for (int i = 0; i < 3; ++i)
		{
			tmp[i] += rgb[0];
			tmp[i] += rgb[1];
			tmp[i] += rgb[2];
			sum += tmp[i];
		}
		res[curClass] = sum;
	}
}
			

int CustomArgMax(float* arr, int numClasses)
{
	float maxValue = arr[0];
	int maxPoint = 0;

	for (int i = 0; i < numClasses; ++i)
	{
		if (arr[i] > maxValue)
		{
			maxValue = arr[i];
			maxPoint = i;
		}
	}
	return maxPoint;
}


void CustomSpectralAngleMethod(uchar4* pixels, int width, int height, int numClasses) 
{

	uchar4 curPixel;
	float res[32];

	for (int x = 0; x < width; ++x)
	{
		for (int y = 0; y < height; ++y)
		{
			curPixel = pixels[y * width + x];
			CustomFormulaComputation(res, numClasses, curPixel);
			pixels[y * width + x].w = CustomArgMax(res, numClasses);
		}
	}
}



__constant__ float constAVG[32][3];
__constant__ float constNormaAVG[32];


__device__ void FormulaComputation(float* res, int numClasses, uchar4 curPixel)
{
	float rgb[3];
	float tmp[3];
	float sum, denominator;

	float normaPix = sqrt((float)(curPixel.x * curPixel.x + curPixel.y * curPixel.y + curPixel.z * curPixel.z));

	for (int curClass = 0; curClass < numClasses; ++curClass)
	{
		rgb[0] = curPixel.x * constAVG[curClass][0];
		rgb[1] = curPixel.y * constAVG[curClass][1];
		rgb[2] = curPixel.z * constAVG[curClass][2];

		denominator = normaPix * constNormaAVG[curClass];
		rgb[0] /= denominator;
		rgb[1] /= denominator;
		rgb[2] /= denominator;
		
		sum = 0.0;
		for (int i = 0; i < 3; ++i) tmp[i] = 0.0;

		for (int i = 0; i < 3; ++i)
		{
			tmp[i] += rgb[0];
			tmp[i] += rgb[1];
			tmp[i] += rgb[2];
			sum += tmp[i];
		}
		res[curClass] = sum;
	}
}
			

__device__ int ArgMax(float* arr, int numClasses)
{
	float maxValue = arr[0];
	int maxPoint = 0;

	for (int i = 0; i < numClasses; ++i)
	{
		if (arr[i] > maxValue)
		{
			maxValue = arr[i];
			maxPoint = i;
		}
	}
	return maxPoint;
}


__global__ void SpectralAngleMethod(uchar4* pixels, int width, int height, int numClasses) 
{
	int idx = blockDim.x * blockIdx.x + threadIdx.x;
	int idy = blockDim.y * blockIdx.y + threadIdx.y;

	int xOffset = blockDim.x * gridDim.x;
	int yOffset = blockDim.y * gridDim.y;

	uchar4 curPixel;
	float res[32];

	for (int x = idx; x < width; x += xOffset)
	{
		for (int y = idy; y < height; y += yOffset)
		{
			curPixel = pixels[y * width + x];
			FormulaComputation(res, numClasses, curPixel);
			pixels[y * width + x].w = ArgMax(res, numClasses);
		}
	}
}


int main(int argc, const char* argv[])
{
	std::string input, output;
	int width, height, numClasses, numPixels;
	uchar4* pixels;

	std::cin >> input >> output >> numClasses;

	int2 coordinate;
	std::vector<std::vector<int2>> samples(numClasses);

	for (int i = 0; i < numClasses; ++i)
	{
		std::cin >> numPixels;
		for (int j = 0; j < numPixels; ++j)
		{
			std::cin >> coordinate.x >> coordinate.y;
			samples[i].emplace_back(coordinate);
		}
	}

	FILE* file;
	if ((file = fopen(input.c_str(), "rb")) == NULL)
	{
	    std::cerr << "ERROR: something wrong with opening the file!\n";
        exit(0);
	}
	else
	{
		fread(&width, sizeof(int), 1, file);
		fread(&height, sizeof(int), 1, file);
		if (width * height > 400000000)
		{
			std::cerr << "ERROR: incorrect input.\n";
			exit(0);
		}
		pixels = new uchar4[width * height];
		fread(pixels, sizeof(uchar4), width * height, file);

		fclose(file);
	}

	int numChannels = 3; // rgb
	int maxElems = 32;


	for (int i = 0; i < numClasses; ++i)
	{
		avg[i][0] = 0.0;
		avg[i][1] = 0.0;
		avg[i][2] = 0.0;

		numPixels = samples[i].size();
		for (int j = 0; j < numPixels; ++j)
		{
			coordinate.x = samples[i][j].x;
			coordinate.y = samples[i][j].y;
			avg[i][0] += pixels[coordinate.y * width + coordinate.x].x;
			avg[i][1] += pixels[coordinate.y * width + coordinate.x].y;
			avg[i][2] += pixels[coordinate.y * width + coordinate.x].z;
		}
		avg[i][0] /= numPixels;
		avg[i][1] /= numPixels;
		avg[i][2] /= numPixels;
	}


    
	for (int i = 0; i < numClasses; ++i)
	{
		normaAvg[i] = std::sqrt(avg[i][0] * avg[i][0] + avg[i][1] * avg[i][1] + avg[i][2] * avg[i][2]);
	}

	CSC(cudaMemcpyToSymbol(constAVG, avg, sizeof(float) * maxElems * numChannels));
	CSC(cudaMemcpyToSymbol(constNormaAVG, normaAvg, sizeof(float) * maxElems));

	uchar4* deviceRes;
	CSC(cudaMalloc(&deviceRes, sizeof(uchar4) * width * height));
	CSC(cudaMemcpy(deviceRes, pixels, sizeof(uchar4) * width * height, cudaMemcpyHostToDevice));



	auto startt = steady_clock::now();
	//custom
	CustomSpectralAngleMethod(pixels, width, height, numClasses);
	auto endd = steady_clock::now();
	std::cout << "CPU" << std::endl;
	std::cout << "time = " << ((double)duration_cast<microseconds>(endd - startt).count()) / 1000.0 << std::endl;



	int xThreadCount = 32;
	int yThreadCount = 32;

	int xBlockCount = 32;
	int yBlockCount = 32;

    dim3 blockCount = dim3(xBlockCount, yBlockCount);
    dim3 threadsCount = dim3(xThreadCount, yThreadCount);



	cudaEvent_t start, end;
    CSC(cudaEventCreate(&start));
    CSC(cudaEventCreate(&end));
    CSC(cudaEventRecord(start));



    SpectralAngleMethod<<<blockCount, threadsCount>>>(deviceRes, width, height, numClasses);
	CSC(cudaGetLastError());



	CSC(cudaEventRecord(end));
    CSC(cudaEventSynchronize(end));
    float t;
    CSC(cudaEventElapsedTime(&t, start, end));
    CSC(cudaEventDestroy(start));
    CSC(cudaEventDestroy(end));
    printf("GPU\n");
    printf("time = %f\n", t);
    printf("blocks = (%d, %d)\n", xBlockCount, yBlockCount);
    printf("threads = (%d, %d)\n", xThreadCount, yThreadCount);



	CSC(cudaMemcpy(pixels, deviceRes, sizeof(uchar4) * width * height, cudaMemcpyDeviceToHost));
	

	if ((file = fopen(output.c_str(), "wb")) == NULL)
	{
		std::cerr << "ERROR: something wrong with opening the file.";
        exit(0);
	}
	else
	{
		fwrite(&width, sizeof(int), 1, file);
		fwrite(&height, sizeof(int), 1, file);
		fwrite(pixels, sizeof(uchar4), width * height, file);

		fclose(file);
	}

	CSC(cudaFree(deviceRes));

	delete[] pixels;
	return 0;
}
	.file	"tmpxft_00293fcf_00000000-6_time3.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4108:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4108:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z24CustomFormulaComputationPfi6uchar4
	.type	_Z24CustomFormulaComputationPfi6uchar4, @function
_Z24CustomFormulaComputationPfi6uchar4:
.LFB4097:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movzbl	%dl, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%edx, %ebx
	shrl	$16, %ebx
	movzbl	%bl, %ebx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movzbl	%dh, %eax
	movl	%eax, %r14d
	movl	%r13d, %eax
	movl	%r14d, %edx
	imull	%r13d, %eax
	imull	%r14d, %edx
	addl	%edx, %eax
	movl	%ebx, %edx
	imull	%ebx, %edx
	addl	%edx, %eax
	cvtsi2ssl	%eax, %xmm0
	call	sqrtf@PLT
	leaq	avg(%rip), %rdx
	xorl	%eax, %eax
	leaq	normaAvg(%rip), %rsi
	leaq	24(%rsp), %rdi
.L3:
	cmpl	%eax, %ebp
	jle	.L10
	movss	(%rsi,%rax,4), %xmm1
	cvtsi2ssl	%r13d, %xmm4
	mulss	(%rdx), %xmm4
	xorl	%ecx, %ecx
	cvtsi2ssl	%r14d, %xmm3
	mulss	4(%rdx), %xmm3
	movq	%rcx, 12(%rsp)
	xorps	%xmm5, %xmm5
	mulss	%xmm0, %xmm1
	cvtsi2ssl	%ebx, %xmm2
	leaq	12(%rsp), %rcx
	movl	$0x00000000, 20(%rsp)
	mulss	8(%rdx), %xmm2
	divss	%xmm1, %xmm4
	divss	%xmm1, %xmm3
	divss	%xmm1, %xmm2
.L4:
	movss	(%rcx), %xmm1
	addq	$4, %rcx
	addss	%xmm4, %xmm1
	addss	%xmm3, %xmm1
	addss	%xmm2, %xmm1
	movss	%xmm1, -4(%rcx)
	addss	%xmm1, %xmm5
	cmpq	%rdi, %rcx
	jne	.L4
	movss	%xmm5, (%r12,%rax,4)
	addq	$12, %rdx
	incq	%rax
	jmp	.L3
.L10:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	addq	$32, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4097:
	.size	_Z24CustomFormulaComputationPfi6uchar4, .-_Z24CustomFormulaComputationPfi6uchar4
	.globl	_Z12CustomArgMaxPfi
	.type	_Z12CustomArgMaxPfi, @function
_Z12CustomArgMaxPfi:
.LFB4098:
	.cfi_startproc
	endbr64
	movss	(%rdi), %xmm0
	xorl	%eax, %eax
	xorl	%edx, %edx
.L12:
	cmpl	%eax, %esi
	jle	.L17
	movss	(%rdi,%rax,4), %xmm1
	comiss	%xmm0, %xmm1
	maxss	%xmm0, %xmm1
	cmova	%eax, %edx
	movaps	%xmm1, %xmm0
	incq	%rax
	jmp	.L12
.L17:
	movl	%edx, %eax
	ret
	.cfi_endproc
.LFE4098:
	.size	_Z12CustomArgMaxPfi, .-_Z12CustomArgMaxPfi
	.globl	_Z25CustomSpectralAngleMethodP6uchar4iii
	.type	_Z25CustomSpectralAngleMethodP6uchar4iii, @function
_Z25CustomSpectralAngleMethodP6uchar4iii:
.LFB4099:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edx, %r9d
	movq	%rdi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movslq	%esi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r14, %r12
	salq	$2, %r14
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movl	%ecx, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, (%rsp)
.L19:
	cmpl	%ebp, %r12d
	jle	.L18
	leaq	(%r15,%rbp,4), %rbx
	xorl	%r13d, %r13d
.L22:
	cmpl	%r9d, %r13d
	jge	.L25
	movl	(%rbx), %edx
	movl	8(%rsp), %esi
	movl	%r9d, 12(%rsp)
	incl	%r13d
	movq	(%rsp), %rdi
	call	_Z24CustomFormulaComputationPfi6uchar4
	movl	8(%rsp), %esi
	movq	(%rsp), %rdi
	call	_Z12CustomArgMaxPfi
	movl	12(%rsp), %r9d
	movb	%al, 3(%rbx)
	addq	%r14, %rbx
	jmp	.L22
.L25:
	incq	%rbp
	jmp	.L19
.L18:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	addq	$168, %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
.LFE4099:
	.size	_Z25CustomSpectralAngleMethodP6uchar4iii, .-_Z25CustomSpectralAngleMethodP6uchar4iii
	.globl	_Z18FormulaComputationPfi6uchar4
	.type	_Z18FormulaComputationPfi6uchar4, @function
_Z18FormulaComputationPfi6uchar4:
.LFB4100:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE4100:
	.size	_Z18FormulaComputationPfi6uchar4, .-_Z18FormulaComputationPfi6uchar4
	.globl	_Z6ArgMaxPfi
	.type	_Z6ArgMaxPfi, @function
_Z6ArgMaxPfi:
.LFB4101:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE4101:
	.size	_Z6ArgMaxPfi, .-_Z6ArgMaxPfi
	.globl	_Z48__device_stub__Z19SpectralAngleMethodP6uchar4iiiP6uchar4iii
	.type	_Z48__device_stub__Z19SpectralAngleMethodP6uchar4iiiP6uchar4iii, @function
_Z48__device_stub__Z19SpectralAngleMethodP6uchar4iiiP6uchar4iii:
.LFB4130:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 16(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 12(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L30
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z19SpectralAngleMethodP6uchar4iii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L30:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4130:
	.size	_Z48__device_stub__Z19SpectralAngleMethodP6uchar4iiiP6uchar4iii, .-_Z48__device_stub__Z19SpectralAngleMethodP6uchar4iiiP6uchar4iii
	.globl	_Z19SpectralAngleMethodP6uchar4iii
	.type	_Z19SpectralAngleMethodP6uchar4iii, @function
_Z19SpectralAngleMethodP6uchar4iii:
.LFB4131:
	.cfi_startproc
	endbr64
	jmp	_Z48__device_stub__Z19SpectralAngleMethodP6uchar4iiiP6uchar4iii
	.cfi_endproc
.LFE4131:
	.size	_Z19SpectralAngleMethodP6uchar4iii, .-_Z19SpectralAngleMethodP6uchar4iii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"_Z19SpectralAngleMethodP6uchar4iii"
.LC2:
	.string	"constAVG"
.LC3:
	.string	"constNormaAVG"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4133:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC1(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z19SpectralAngleMethodP6uchar4iii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC2(%rip), %rdx
	movl	$384, %r9d
	leaq	_ZL8constAVG(%rip), %rsi
	pushq	$1
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC3(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$128, %r9d
	leaq	_ZL13constNormaAVG(%rip), %rsi
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4133:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIS_I4int2SaIS0_EESaIS2_EED2Ev,"axG",@progbits,_ZNSt6vectorIS_I4int2SaIS0_EESaIS2_EED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIS_I4int2SaIS0_EESaIS2_EED2Ev
	.type	_ZNSt6vectorIS_I4int2SaIS0_EESaIS2_EED2Ev, @function
_ZNSt6vectorIS_I4int2SaIS0_EESaIS2_EED2Ev:
.LFB4474:
	.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
	movq	8(%rdi), %r12
	movq	%rdi, %rbx
	movq	(%rdi), %rbp
.L38:
	cmpq	%rbp, %r12
	je	.L46
	movq	0(%rbp), %rdi
	testq	%rdi, %rdi
	je	.L39
	movq	16(%rbp), %rsi
	subq	%rdi, %rsi
	call	_ZdlPvm@PLT
.L39:
	addq	$24, %rbp
	jmp	.L38
.L46:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.L37
	movq	16(%rbx), %rsi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	subq	%rdi, %rsi
	jmp	_ZdlPvm@PLT
.L37:
	.cfi_restore_state
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4474:
	.size	_ZNSt6vectorIS_I4int2SaIS0_EESaIS2_EED2Ev, .-_ZNSt6vectorIS_I4int2SaIS0_EESaIS2_EED2Ev
	.weak	_ZNSt6vectorIS_I4int2SaIS0_EESaIS2_EED1Ev
	.set	_ZNSt6vectorIS_I4int2SaIS0_EESaIS2_EED1Ev,_ZNSt6vectorIS_I4int2SaIS0_EESaIS2_EED2Ev
	.section	.rodata._ZNSt6vectorI4int2SaIS0_EE17_M_realloc_insertIJRS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_.str1.1,"aMS",@progbits,1
.LC4:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorI4int2SaIS0_EE17_M_realloc_insertIJRS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,"axG",@progbits,_ZNSt6vectorI4int2SaIS0_EE17_M_realloc_insertIJRS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorI4int2SaIS0_EE17_M_realloc_insertIJRS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
	.type	_ZNSt6vectorI4int2SaIS0_EE17_M_realloc_insertIJRS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_, @function
_ZNSt6vectorI4int2SaIS0_EE17_M_realloc_insertIJRS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_:
.LFB4665:
	.cfi_startproc
	endbr64
	movabsq	$1152921504606846975, %rcx
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	8(%rdi), %rax
	movq	(%rdi), %r14
	movq	%rax, %rbx
	movq	%rax, (%rsp)
	subq	%r14, %rbx
	sarq	$3, %rbx
	cmpq	%rcx, %rbx
	jne	.L48
	leaq	.LC4(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L48:
	cmpq	%r14, (%rsp)
	movl	$1, %eax
	movq	%rsi, %r15
	movq	%rdi, %r13
	cmovne	%rbx, %rax
	movq	%rsi, %rbp
	addq	%rax, %rbx
	setc	%al
	subq	%r14, %r15
	movzbl	%al, %eax
	testq	%rax, %rax
	jne	.L58
	xorl	%r12d, %r12d
	testq	%rbx, %rbx
	je	.L53
	movabsq	$1152921504606846975, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L52
.L58:
	movq	%rcx, %rbx
.L52:
	leaq	0(,%rbx,8), %rdi
	movq	%rdx, 8(%rsp)
	call	_Znwm@PLT
	movq	8(%rsp), %rdx
	movq	%rax, %r12
.L53:
	movq	(%rdx), %rax
	movq	%rax, (%r12,%r15)
	testq	%r15, %r15
	jle	.L54
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	memmove@PLT
.L54:
	movq	(%rsp), %rax
	leaq	8(%r12,%r15), %rdx
	subq	%rbp, %rax
	testq	%rax, %rax
	jle	.L55
	movq	%rdx, %rdi
	movq	%rbp, %rsi
	movq	%rax, %rcx
	rep movsb
.L55:
	leaq	(%rdx,%rax), %rbp
	testq	%r14, %r14
	je	.L56
	movq	16(%r13), %rsi
	movq	%r14, %rdi
	subq	%r14, %rsi
	call	_ZdlPvm@PLT
.L56:
	leaq	(%r12,%rbx,8), %rax
	movq	%r12, 0(%r13)
	movq	%rbp, 8(%r13)
	movq	%rax, 16(%r13)
	addq	$24, %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
.LFE4665:
	.size	_ZNSt6vectorI4int2SaIS0_EE17_M_realloc_insertIJRS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_, .-_ZNSt6vectorI4int2SaIS0_EE17_M_realloc_insertIJRS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
	.section	.rodata.str1.1
.LC5:
	.string	"cannot create std::vector larger than max_size()"
.LC6:
	.string	"rb"
.LC7:
	.string	"ERROR: something wrong with opening the file!\n"
.LC8:
	.string	"ERROR: incorrect input.\n"
.LC9:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/lveltman/PGP/master/lab3/time3.cu"
.LC10:
	.string	"ERROR in %s:%d. Message: %s\n"
.LC11:
	.string	"CPU"
.LC12:
	.string	"time = "
.LC14:
	.string	"GPU\n"
.LC15:
	.string	"time = %f\n"
.LC16:
	.string	"blocks = (%d, %d)\n"
.LC17:
	.string	"threads = (%d, %d)\n"
.LC18:
	.string	"wb"
.LC19:
	.string	"ERROR: something wrong with opening the file."
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4102:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4102
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%esi, %esi
	xorl	%edi, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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	$216, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	136(%rsp), %rax
	movq	%rsi, 144(%rsp)
	movq	%rax, 8(%rsp)
	leaq	152(%rsp), %rax
	movq	8(%rsp), %rsi
	movq	%rax, 136(%rsp)
	leaq	184(%rsp), %rax
	movq	%rdi, 176(%rsp)
	leaq	_ZSt3cin(%rip), %rdi
	movb	$0, 152(%rsp)
	movq	%rax, 168(%rsp)
	movb	$0, 184(%rsp)
.LEHB0:
	call	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	%rax, %rdi
	leaq	168(%rsp), %rsi
	call	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	%rax, %rdi
	leaq	44(%rsp), %rsi
	call	_ZNSirsERi@PLT
	movabsq	$384307168202282325, %rax
	movslq	44(%rsp), %rbp
	cmpq	%rbp, %rax
	jnb	.L66
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L118
	leaq	.LC5(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L66:
	xorl	%ecx, %ecx
	imulq	$24, %rbp, %r12
	movq	%rcx, 112(%rsp)
	movq	%rcx, 120(%rsp)
	movq	%rcx, 128(%rsp)
	testq	%rbp, %rbp
	je	.L111
	movq	%r12, %rdi
	call	_Znwm@PLT
.LEHE0:
	movq	%rax, %rbx
	jmp	.L68
.L111:
	xorl	%ebx, %ebx
.L68:
	addq	%rbx, %r12
	movq	%rbx, 112(%rsp)
	movq	%rbx, %rax
	movq	%r12, 128(%rsp)
.L69:
	testq	%rbp, %rbp
	je	.L152
	xorl	%edx, %edx
	decq	%rbp
	addq	$24, %rax
	movq	%rdx, -24(%rax)
	movq	%rdx, -16(%rax)
	movq	%rdx, -8(%rax)
	jmp	.L69
.L152:
	leaq	48(%rsp), %rax
	movq	%r12, 120(%rsp)
	xorl	%r13d, %r13d
	movq	%rbx, %r12
	movq	%rax, 24(%rsp)
.L71:
	cmpl	%r13d, 44(%rsp)
	jle	.L153
	movq	24(%rsp), %rsi
	leaq	_ZSt3cin(%rip), %rdi
.LEHB1:
	call	_ZNSirsERi@PLT
	leaq	56(%rsp), %rax
	xorl	%r14d, %r14d
	movq	%rax, 16(%rsp)
.L72:
	cmpl	%r14d, 48(%rsp)
	jle	.L154
	movq	16(%rsp), %rsi
	leaq	_ZSt3cin(%rip), %rdi
	call	_ZNSirsERi@PLT
	movq	%rax, %rdi
	leaq	60(%rsp), %rsi
	call	_ZNSirsERi@PLT
	movq	8(%r12), %rsi
	cmpq	16(%r12), %rsi
	je	.L73
	movq	56(%rsp), %rax
	addq	$8, %rsi
	movq	%rax, -8(%rsi)
	movq	%rsi, 8(%r12)
	jmp	.L74
.L73:
	movq	16(%rsp), %rdx
	movq	%r12, %rdi
	call	_ZNSt6vectorI4int2SaIS0_EE17_M_realloc_insertIJRS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_
.L74:
	incl	%r14d
	jmp	.L72
.L154:
	incl	%r13d
	addq	$24, %r12
	jmp	.L71
.L153:
	movq	136(%rsp), %rdi
	leaq	.LC6(%rip), %rsi
	call	fopen@PLT
	movq	%rax, %r13
	testq	%rax, %rax
	jne	.L77
	leaq	.LC7(%rip), %rsi
.L121:
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L79:
	xorl	%edi, %edi
	call	exit@PLT
.L77:
	leaq	36(%rsp), %rdi
	movq	%rax, %r8
	movl	$1, %ecx
	movl	$4, %edx
	movl	$4, %esi
	call	__fread_chk@PLT
	leaq	40(%rsp), %rdi
	movq	%r13, %r8
	movl	$1, %ecx
	movl	$4, %edx
	movl	$4, %esi
	call	__fread_chk@PLT
	movl	36(%rsp), %eax
	imull	40(%rsp), %eax
	leaq	.LC8(%rip), %rsi
	cmpl	$400000000, %eax
	jg	.L121
	movabsq	$2305843009213693950, %rdx
	cltq
	cmpq	%rax, %rdx
	jb	.L80
	leaq	0(,%rax,4), %r14
	movq	%r14, %rdi
	call	_Znam@PLT
	movl	36(%rsp), %ecx
	imull	40(%rsp), %ecx
	movq	%r13, %r8
	movq	%r14, %rsi
	movl	$4, %edx
	movq	%rax, %rdi
	movq	%rax, %r12
	movslq	%ecx, %rcx
	call	__fread_chk@PLT
	jmp	.L155
.L80:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L118
	call	__cxa_throw_bad_array_new_length@PLT
.L155:
	movq	%r13, %rdi
	call	fclose@PLT
	leaq	avg(%rip), %r13
	movl	44(%rsp), %r14d
	xorl	%edx, %edx
	xorl	%edi, %edi
	movl	36(%rsp), %r9d
	movq	%r13, %rax
.L83:
	cmpl	%edi, %r14d
	jle	.L156
	movq	(%rbx), %r8
	movq	8(%rbx), %rcx
	movl	$0x00000000, (%rax)
	xorl	%esi, %esi
	movl	$0x00000000, 4(%rax)
	subq	%r8, %rcx
	movl	$0x00000000, 8(%rax)
	sarq	$3, %rcx
	movl	%ecx, %r15d
.L84:
	cmpl	%esi, %r15d
	movss	(%rax), %xmm2
	movss	4(%rax), %xmm1
	movss	8(%rax), %xmm0
	jle	.L157
	movl	(%r8,%rsi,8), %r10d
	movl	%r10d, 56(%rsp)
	movl	4(%r8,%rsi,8), %edx
	incq	%rsi
	movl	%edx, 60(%rsp)
	imull	%r9d, %edx
	addl	%r10d, %edx
	movslq	%edx, %rdx
	leaq	(%r12,%rdx,4), %rdx
	movzbl	(%rdx), %r10d
	cvtsi2ssl	%r10d, %xmm3
	movzbl	1(%rdx), %r10d
	movzbl	2(%rdx), %edx
	addss	%xmm2, %xmm3
	cvtsi2ssl	%r10d, %xmm2
	movss	%xmm3, (%rax)
	addss	%xmm2, %xmm1
	movss	%xmm1, 4(%rax)
	cvtsi2ssl	%edx, %xmm1
	addss	%xmm1, %xmm0
	movss	%xmm0, 8(%rax)
	jmp	.L84
.L157:
	cvtsi2ssl	%ecx, %xmm3
	incl	%edi
	addq	$12, %rax
	addq	$24, %rbx
	movb	$1, %dl
	divss	%xmm3, %xmm2
	divss	%xmm3, %xmm1
	movss	%xmm2, -12(%rax)
	divss	%xmm3, %xmm0
	movss	%xmm1, -8(%rax)
	movss	%xmm0, -4(%rax)
	jmp	.L83
.L156:
	testb	%dl, %dl
	je	.L87
	movl	%r15d, 48(%rsp)
.L87:
	leaq	normaAvg(%rip), %rbx
.L88:
	cmpl	%ebp, %r14d
	jle	.L158
	movss	0(%r13), %xmm0
	movss	4(%r13), %xmm2
	addq	$12, %r13
	movss	-4(%r13), %xmm1
	mulss	%xmm2, %xmm2
	mulss	%xmm0, %xmm0
	mulss	%xmm1, %xmm1
	addss	%xmm2, %xmm0
	addss	%xmm1, %xmm0
	call	sqrtf@PLT
	movss	%xmm0, (%rbx,%rbp,4)
	incq	%rbp
	jmp	.L88
.L158:
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$384, %edx
	leaq	avg(%rip), %rsi
	leaq	_ZL8constAVG(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L90
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$247, %r8d
	jmp	.L150
.L90:
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$128, %edx
	movq	%rbx, %rsi
	leaq	_ZL13constNormaAVG(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L91
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$248, %r8d
	jmp	.L150
.L91:
	movslq	36(%rsp), %rsi
	movslq	40(%rsp), %rax
	leaq	64(%rsp), %rdi
	imulq	%rax, %rsi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L92
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$251, %r8d
	jmp	.L150
.L92:
	movslq	36(%rsp), %rdx
	movslq	40(%rsp), %rax
	movl	$1, %ecx
	movq	%r12, %rsi
	movq	64(%rsp), %rdi
	imulq	%rax, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L93
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$252, %r8d
	jmp	.L150
.L93:
	call	_ZNSt6chrono3_V212steady_clock3nowEv@PLT
	movl	36(%rsp), %esi
	movl	44(%rsp), %ecx
	movq	%r12, %rdi
	movl	40(%rsp), %edx
	leaq	_ZSt4cout(%rip), %r13
	movq	%rax, %rbp
	call	_Z25CustomSpectralAngleMethodP6uchar4iii
	call	_ZNSt6chrono3_V212steady_clock3nowEv@PLT
	leaq	.LC11(%rip), %rsi
	movq	%r13, %rdi
	movq	%rax, %rbx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	leaq	.LC12(%rip), %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%rbx, %rax
	movl	$1000, %ecx
	subq	%rbp, %rax
	cqto
	idivq	%rcx
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC13(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movabsq	$137438953504, %rax
	leaq	72(%rsp), %rdi
	movl	$1, 96(%rsp)
	movq	%rax, 88(%rsp)
	movq	%rax, 100(%rsp)
	movl	$1, 108(%rsp)
	call	cudaEventCreate@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L94
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$277, %r8d
	jmp	.L150
.L94:
	leaq	80(%rsp), %rdi
	call	cudaEventCreate@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L95
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$278, %r8d
	jmp	.L150
.L95:
	movq	72(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L96
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$279, %r8d
	jmp	.L150
.L96:
	movl	108(%rsp), %ecx
	movq	100(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	88(%rsp), %rdi
	movl	96(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L97
	movl	44(%rsp), %ecx
	movl	40(%rsp), %edx
	movl	36(%rsp), %esi
	movq	64(%rsp), %rdi
	call	_Z48__device_stub__Z19SpectralAngleMethodP6uchar4iiiP6uchar4iii
.L97:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L98
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$284, %r8d
	jmp	.L150
.L98:
	movq	80(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L99
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$288, %r8d
	jmp	.L150
.L99:
	movq	80(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L100
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$289, %r8d
	jmp	.L150
.L100:
	movq	80(%rsp), %rdx
	movq	72(%rsp), %rsi
	leaq	52(%rsp), %rdi
	call	cudaEventElapsedTime@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L101
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$291, %r8d
	jmp	.L150
.L101:
	movq	72(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L102
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$292, %r8d
	jmp	.L150
.L102:
	movq	80(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L103
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$293, %r8d
	jmp	.L150
.L103:
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC15(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	52(%rsp), %xmm0
	call	__printf_chk@PLT
	movl	$32, %ecx
	movl	$32, %edx
	leaq	.LC16(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	$32, %ecx
	movl	$32, %edx
	leaq	.LC17(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movslq	36(%rsp), %rdx
	movslq	40(%rsp), %rax
	movl	$2, %ecx
	movq	%r12, %rdi
	movq	64(%rsp), %rsi
	imulq	%rax, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L104
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$301, %r8d
	jmp	.L150
.L104:
	movq	168(%rsp), %rdi
	leaq	.LC18(%rip), %rsi
	call	fopen@PLT
	movq	%rax, %rbx
	leaq	.LC19(%rip), %rsi
	testq	%rax, %rax
	je	.L121
	leaq	36(%rsp), %rdi
	movq	%rax, %rcx
	movl	$1, %edx
	movl	$4, %esi
	call	fwrite@PLT
	leaq	40(%rsp), %rdi
	movq	%rbx, %rcx
	movl	$1, %edx
	movl	$4, %esi
	call	fwrite@PLT
	movl	36(%rsp), %edx
	imull	40(%rsp), %edx
	movq	%rbx, %rcx
	movq	%r12, %rdi
	movl	$4, %esi
	movslq	%edx, %rdx
	call	fwrite@PLT
	movq	%rbx, %rdi
	call	fclose@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L106
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$318, %r8d
.L150:
	movq	stderr(%rip), %rdi
	leaq	.LC9(%rip), %rcx
	leaq	.LC10(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	call	__fprintf_chk@PLT
.LEHE1:
	jmp	.L79
.L106:
	movq	%r12, %rdi
	call	_ZdaPv@PLT
	leaq	112(%rsp), %rdi
	call	_ZNSt6vectorIS_I4int2SaIS0_EESaIS2_EED1Ev
	leaq	168(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	leaq	136(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L110
	jmp	.L118
.L113:
	endbr64
	movq	%rax, %rbx
.L107:
	leaq	112(%rsp), %rdi
	call	_ZNSt6vectorIS_I4int2SaIS0_EESaIS2_EED1Ev
	jmp	.L108
.L112:
	endbr64
	movq	%rax, %rbx
.L108:
	leaq	168(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L118
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L118:
	call	__stack_chk_fail@PLT
.L110:
	addq	$216, %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
.LFE4102:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4102:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4102-.LLSDACSB4102
.LLSDACSB4102:
	.uleb128 .LEHB0-.LFB4102
	.uleb128 .LEHE0-.LEHB0
	.uleb128 .L112-.LFB4102
	.uleb128 0
	.uleb128 .LEHB1-.LFB4102
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L113-.LFB4102
	.uleb128 0
	.uleb128 .LEHB2-.LFB4102
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE4102:
	.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
	.local	_ZL13constNormaAVG
	.comm	_ZL13constNormaAVG,128,32
	.local	_ZL8constAVG
	.comm	_ZL8constAVG,384,32
	.globl	avg
	.bss
	.align 32
	.type	avg, @object
	.size	avg, 384
avg:
	.zero	384
	.globl	normaAvg
	.align 32
	.type	normaAvg, @object
	.size	normaAvg, 128
normaAvg:
	.zero	128
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC13:
	.long	0
	.long	1083129856
	.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 <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <cmath>
#include <chrono>

using namespace std::chrono;


#define CSC(call)  													\
do {																\
	hipError_t res = call;											\
	if (res != hipSuccess) {										\
		fprintf(stderr, "ERROR in %s:%d. Message: %s\n",			\
				__FILE__, __LINE__, hipGetErrorString(res));		\
		exit(0);													\
	}																\
} while(0)


float normaAvg[32];
float avg[32][3];

void CustomFormulaComputation(float* res, int numClasses, uchar4 curPixel)
{
	float rgb[3];
	float tmp[3];
	float sum, denominator;

	float normaPix = sqrt((float)(curPixel.x * curPixel.x + curPixel.y * curPixel.y + curPixel.z * curPixel.z));

	for (int curClass = 0; curClass < numClasses; ++curClass)
	{
		rgb[0] = curPixel.x * avg[curClass][0];
		rgb[1] = curPixel.y * avg[curClass][1];
		rgb[2] = curPixel.z * avg[curClass][2];

		denominator = normaPix * normaAvg[curClass];
		rgb[0] /= denominator;
		rgb[1] /= denominator;
		rgb[2] /= denominator;
		
		sum = 0.0;
		for (int i = 0; i < 3; ++i) tmp[i] = 0.0;

		for (int i = 0; i < 3; ++i)
		{
			tmp[i] += rgb[0];
			tmp[i] += rgb[1];
			tmp[i] += rgb[2];
			sum += tmp[i];
		}
		res[curClass] = sum;
	}
}
			

int CustomArgMax(float* arr, int numClasses)
{
	float maxValue = arr[0];
	int maxPoint = 0;

	for (int i = 0; i < numClasses; ++i)
	{
		if (arr[i] > maxValue)
		{
			maxValue = arr[i];
			maxPoint = i;
		}
	}
	return maxPoint;
}


void CustomSpectralAngleMethod(uchar4* pixels, int width, int height, int numClasses) 
{

	uchar4 curPixel;
	float res[32];

	for (int x = 0; x < width; ++x)
	{
		for (int y = 0; y < height; ++y)
		{
			curPixel = pixels[y * width + x];
			CustomFormulaComputation(res, numClasses, curPixel);
			pixels[y * width + x].w = CustomArgMax(res, numClasses);
		}
	}
}



__constant__ float constAVG[32][3];
__constant__ float constNormaAVG[32];


__device__ void FormulaComputation(float* res, int numClasses, uchar4 curPixel)
{
	float rgb[3];
	float tmp[3];
	float sum, denominator;

	float normaPix = sqrt((float)(curPixel.x * curPixel.x + curPixel.y * curPixel.y + curPixel.z * curPixel.z));

	for (int curClass = 0; curClass < numClasses; ++curClass)
	{
		rgb[0] = curPixel.x * constAVG[curClass][0];
		rgb[1] = curPixel.y * constAVG[curClass][1];
		rgb[2] = curPixel.z * constAVG[curClass][2];

		denominator = normaPix * constNormaAVG[curClass];
		rgb[0] /= denominator;
		rgb[1] /= denominator;
		rgb[2] /= denominator;
		
		sum = 0.0;
		for (int i = 0; i < 3; ++i) tmp[i] = 0.0;

		for (int i = 0; i < 3; ++i)
		{
			tmp[i] += rgb[0];
			tmp[i] += rgb[1];
			tmp[i] += rgb[2];
			sum += tmp[i];
		}
		res[curClass] = sum;
	}
}
			

__device__ int ArgMax(float* arr, int numClasses)
{
	float maxValue = arr[0];
	int maxPoint = 0;

	for (int i = 0; i < numClasses; ++i)
	{
		if (arr[i] > maxValue)
		{
			maxValue = arr[i];
			maxPoint = i;
		}
	}
	return maxPoint;
}


__global__ void SpectralAngleMethod(uchar4* pixels, int width, int height, int numClasses) 
{
	int idx = blockDim.x * blockIdx.x + threadIdx.x;
	int idy = blockDim.y * blockIdx.y + threadIdx.y;

	int xOffset = blockDim.x * gridDim.x;
	int yOffset = blockDim.y * gridDim.y;

	uchar4 curPixel;
	float res[32];

	for (int x = idx; x < width; x += xOffset)
	{
		for (int y = idy; y < height; y += yOffset)
		{
			curPixel = pixels[y * width + x];
			FormulaComputation(res, numClasses, curPixel);
			pixels[y * width + x].w = ArgMax(res, numClasses);
		}
	}
}


int main(int argc, const char* argv[])
{
	std::string input, output;
	int width, height, numClasses, numPixels;
	uchar4* pixels;

	std::cin >> input >> output >> numClasses;

	int2 coordinate;
	std::vector<std::vector<int2>> samples(numClasses);

	for (int i = 0; i < numClasses; ++i)
	{
		std::cin >> numPixels;
		for (int j = 0; j < numPixels; ++j)
		{
			std::cin >> coordinate.x >> coordinate.y;
			samples[i].emplace_back(coordinate);
		}
	}

	FILE* file;
	if ((file = fopen(input.c_str(), "rb")) == NULL)
	{
	    std::cerr << "ERROR: something wrong with opening the file!\n";
        exit(0);
	}
	else
	{
		fread(&width, sizeof(int), 1, file);
		fread(&height, sizeof(int), 1, file);
		if (width * height > 400000000)
		{
			std::cerr << "ERROR: incorrect input.\n";
			exit(0);
		}
		pixels = new uchar4[width * height];
		fread(pixels, sizeof(uchar4), width * height, file);

		fclose(file);
	}

	int numChannels = 3; // rgb
	int maxElems = 32;


	for (int i = 0; i < numClasses; ++i)
	{
		avg[i][0] = 0.0;
		avg[i][1] = 0.0;
		avg[i][2] = 0.0;

		numPixels = samples[i].size();
		for (int j = 0; j < numPixels; ++j)
		{
			coordinate.x = samples[i][j].x;
			coordinate.y = samples[i][j].y;
			avg[i][0] += pixels[coordinate.y * width + coordinate.x].x;
			avg[i][1] += pixels[coordinate.y * width + coordinate.x].y;
			avg[i][2] += pixels[coordinate.y * width + coordinate.x].z;
		}
		avg[i][0] /= numPixels;
		avg[i][1] /= numPixels;
		avg[i][2] /= numPixels;
	}


    
	for (int i = 0; i < numClasses; ++i)
	{
		normaAvg[i] = std::sqrt(avg[i][0] * avg[i][0] + avg[i][1] * avg[i][1] + avg[i][2] * avg[i][2]);
	}

	CSC(hipMemcpyToSymbol(HIP_SYMBOL(constAVG), avg, sizeof(float) * maxElems * numChannels));
	CSC(hipMemcpyToSymbol(HIP_SYMBOL(constNormaAVG), normaAvg, sizeof(float) * maxElems));

	uchar4* deviceRes;
	CSC(hipMalloc(&deviceRes, sizeof(uchar4) * width * height));
	CSC(hipMemcpy(deviceRes, pixels, sizeof(uchar4) * width * height, hipMemcpyHostToDevice));



	auto startt = steady_clock::now();
	//custom
	CustomSpectralAngleMethod(pixels, width, height, numClasses);
	auto endd = steady_clock::now();
	std::cout << "CPU" << std::endl;
	std::cout << "time = " << ((double)duration_cast<microseconds>(endd - startt).count()) / 1000.0 << std::endl;



	int xThreadCount = 32;
	int yThreadCount = 32;

	int xBlockCount = 32;
	int yBlockCount = 32;

    dim3 blockCount = dim3(xBlockCount, yBlockCount);
    dim3 threadsCount = dim3(xThreadCount, yThreadCount);



	hipEvent_t start, end;
    CSC(hipEventCreate(&start));
    CSC(hipEventCreate(&end));
    CSC(hipEventRecord(start));



    SpectralAngleMethod<<<blockCount, threadsCount>>>(deviceRes, width, height, numClasses);
	CSC(hipGetLastError());



	CSC(hipEventRecord(end));
    CSC(hipEventSynchronize(end));
    float t;
    CSC(hipEventElapsedTime(&t, start, end));
    CSC(hipEventDestroy(start));
    CSC(hipEventDestroy(end));
    printf("GPU\n");
    printf("time = %f\n", t);
    printf("blocks = (%d, %d)\n", xBlockCount, yBlockCount);
    printf("threads = (%d, %d)\n", xThreadCount, yThreadCount);



	CSC(hipMemcpy(pixels, deviceRes, sizeof(uchar4) * width * height, hipMemcpyDeviceToHost));
	

	if ((file = fopen(output.c_str(), "wb")) == NULL)
	{
		std::cerr << "ERROR: something wrong with opening the file.";
        exit(0);
	}
	else
	{
		fwrite(&width, sizeof(int), 1, file);
		fwrite(&height, sizeof(int), 1, file);
		fwrite(pixels, sizeof(uchar4), width * height, file);

		fclose(file);
	}

	CSC(hipFree(deviceRes));

	delete[] pixels;
	return 0;
}
	.text
	.file	"time3.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z24CustomFormulaComputationPfi15HIP_vector_typeIhLj4EE # -- Begin function _Z24CustomFormulaComputationPfi15HIP_vector_typeIhLj4EE
	.type	_Z24CustomFormulaComputationPfi15HIP_vector_typeIhLj4EE,@function
_Z24CustomFormulaComputationPfi15HIP_vector_typeIhLj4EE: # @_Z24CustomFormulaComputationPfi15HIP_vector_typeIhLj4EE
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %r14d
	movl	%esi, %ebp
	movl	%edx, %r15d
	shrl	$8, %r15d
	movl	%edx, %r12d
	shrl	$16, %r12d
	movl	$255, %eax
	andl	%eax, %r14d
	movl	%r14d, %ecx
	imull	%r14d, %ecx
	andl	%eax, %r15d
	movl	%r15d, %edx
	imull	%r15d, %edx
	addl	%ecx, %edx
	andl	%eax, %r12d
	movl	%r12d, %eax
	imull	%r12d, %eax
	addl	%edx, %eax
	cvtsi2sd	%eax, %xmm0
	movq	%rdi, %rbx
	xorpd	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jb	.LBB0_2
# %bb.1:
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB0_3
.LBB0_2:                                # %call.sqrt
	callq	sqrt
.LBB0_3:                                # %.split
	testl	%ebp, %ebp
	jle	.LBB0_8
# %bb.4:                                # %.lr.ph
	xorps	%xmm1, %xmm1
	cvtsi2ss	%r14d, %xmm1
	cvtsi2ss	%r15d, %xmm2
	cvtsi2ss	%r12d, %xmm3
	cvtsd2ss	%xmm0, %xmm0
	movl	%ebp, %eax
	xorl	%ecx, %ecx
.LBB0_5:                                # %.preheader.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_6 Depth 2
	leaq	(,%rcx,4), %rdx
	movss	avg+4(%rdx,%rdx,2), %xmm4       # xmm4 = mem[0],zero,zero,zero
	mulss	%xmm2, %xmm4
	movss	normaAvg(,%rcx,4), %xmm7        # xmm7 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm7
	divss	%xmm7, %xmm4
	movss	avg(%rdx,%rdx,2), %xmm5         # xmm5 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm5
	movss	avg+8(%rdx,%rdx,2), %xmm6       # xmm6 = mem[0],zero,zero,zero
	mulss	%xmm3, %xmm6
	movl	$0, 8(%rsp)
	movq	$0, (%rsp)
	divss	%xmm7, %xmm5
	divss	%xmm7, %xmm6
	xorps	%xmm7, %xmm7
	xorl	%edx, %edx
.LBB0_6:                                # %.preheader
                                        #   Parent Loop BB0_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rsp,%rdx,4), %xmm8            # xmm8 = mem[0],zero,zero,zero
	addss	%xmm5, %xmm8
	addss	%xmm4, %xmm8
	addss	%xmm6, %xmm8
	movss	%xmm8, (%rsp,%rdx,4)
	addss	%xmm8, %xmm7
	incq	%rdx
	cmpq	$3, %rdx
	jne	.LBB0_6
# %bb.7:                                #   in Loop: Header=BB0_5 Depth=1
	movss	%xmm7, (%rbx,%rcx,4)
	incq	%rcx
	cmpq	%rax, %rcx
	jne	.LBB0_5
.LBB0_8:                                # %._crit_edge
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z24CustomFormulaComputationPfi15HIP_vector_typeIhLj4EE, .Lfunc_end0-_Z24CustomFormulaComputationPfi15HIP_vector_typeIhLj4EE
	.cfi_endproc
                                        # -- End function
	.globl	_Z12CustomArgMaxPfi             # -- Begin function _Z12CustomArgMaxPfi
	.type	_Z12CustomArgMaxPfi,@function
_Z12CustomArgMaxPfi:                    # @_Z12CustomArgMaxPfi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB1_1
# %bb.3:                                # %.lr.ph.preheader
	movss	(%rdi), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movl	%esi, %ecx
	xorl	%edx, %edx
	xorl	%eax, %eax
.LBB1_4:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movss	(%rdi,%rdx,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	cmoval	%edx, %eax
	maxss	%xmm0, %xmm1
	incq	%rdx
	movaps	%xmm1, %xmm0
	cmpq	%rdx, %rcx
	jne	.LBB1_4
# %bb.2:                                # %._crit_edge
	retq
.LBB1_1:
	xorl	%eax, %eax
	retq
.Lfunc_end1:
	.size	_Z12CustomArgMaxPfi, .Lfunc_end1-_Z12CustomArgMaxPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z25CustomSpectralAngleMethodP15HIP_vector_typeIhLj4EEiii # -- Begin function _Z25CustomSpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.type	_Z25CustomSpectralAngleMethodP15HIP_vector_typeIhLj4EEiii,@function
_Z25CustomSpectralAngleMethodP15HIP_vector_typeIhLj4EEiii: # @_Z25CustomSpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, 4(%rsp)                   # 4-byte Spill
	movq	%rdi, 16(%rsp)                  # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB2_7
# %bb.1:                                # %.preheader.lr.ph
	movl	%ecx, %ebx
	movl	%ecx, %r12d
	movl	%esi, %r13d
	movl	4(%rsp), %eax                   # 4-byte Reload
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
.LBB2_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_4 Depth 2
                                        #       Child Loop BB2_9 Depth 3
	cmpl	$0, 4(%rsp)                     # 4-byte Folded Reload
	jle	.LBB2_6
# %bb.3:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB2_2 Depth=1
	movq	16(%rsp), %rax                  # 8-byte Reload
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rax,%rcx,4), %rbp
	xorl	%r15d, %r15d
.LBB2_4:                                # %.lr.ph
                                        #   Parent Loop BB2_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_9 Depth 3
	movq	%r15, %r14
	imulq	%r13, %r14
	movl	(%rbp,%r14,4), %edx
	leaq	32(%rsp), %rdi
	movl	%ebx, %esi
	callq	_Z24CustomFormulaComputationPfi15HIP_vector_typeIhLj4EE
	testl	%ebx, %ebx
	jle	.LBB2_5
# %bb.8:                                # %.lr.ph.preheader.i
                                        #   in Loop: Header=BB2_4 Depth=2
	movss	32(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	xorl	%ecx, %ecx
	xorl	%eax, %eax
.LBB2_9:                                # %.lr.ph.i
                                        #   Parent Loop BB2_2 Depth=1
                                        #     Parent Loop BB2_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	32(%rsp,%rcx,4), %xmm1          # xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	movzbl	%al, %eax
	cmoval	%ecx, %eax
	maxss	%xmm0, %xmm1
	incq	%rcx
	movaps	%xmm1, %xmm0
	cmpq	%rcx, %r12
	jne	.LBB2_9
	jmp	.LBB2_10
.LBB2_5:                                #   in Loop: Header=BB2_4 Depth=2
	xorl	%eax, %eax
.LBB2_10:                               # %_Z12CustomArgMaxPfi.exit
                                        #   in Loop: Header=BB2_4 Depth=2
	movb	%al, 3(%rbp,%r14,4)
	incq	%r15
	cmpq	24(%rsp), %r15                  # 8-byte Folded Reload
	jne	.LBB2_4
.LBB2_6:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	movq	8(%rsp), %rcx                   # 8-byte Reload
	incq	%rcx
	movq	%rcx, %rax
	movq	%rcx, 8(%rsp)                   # 8-byte Spill
	cmpq	%r13, %rcx
	jne	.LBB2_2
.LBB2_7:                                # %._crit_edge20
	addq	$168, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z25CustomSpectralAngleMethodP15HIP_vector_typeIhLj4EEiii, .Lfunc_end2-_Z25CustomSpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z34__device_stub__SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii # -- Begin function _Z34__device_stub__SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.type	_Z34__device_stub__SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii,@function
_Z34__device_stub__SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii: # @_Z34__device_stub__SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.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	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	20(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	16(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	12(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%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	$_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	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_end3:
	.size	_Z34__device_stub__SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii, .Lfunc_end3-_Z34__device_stub__SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI4_0:
	.quad	0x408f400000000000              # double 1000
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	112(%rsp), %rcx
	movq	%rcx, -16(%rcx)
	xorl	%eax, %eax
	movq	%rax, -8(%rcx)
	movb	%al, (%rcx)
	leaq	80(%rsp), %rcx
	movq	%rcx, -16(%rcx)
	movq	%rax, -8(%rcx)
	movb	%al, (%rcx)
.Ltmp0:
	leaq	96(%rsp), %rsi
	movl	$_ZSt3cin, %edi
	callq	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE
.Ltmp1:
# %bb.1:
.Ltmp2:
	leaq	64(%rsp), %rsi
	movq	%rax, %rdi
	callq	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE
.Ltmp3:
# %bb.2:
.Ltmp4:
	movq	%rsp, %rsi
	movq	%rax, %rdi
	callq	_ZNSirsERi
.Ltmp5:
# %bb.3:
	movslq	(%rsp), %rsi
.Ltmp7:
	leaq	128(%rsp), %rdi
	leaq	8(%rsp), %rdx
	callq	_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EEC2EmRKS4_
.Ltmp8:
# %bb.4:
	cmpl	$0, (%rsp)
	jle	.LBB4_14
# %bb.5:                                # %.lr.ph189
	leaq	36(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	4(%rsp), %r14
	leaq	32(%rsp), %r15
.LBB4_6:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_9 Depth 2
.Ltmp10:
	movl	$_ZSt3cin, %edi
	movq	%r14, %rsi
	callq	_ZNSirsERi
.Ltmp11:
# %bb.7:                                # %.preheader185
                                        #   in Loop: Header=BB4_6 Depth=1
	cmpl	$0, 4(%rsp)
	jle	.LBB4_13
# %bb.8:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB4_6 Depth=1
	xorl	%ebp, %ebp
	leaq	(%r12,%r12,2), %r13
	shlq	$3, %r13
.LBB4_9:                                # %.lr.ph
                                        #   Parent Loop BB4_6 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
.Ltmp13:
	movl	$_ZSt3cin, %edi
	movq	%r15, %rsi
	callq	_ZNSirsERi
.Ltmp14:
# %bb.10:                               #   in Loop: Header=BB4_9 Depth=2
.Ltmp15:
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_ZNSirsERi
.Ltmp16:
# %bb.11:                               #   in Loop: Header=BB4_9 Depth=2
	movq	128(%rsp), %rdi
	addq	%r13, %rdi
.Ltmp17:
	movq	%r15, %rsi
	callq	_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12emplace_backIJRS1_EEES5_DpOT_
.Ltmp18:
# %bb.12:                               #   in Loop: Header=BB4_9 Depth=2
	incl	%ebp
	cmpl	4(%rsp), %ebp
	jl	.LBB4_9
.LBB4_13:                               # %._crit_edge
                                        #   in Loop: Header=BB4_6 Depth=1
	incq	%r12
	movslq	(%rsp), %rax
	cmpq	%rax, %r12
	jl	.LBB4_6
.LBB4_14:                               # %._crit_edge190
	movq	96(%rsp), %rdi
	movl	$.L.str, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB4_75
# %bb.15:
	movq	%rax, %r13
	leaq	52(%rsp), %rbx
	movl	$4, %esi
	movl	$1, %edx
	movq	%rbx, %rdi
	movq	%rax, %rcx
	callq	fread
	leaq	48(%rsp), %r14
	movl	$4, %esi
	movl	$1, %edx
	movq	%r14, %rdi
	movq	%r13, %rcx
	callq	fread
	movslq	(%rbx), %r15
	movslq	(%r14), %rbp
	movq	%rbp, 56(%rsp)                  # 8-byte Spill
	imulq	%r15, %rbp
	cmpl	$400000001, %ebp                # imm = 0x17D78401
	jge	.LBB4_76
# %bb.16:
	leaq	(,%rbp,4), %r14
	testl	%ebp, %ebp
	movq	$-1, %rdi
	cmovnsq	%r14, %rdi
.Ltmp20:
	callq	_Znam
.Ltmp21:
# %bb.17:
	movq	%rax, %rbx
	movl	$4, %esi
	movq	%rax, %rdi
	movq	%rbp, %rdx
	movq	%r13, %rcx
	callq	fread
	movq	%r13, %rdi
	callq	fclose
	movl	(%rsp), %eax
	testl	%eax, %eax
	jle	.LBB4_27
# %bb.18:                               # %.lr.ph199
	movq	128(%rsp), %rcx
	xorl	%edx, %edx
.LBB4_19:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_21 Depth 2
	leaq	(,%rdx,4), %rsi
	leaq	(%rsi,%rsi,2), %rsi
	addq	$avg, %rsi
	movq	$0, (%rsi)
	movl	$0, 8(%rsi)
	leaq	(%rdx,%rdx,2), %r8
	movq	8(%rcx,%r8,8), %rdi
	subq	(%rcx,%r8,8), %rdi
	shrq	$3, %rdi
	movl	%edi, 4(%rsp)
	testl	%edi, %edi
	jle	.LBB4_22
# %bb.20:                               # %.lr.ph193
                                        #   in Loop: Header=BB4_19 Depth=1
	leaq	(%rcx,%r8,8), %r8
	movl	%edi, %r9d
	xorps	%xmm0, %xmm0
	xorl	%r10d, %r10d
	xorps	%xmm1, %xmm1
	xorps	%xmm2, %xmm2
.LBB4_21:                               #   Parent Loop BB4_19 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	(%r8), %r11
	movl	(%r11,%r10,8), %r11d
	movl	%r11d, 32(%rsp)
	movq	(%r8), %r12
	movl	4(%r12,%r10,8), %ebp
	movl	%r15d, %r12d
	imull	%ebp, %r12d
	addl	%r11d, %r12d
	movslq	%r12d, %r11
	movzbl	(%rbx,%r11,4), %r12d
	xorps	%xmm3, %xmm3
	cvtsi2ss	%r12d, %xmm3
	addss	%xmm3, %xmm2
	movzbl	1(%rbx,%r11,4), %r12d
	xorps	%xmm3, %xmm3
	cvtsi2ss	%r12d, %xmm3
	movl	%ebp, 36(%rsp)
	movss	%xmm2, (%rsi)
	addss	%xmm3, %xmm1
	movss	%xmm1, 4(%rsi)
	movzbl	2(%rbx,%r11,4), %r11d
	xorps	%xmm3, %xmm3
	cvtsi2ss	%r11d, %xmm3
	addss	%xmm3, %xmm0
	movss	%xmm0, 8(%rsi)
	incq	%r10
	cmpq	%r10, %r9
	jne	.LBB4_21
	jmp	.LBB4_23
.LBB4_22:                               #   in Loop: Header=BB4_19 Depth=1
	xorps	%xmm0, %xmm0
	xorps	%xmm1, %xmm1
	xorps	%xmm2, %xmm2
.LBB4_23:                               # %._crit_edge194
                                        #   in Loop: Header=BB4_19 Depth=1
	xorps	%xmm3, %xmm3
	cvtsi2ss	%edi, %xmm3
	divss	%xmm3, %xmm2
	movss	%xmm2, (%rsi)
	divss	%xmm3, %xmm1
	movss	%xmm1, 4(%rsi)
	divss	%xmm3, %xmm0
	movss	%xmm0, 8(%rsi)
	incq	%rdx
	cmpq	%rax, %rdx
	jne	.LBB4_19
# %bb.24:                               # %.preheader
	testl	%eax, %eax
	jle	.LBB4_27
# %bb.25:                               # %.lr.ph201.preheader
	shlq	$2, %rax
	xorl	%ecx, %ecx
.LBB4_26:                               # %.lr.ph201
                                        # =>This Inner Loop Header: Depth=1
	movss	avg(%rcx,%rcx,2), %xmm0         # xmm0 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm0
	movss	avg+4(%rcx,%rcx,2), %xmm1       # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm1
	addss	%xmm0, %xmm1
	movss	avg+8(%rcx,%rcx,2), %xmm0       # xmm0 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm0
	addss	%xmm1, %xmm0
	sqrtss	%xmm0, %xmm0
	movss	%xmm0, normaAvg(%rcx)
	addq	$4, %rcx
	cmpq	%rcx, %rax
	jne	.LBB4_26
.LBB4_27:                               # %._crit_edge202
.Ltmp22:
	movl	$constAVG, %edi
	movl	$avg, %esi
	movl	$384, %edx                      # imm = 0x180
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
.Ltmp23:
# %bb.28:                               # %_Z17hipMemcpyToSymbolIA32_A3_fE10hipError_tRKT_PKvmm13hipMemcpyKind.exit
	testl	%eax, %eax
	jne	.LBB4_77
# %bb.29:
.Ltmp27:
	movl	$constNormaAVG, %edi
	movl	$normaAvg, %esi
	movl	$128, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
.Ltmp28:
# %bb.30:                               # %_Z17hipMemcpyToSymbolIA32_fE10hipError_tRKT_PKvmm13hipMemcpyKind.exit
	testl	%eax, %eax
	jne	.LBB4_79
# %bb.31:
.Ltmp32:
	leaq	8(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
.Ltmp33:
# %bb.32:                               # %_ZL9hipMallocI15HIP_vector_typeIhLj4EEE10hipError_tPPT_m.exit
	testl	%eax, %eax
	jne	.LBB4_81
# %bb.33:
	movq	8(%rsp), %rdi
.Ltmp37:
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp38:
# %bb.34:
	testl	%eax, %eax
	jne	.LBB4_83
# %bb.35:
	callq	_ZNSt6chrono3_V212steady_clock3nowEv
	movq	%rax, %r13
	movl	(%rsp), %ecx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	56(%rsp), %rdx                  # 8-byte Reload
                                        # kill: def $edx killed $edx killed $rdx
	callq	_Z25CustomSpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	callq	_ZNSt6chrono3_V212steady_clock3nowEv
	movq	%rax, %rbp
.Ltmp42:
	movl	$_ZSt4cout, %r12d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$3, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp43:
# %bb.36:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %r12
.Ltmp44:
	movq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp45:
# %bb.37:                               # %.noexc
.Ltmp46:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp47:
# %bb.38:                               # %.noexc173
.Ltmp48:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp49:
# %bb.39:                               # %_ZNSolsEPFRSoS_E.exit
.Ltmp50:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp51:
# %bb.40:
	subq	%r13, %rbp
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	movq	%rbp, %rax
	imulq	%rcx
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %rdx
	addq	%rax, %rdx
	cvtsi2sd	%rdx, %xmm0
	divsd	.LCPI4_0(%rip), %xmm0
.Ltmp53:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp54:
# %bb.41:                               # %_ZNSolsEd.exit
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
.Ltmp55:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp56:
# %bb.42:                               # %.noexc175
.Ltmp57:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp58:
# %bb.43:                               # %.noexc176
.Ltmp59:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp60:
# %bb.44:                               # %_ZNSolsEPFRSoS_E.exit163
.Ltmp62:
	leaq	24(%rsp), %rdi
	callq	hipEventCreate
.Ltmp63:
# %bb.45:
	testl	%eax, %eax
	jne	.LBB4_85
# %bb.46:
.Ltmp67:
	leaq	16(%rsp), %rdi
	callq	hipEventCreate
.Ltmp68:
# %bb.47:
	testl	%eax, %eax
	jne	.LBB4_87
# %bb.48:
	movq	24(%rsp), %rdi
.Ltmp72:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp73:
# %bb.49:
	testl	%eax, %eax
	jne	.LBB4_89
# %bb.50:
.Ltmp77:
	movabsq	$137438953504, %rdi             # imm = 0x2000000020
	movl	$1, %esi
	movq	%rdi, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp78:
# %bb.51:
	testl	%eax, %eax
	jne	.LBB4_53
# %bb.52:
	movq	8(%rsp), %rdi
	movl	(%rsp), %ecx
.Ltmp79:
	movl	%r15d, %esi
	movq	56(%rsp), %rdx                  # 8-byte Reload
                                        # kill: def $edx killed $edx killed $rdx
	callq	_Z34__device_stub__SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
.Ltmp80:
.LBB4_53:
.Ltmp82:
	callq	hipGetLastError
.Ltmp83:
# %bb.54:
	testl	%eax, %eax
	jne	.LBB4_91
# %bb.55:
	movq	16(%rsp), %rdi
.Ltmp87:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp88:
# %bb.56:
	testl	%eax, %eax
	jne	.LBB4_93
# %bb.57:
	movq	16(%rsp), %rdi
.Ltmp92:
	callq	hipEventSynchronize
.Ltmp93:
# %bb.58:
	testl	%eax, %eax
	jne	.LBB4_95
# %bb.59:
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
.Ltmp97:
	leaq	44(%rsp), %rdi
	callq	hipEventElapsedTime
.Ltmp98:
# %bb.60:
	testl	%eax, %eax
	jne	.LBB4_97
# %bb.61:
	movq	24(%rsp), %rdi
.Ltmp102:
	callq	hipEventDestroy
.Ltmp103:
# %bb.62:
	testl	%eax, %eax
	jne	.LBB4_99
# %bb.63:
	movq	16(%rsp), %rdi
.Ltmp107:
	callq	hipEventDestroy
.Ltmp108:
# %bb.64:
	testl	%eax, %eax
	jne	.LBB4_101
# %bb.65:
	movl	$.Lstr, %edi
	callq	puts@PLT
	cvtss2sd	44(%rsp), %xmm0
	movl	$.L.str.8, %edi
	movb	$1, %al
	callq	printf
	movl	$.L.str.9, %edi
	movl	$32, %esi
	movl	$32, %edx
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.10, %edi
	movl	$32, %esi
	movl	$32, %edx
	xorl	%eax, %eax
	callq	printf
	movq	8(%rsp), %rsi
.Ltmp112:
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp113:
# %bb.66:
	testl	%eax, %eax
	jne	.LBB4_103
# %bb.67:
	movq	64(%rsp), %rdi
	movl	$.L.str.11, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB4_105
# %bb.68:
	movq	%rax, %r14
	leaq	52(%rsp), %r15
	movl	$4, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	movq	%rax, %rcx
	callq	fwrite
	leaq	48(%rsp), %r12
	movl	$4, %esi
	movl	$1, %edx
	movq	%r12, %rdi
	movq	%r14, %rcx
	callq	fwrite
	movslq	(%r15), %rax
	movslq	(%r12), %rdx
	imulq	%rax, %rdx
	movl	$4, %esi
	movq	%rbx, %rdi
	movq	%r14, %rcx
	callq	fwrite
	movq	%r14, %rdi
	callq	fclose
	movq	8(%rsp), %rdi
.Ltmp117:
	callq	hipFree
.Ltmp118:
# %bb.69:
	testl	%eax, %eax
	jne	.LBB4_106
# %bb.70:
	movq	%rbx, %rdi
	callq	_ZdaPv
	leaq	128(%rsp), %rdi
	callq	_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EED2Ev
	movq	64(%rsp), %rdi
	leaq	80(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB4_72
# %bb.71:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB4_72:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movq	96(%rsp), %rdi
	leaq	112(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB4_74
# %bb.73:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i164
	callq	_ZdlPv
.LBB4_74:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit166
	xorl	%eax, %eax
	addq	$152, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB4_75:
	.cfi_def_cfa_offset 208
.Ltmp127:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.1, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp128:
	jmp	.LBB4_109
.LBB4_76:
.Ltmp125:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.2, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp126:
	jmp	.LBB4_109
.LBB4_77:
	movq	stderr(%rip), %rbx
.Ltmp24:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp25:
# %bb.78:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$249, %ecx
	jmp	.LBB4_108
.LBB4_79:
	movq	stderr(%rip), %rbx
.Ltmp29:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp30:
# %bb.80:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$250, %ecx
	jmp	.LBB4_108
.LBB4_81:
	movq	stderr(%rip), %rbx
.Ltmp34:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp35:
# %bb.82:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$253, %ecx
	jmp	.LBB4_108
.LBB4_83:
	movq	stderr(%rip), %rbx
.Ltmp39:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp40:
# %bb.84:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$254, %ecx
	jmp	.LBB4_108
.LBB4_85:
	movq	stderr(%rip), %rbx
.Ltmp64:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp65:
# %bb.86:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$279, %ecx                      # imm = 0x117
	jmp	.LBB4_108
.LBB4_87:
	movq	stderr(%rip), %rbx
.Ltmp69:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp70:
# %bb.88:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$280, %ecx                      # imm = 0x118
	jmp	.LBB4_108
.LBB4_89:
	movq	stderr(%rip), %rbx
.Ltmp74:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp75:
# %bb.90:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$281, %ecx                      # imm = 0x119
	jmp	.LBB4_108
.LBB4_91:
	movq	stderr(%rip), %rbx
.Ltmp84:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp85:
# %bb.92:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$286, %ecx                      # imm = 0x11E
	jmp	.LBB4_108
.LBB4_93:
	movq	stderr(%rip), %rbx
.Ltmp89:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp90:
# %bb.94:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$290, %ecx                      # imm = 0x122
	jmp	.LBB4_108
.LBB4_95:
	movq	stderr(%rip), %rbx
.Ltmp94:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp95:
# %bb.96:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$291, %ecx                      # imm = 0x123
	jmp	.LBB4_108
.LBB4_97:
	movq	stderr(%rip), %rbx
.Ltmp99:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp100:
# %bb.98:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$293, %ecx                      # imm = 0x125
	jmp	.LBB4_108
.LBB4_99:
	movq	stderr(%rip), %rbx
.Ltmp104:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp105:
# %bb.100:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$294, %ecx                      # imm = 0x126
	jmp	.LBB4_108
.LBB4_101:
	movq	stderr(%rip), %rbx
.Ltmp109:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp110:
# %bb.102:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$295, %ecx                      # imm = 0x127
	jmp	.LBB4_108
.LBB4_103:
	movq	stderr(%rip), %rbx
.Ltmp114:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp115:
# %bb.104:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$303, %ecx                      # imm = 0x12F
	jmp	.LBB4_108
.LBB4_105:
.Ltmp122:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.12, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp123:
	jmp	.LBB4_109
.LBB4_106:
	movq	stderr(%rip), %rbx
.Ltmp119:
	movl	%eax, %edi
	callq	hipGetErrorString
.Ltmp120:
# %bb.107:
	movl	$.L.str.3, %esi
	movl	$.L.str.4, %edx
	movq	%rbx, %rdi
	movl	$320, %ecx                      # imm = 0x140
.LBB4_108:
	movq	%rax, %r8
	xorl	%eax, %eax
	callq	fprintf
.LBB4_109:
	xorl	%edi, %edi
	callq	exit
.LBB4_110:
.Ltmp124:
	jmp	.LBB4_135
.LBB4_111:
.Ltmp9:
	jmp	.LBB4_130
.LBB4_112:
.Ltmp81:
	jmp	.LBB4_135
.LBB4_113:
.Ltmp121:
	jmp	.LBB4_135
.LBB4_114:
.Ltmp116:
	jmp	.LBB4_135
.LBB4_115:
.Ltmp111:
	jmp	.LBB4_135
.LBB4_116:
.Ltmp106:
	jmp	.LBB4_135
.LBB4_117:
.Ltmp101:
	jmp	.LBB4_135
.LBB4_118:
.Ltmp96:
	jmp	.LBB4_135
.LBB4_119:
.Ltmp91:
	jmp	.LBB4_135
.LBB4_120:
.Ltmp86:
	jmp	.LBB4_135
.LBB4_121:
.Ltmp76:
	jmp	.LBB4_135
.LBB4_122:
.Ltmp71:
	jmp	.LBB4_135
.LBB4_123:
.Ltmp66:
	jmp	.LBB4_135
.LBB4_124:
.Ltmp41:
	jmp	.LBB4_135
.LBB4_125:
.Ltmp36:
	jmp	.LBB4_135
.LBB4_126:
.Ltmp31:
	jmp	.LBB4_135
.LBB4_127:
.Ltmp26:
	jmp	.LBB4_135
.LBB4_128:
.Ltmp129:
	jmp	.LBB4_135
.LBB4_129:
.Ltmp6:
.LBB4_130:
	movq	%rax, %rbx
	jmp	.LBB4_136
.LBB4_131:
.Ltmp61:
	jmp	.LBB4_135
.LBB4_132:
.Ltmp52:
	jmp	.LBB4_135
.LBB4_133:
.Ltmp12:
	jmp	.LBB4_135
.LBB4_134:
.Ltmp19:
.LBB4_135:
	movq	%rax, %rbx
	leaq	128(%rsp), %rdi
	callq	_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EED2Ev
.LBB4_136:
	leaq	80(%rsp), %rax
	movq	64(%rsp), %rdi
	cmpq	%rax, %rdi
	je	.LBB4_138
# %bb.137:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i167
	callq	_ZdlPv
.LBB4_138:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit169
	movq	96(%rsp), %rdi
	leaq	112(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB4_140
# %bb.139:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i170
	callq	_ZdlPv
.LBB4_140:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit172
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end4:
	.size	main, .Lfunc_end4-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table4:
.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 .Ltmp0-.Lfunc_begin0           # >> Call Site 1 <<
	.uleb128 .Ltmp5-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp5
	.uleb128 .Ltmp6-.Lfunc_begin0           #     jumps to .Ltmp6
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp7-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp8-.Ltmp7                  #   Call between .Ltmp7 and .Ltmp8
	.uleb128 .Ltmp9-.Lfunc_begin0           #     jumps to .Ltmp9
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp10-.Lfunc_begin0          # >> Call Site 3 <<
	.uleb128 .Ltmp11-.Ltmp10                #   Call between .Ltmp10 and .Ltmp11
	.uleb128 .Ltmp12-.Lfunc_begin0          #     jumps to .Ltmp12
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp13-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp18-.Ltmp13                #   Call between .Ltmp13 and .Ltmp18
	.uleb128 .Ltmp19-.Lfunc_begin0          #     jumps to .Ltmp19
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp20-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp21-.Ltmp20                #   Call between .Ltmp20 and .Ltmp21
	.uleb128 .Ltmp129-.Lfunc_begin0         #     jumps to .Ltmp129
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp22-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp23-.Ltmp22                #   Call between .Ltmp22 and .Ltmp23
	.uleb128 .Ltmp26-.Lfunc_begin0          #     jumps to .Ltmp26
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp27-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp28-.Ltmp27                #   Call between .Ltmp27 and .Ltmp28
	.uleb128 .Ltmp31-.Lfunc_begin0          #     jumps to .Ltmp31
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp32-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp33-.Ltmp32                #   Call between .Ltmp32 and .Ltmp33
	.uleb128 .Ltmp36-.Lfunc_begin0          #     jumps to .Ltmp36
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp37-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp38-.Ltmp37                #   Call between .Ltmp37 and .Ltmp38
	.uleb128 .Ltmp41-.Lfunc_begin0          #     jumps to .Ltmp41
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp42-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp51-.Ltmp42                #   Call between .Ltmp42 and .Ltmp51
	.uleb128 .Ltmp52-.Lfunc_begin0          #     jumps to .Ltmp52
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp53-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Ltmp60-.Ltmp53                #   Call between .Ltmp53 and .Ltmp60
	.uleb128 .Ltmp61-.Lfunc_begin0          #     jumps to .Ltmp61
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp62-.Lfunc_begin0          # >> Call Site 12 <<
	.uleb128 .Ltmp63-.Ltmp62                #   Call between .Ltmp62 and .Ltmp63
	.uleb128 .Ltmp66-.Lfunc_begin0          #     jumps to .Ltmp66
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp67-.Lfunc_begin0          # >> Call Site 13 <<
	.uleb128 .Ltmp68-.Ltmp67                #   Call between .Ltmp67 and .Ltmp68
	.uleb128 .Ltmp71-.Lfunc_begin0          #     jumps to .Ltmp71
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp72-.Lfunc_begin0          # >> Call Site 14 <<
	.uleb128 .Ltmp73-.Ltmp72                #   Call between .Ltmp72 and .Ltmp73
	.uleb128 .Ltmp76-.Lfunc_begin0          #     jumps to .Ltmp76
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp77-.Lfunc_begin0          # >> Call Site 15 <<
	.uleb128 .Ltmp80-.Ltmp77                #   Call between .Ltmp77 and .Ltmp80
	.uleb128 .Ltmp81-.Lfunc_begin0          #     jumps to .Ltmp81
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp82-.Lfunc_begin0          # >> Call Site 16 <<
	.uleb128 .Ltmp83-.Ltmp82                #   Call between .Ltmp82 and .Ltmp83
	.uleb128 .Ltmp86-.Lfunc_begin0          #     jumps to .Ltmp86
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp87-.Lfunc_begin0          # >> Call Site 17 <<
	.uleb128 .Ltmp88-.Ltmp87                #   Call between .Ltmp87 and .Ltmp88
	.uleb128 .Ltmp91-.Lfunc_begin0          #     jumps to .Ltmp91
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp92-.Lfunc_begin0          # >> Call Site 18 <<
	.uleb128 .Ltmp93-.Ltmp92                #   Call between .Ltmp92 and .Ltmp93
	.uleb128 .Ltmp96-.Lfunc_begin0          #     jumps to .Ltmp96
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp97-.Lfunc_begin0          # >> Call Site 19 <<
	.uleb128 .Ltmp98-.Ltmp97                #   Call between .Ltmp97 and .Ltmp98
	.uleb128 .Ltmp101-.Lfunc_begin0         #     jumps to .Ltmp101
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp102-.Lfunc_begin0         # >> Call Site 20 <<
	.uleb128 .Ltmp103-.Ltmp102              #   Call between .Ltmp102 and .Ltmp103
	.uleb128 .Ltmp106-.Lfunc_begin0         #     jumps to .Ltmp106
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp107-.Lfunc_begin0         # >> Call Site 21 <<
	.uleb128 .Ltmp108-.Ltmp107              #   Call between .Ltmp107 and .Ltmp108
	.uleb128 .Ltmp111-.Lfunc_begin0         #     jumps to .Ltmp111
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp112-.Lfunc_begin0         # >> Call Site 22 <<
	.uleb128 .Ltmp113-.Ltmp112              #   Call between .Ltmp112 and .Ltmp113
	.uleb128 .Ltmp116-.Lfunc_begin0         #     jumps to .Ltmp116
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp117-.Lfunc_begin0         # >> Call Site 23 <<
	.uleb128 .Ltmp118-.Ltmp117              #   Call between .Ltmp117 and .Ltmp118
	.uleb128 .Ltmp121-.Lfunc_begin0         #     jumps to .Ltmp121
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp127-.Lfunc_begin0         # >> Call Site 24 <<
	.uleb128 .Ltmp126-.Ltmp127              #   Call between .Ltmp127 and .Ltmp126
	.uleb128 .Ltmp129-.Lfunc_begin0         #     jumps to .Ltmp129
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp24-.Lfunc_begin0          # >> Call Site 25 <<
	.uleb128 .Ltmp25-.Ltmp24                #   Call between .Ltmp24 and .Ltmp25
	.uleb128 .Ltmp26-.Lfunc_begin0          #     jumps to .Ltmp26
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp29-.Lfunc_begin0          # >> Call Site 26 <<
	.uleb128 .Ltmp30-.Ltmp29                #   Call between .Ltmp29 and .Ltmp30
	.uleb128 .Ltmp31-.Lfunc_begin0          #     jumps to .Ltmp31
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp34-.Lfunc_begin0          # >> Call Site 27 <<
	.uleb128 .Ltmp35-.Ltmp34                #   Call between .Ltmp34 and .Ltmp35
	.uleb128 .Ltmp36-.Lfunc_begin0          #     jumps to .Ltmp36
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp39-.Lfunc_begin0          # >> Call Site 28 <<
	.uleb128 .Ltmp40-.Ltmp39                #   Call between .Ltmp39 and .Ltmp40
	.uleb128 .Ltmp41-.Lfunc_begin0          #     jumps to .Ltmp41
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp64-.Lfunc_begin0          # >> Call Site 29 <<
	.uleb128 .Ltmp65-.Ltmp64                #   Call between .Ltmp64 and .Ltmp65
	.uleb128 .Ltmp66-.Lfunc_begin0          #     jumps to .Ltmp66
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp69-.Lfunc_begin0          # >> Call Site 30 <<
	.uleb128 .Ltmp70-.Ltmp69                #   Call between .Ltmp69 and .Ltmp70
	.uleb128 .Ltmp71-.Lfunc_begin0          #     jumps to .Ltmp71
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp74-.Lfunc_begin0          # >> Call Site 31 <<
	.uleb128 .Ltmp75-.Ltmp74                #   Call between .Ltmp74 and .Ltmp75
	.uleb128 .Ltmp76-.Lfunc_begin0          #     jumps to .Ltmp76
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp84-.Lfunc_begin0          # >> Call Site 32 <<
	.uleb128 .Ltmp85-.Ltmp84                #   Call between .Ltmp84 and .Ltmp85
	.uleb128 .Ltmp86-.Lfunc_begin0          #     jumps to .Ltmp86
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp89-.Lfunc_begin0          # >> Call Site 33 <<
	.uleb128 .Ltmp90-.Ltmp89                #   Call between .Ltmp89 and .Ltmp90
	.uleb128 .Ltmp91-.Lfunc_begin0          #     jumps to .Ltmp91
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp94-.Lfunc_begin0          # >> Call Site 34 <<
	.uleb128 .Ltmp95-.Ltmp94                #   Call between .Ltmp94 and .Ltmp95
	.uleb128 .Ltmp96-.Lfunc_begin0          #     jumps to .Ltmp96
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp99-.Lfunc_begin0          # >> Call Site 35 <<
	.uleb128 .Ltmp100-.Ltmp99               #   Call between .Ltmp99 and .Ltmp100
	.uleb128 .Ltmp101-.Lfunc_begin0         #     jumps to .Ltmp101
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp104-.Lfunc_begin0         # >> Call Site 36 <<
	.uleb128 .Ltmp105-.Ltmp104              #   Call between .Ltmp104 and .Ltmp105
	.uleb128 .Ltmp106-.Lfunc_begin0         #     jumps to .Ltmp106
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp109-.Lfunc_begin0         # >> Call Site 37 <<
	.uleb128 .Ltmp110-.Ltmp109              #   Call between .Ltmp109 and .Ltmp110
	.uleb128 .Ltmp111-.Lfunc_begin0         #     jumps to .Ltmp111
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp114-.Lfunc_begin0         # >> Call Site 38 <<
	.uleb128 .Ltmp115-.Ltmp114              #   Call between .Ltmp114 and .Ltmp115
	.uleb128 .Ltmp116-.Lfunc_begin0         #     jumps to .Ltmp116
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp122-.Lfunc_begin0         # >> Call Site 39 <<
	.uleb128 .Ltmp123-.Ltmp122              #   Call between .Ltmp122 and .Ltmp123
	.uleb128 .Ltmp124-.Lfunc_begin0         #     jumps to .Ltmp124
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp119-.Lfunc_begin0         # >> Call Site 40 <<
	.uleb128 .Ltmp120-.Ltmp119              #   Call between .Ltmp119 and .Ltmp120
	.uleb128 .Ltmp121-.Lfunc_begin0         #     jumps to .Ltmp121
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp120-.Lfunc_begin0         # >> Call Site 41 <<
	.uleb128 .Lfunc_end4-.Ltmp120           #   Call between .Ltmp120 and .Lfunc_end4
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EEC2EmRKS4_,"axG",@progbits,_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EEC2EmRKS4_,comdat
	.weak	_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EEC2EmRKS4_ # -- Begin function _ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EEC2EmRKS4_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EEC2EmRKS4_,@function
_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EEC2EmRKS4_: # @_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EEC2EmRKS4_
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movabsq	$384307168202282326, %rax       # imm = 0x555555555555556
	cmpq	%rax, %rsi
	jae	.LBB5_5
# %bb.1:                                # %_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EE17_S_check_init_lenEmRKS4_.exit
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	testq	%rsi, %rsi
	je	.LBB5_2
# %bb.3:                                # %.lr.ph.preheader.i.i.i.i
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EEE8allocateEmPKv
	movq	%rax, (%rbx)
	shlq	$3, %r14
	leaq	(%r14,%r14,2), %rdx
	leaq	(%rax,%rdx), %r14
	movq	%r14, 16(%rbx)
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	jmp	.LBB5_4
.LBB5_2:                                # %_ZNSt12_Vector_baseISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EESaIS4_EEC2EmRKS5_.exit.thread
	movups	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
	xorl	%r14d, %r14d
.LBB5_4:
	movq	%r14, 8(%rbx)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB5_5:
	.cfi_def_cfa_offset 32
	movl	$.L.str.13, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end5:
	.size	_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EEC2EmRKS4_, .Lfunc_end5-_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EEC2EmRKS4_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12emplace_backIJRS1_EEES5_DpOT_,"axG",@progbits,_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12emplace_backIJRS1_EEES5_DpOT_,comdat
	.weak	_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12emplace_backIJRS1_EEES5_DpOT_ # -- Begin function _ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12emplace_backIJRS1_EEES5_DpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12emplace_backIJRS1_EEES5_DpOT_,@function
_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12emplace_backIJRS1_EEES5_DpOT_: # @_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12emplace_backIJRS1_EEES5_DpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rsi, %rdx
	movq	%rdi, %rbx
	movq	8(%rdi), %rsi
	cmpq	16(%rdi), %rsi
	je	.LBB6_2
# %bb.1:
	movq	(%rdx), %rax
	movq	%rax, (%rsi)
	movq	8(%rbx), %rax
	addq	$8, %rax
	movq	%rax, 8(%rbx)
	jmp	.LBB6_3
.LBB6_2:
	movq	%rbx, %rdi
	callq	_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE17_M_realloc_insertIJRS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_
	movq	8(%rbx), %rax
.LBB6_3:
	addq	$-8, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12emplace_backIJRS1_EEES5_DpOT_, .Lfunc_end6-_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12emplace_backIJRS1_EEES5_DpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EED2Ev,"axG",@progbits,_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EED2Ev,comdat
	.weak	_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EED2Ev # -- Begin function _ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EED2Ev
	.p2align	1, 0x90
	.type	_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EED2Ev,@function
_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EED2Ev: # @_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EED2Ev
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	(%rdi), %rbx
	movq	8(%rdi), %r15
	cmpq	%r15, %rbx
	je	.LBB7_6
# %bb.1:                                # %.lr.ph.i.i.i.preheader
	movq	%rdi, %r14
.LBB7_2:                                # %.lr.ph.i.i.i
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.LBB7_4
# %bb.3:                                #   in Loop: Header=BB7_2 Depth=1
	callq	_ZdlPv
.LBB7_4:                                # %_ZSt8_DestroyISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EEEvPT_.exit.i.i.i
                                        #   in Loop: Header=BB7_2 Depth=1
	addq	$24, %rbx
	cmpq	%r15, %rbx
	jne	.LBB7_2
# %bb.5:                                # %_ZSt8_DestroyIPSt6vectorI15HIP_vector_typeIiLj2EESaIS2_EES4_EvT_S6_RSaIT0_E.exitthread-pre-split
	movq	(%r14), %rbx
.LBB7_6:                                # %_ZSt8_DestroyIPSt6vectorI15HIP_vector_typeIiLj2EESaIS2_EES4_EvT_S6_RSaIT0_E.exit
	testq	%rbx, %rbx
	je	.LBB7_7
# %bb.8:
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZdlPv                          # TAILCALL
.LBB7_7:                                # %_ZNSt12_Vector_baseISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EESaIS4_EED2Ev.exit
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EED2Ev, .Lfunc_end7-_ZNSt6vectorIS_I15HIP_vector_typeIiLj2EESaIS1_EESaIS3_EED2Ev
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EEE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EEE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EEE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EEE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EEE8allocateEmPKv,@function
_ZNSt15__new_allocatorISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EEE8allocateEmPKv: # @_ZNSt15__new_allocatorISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EEE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movabsq	$384307168202282326, %rax       # imm = 0x555555555555556
	cmpq	%rax, %rsi
	jae	.LBB8_1
# %bb.3:
	shlq	$3, %rsi
	leaq	(%rsi,%rsi,2), %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB8_1:
	.cfi_def_cfa_offset 16
	movabsq	$768614336404564651, %rax       # imm = 0xAAAAAAAAAAAAAAB
	cmpq	%rax, %rsi
	jb	.LBB8_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB8_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end8:
	.size	_ZNSt15__new_allocatorISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EEE8allocateEmPKv, .Lfunc_end8-_ZNSt15__new_allocatorISt6vectorI15HIP_vector_typeIiLj2EESaIS2_EEE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE17_M_realloc_insertIJRS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_,"axG",@progbits,_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE17_M_realloc_insertIJRS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_,comdat
	.weak	_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE17_M_realloc_insertIJRS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_ # -- Begin function _ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE17_M_realloc_insertIJRS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE17_M_realloc_insertIJRS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_,@function
_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE17_M_realloc_insertIJRS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_: # @_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE17_M_realloc_insertIJRS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, 8(%rsp)                   # 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	$1, %esi
	movl	$.L.str.14, %edx
	callq	_ZNKSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12_M_check_lenEmPKc
	movq	(%rbx), %r12
	movq	8(%rbx), %r14
	movq	%r15, %rbp
	subq	%r12, %rbp
	sarq	$3, %rbp
	testq	%rax, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	je	.LBB9_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorI15HIP_vector_typeIiLj2EEE8allocateEmPKv
	movq	%rax, %r13
	jmp	.LBB9_3
.LBB9_1:
	xorl	%r13d, %r13d
.LBB9_3:                                # %_ZNSt12_Vector_baseI15HIP_vector_typeIiLj2EESaIS1_EE11_M_allocateEm.exit
	movq	8(%rsp), %rax                   # 8-byte Reload
	movq	(%rax), %rax
	movq	%rax, (%r13,%rbp,8)
	movq	%r13, %rbp
	cmpq	%r15, %r12
	je	.LBB9_6
# %bb.4:                                # %.lr.ph.i.i.i.preheader
	movq	%r13, %rbp
	movq	%r12, %rax
.LBB9_5:                                # %.lr.ph.i.i.i
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rax), %rcx
	movq	%rcx, (%rbp)
	addq	$8, %rax
	addq	$8, %rbp
	cmpq	%r15, %rax
	jne	.LBB9_5
.LBB9_6:                                # %_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE11_S_relocateEPS1_S4_S4_RS2_.exit
	addq	$8, %rbp
	cmpq	%r15, %r14
	je	.LBB9_8
.LBB9_7:                                # %.lr.ph.i.i.i17
                                        # =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	%rax, (%rbp)
	addq	$8, %r15
	addq	$8, %rbp
	cmpq	%r14, %r15
	jne	.LBB9_7
.LBB9_8:                                # %_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE11_S_relocateEPS1_S4_S4_RS2_.exit22
	testq	%r12, %r12
	je	.LBB9_10
# %bb.9:
	movq	%r12, %rdi
	callq	_ZdlPv
.LBB9_10:                               # %_ZNSt12_Vector_baseI15HIP_vector_typeIiLj2EESaIS1_EE13_M_deallocateEPS1_m.exit
	movq	%r13, (%rbx)
	movq	%rbp, 8(%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(,%rax,8), %rax
	addq	%r13, %rax
	movq	%rax, 16(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE17_M_realloc_insertIJRS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_, .Lfunc_end9-_ZNSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE17_M_realloc_insertIJRS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12_M_check_lenEmPKc,@function
_ZNKSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12_M_check_lenEmPKc: # @_ZNKSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$1152921504606846975, %rcx      # imm = 0xFFFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$3, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB10_2
# %bb.1:
	cmpq	%rsi, %r8
	cmovaq	%r8, %rsi
	leaq	(%rsi,%r8), %rax
	cmpq	%rcx, %rax
	cmovaeq	%rcx, %rax
	addq	%r8, %rsi
	cmovbq	%rcx, %rax
	retq
.LBB10_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end10:
	.size	_ZNKSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12_M_check_lenEmPKc, .Lfunc_end10-_ZNKSt6vectorI15HIP_vector_typeIiLj2EESaIS1_EE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorI15HIP_vector_typeIiLj2EEE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorI15HIP_vector_typeIiLj2EEE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorI15HIP_vector_typeIiLj2EEE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorI15HIP_vector_typeIiLj2EEE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorI15HIP_vector_typeIiLj2EEE8allocateEmPKv,@function
_ZNSt15__new_allocatorI15HIP_vector_typeIiLj2EEE8allocateEmPKv: # @_ZNSt15__new_allocatorI15HIP_vector_typeIiLj2EEE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB11_1
# %bb.3:
	shlq	$3, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB11_1:
	.cfi_def_cfa_offset 16
	shrq	$61, %rsi
	je	.LBB11_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB11_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end11:
	.size	_ZNSt15__new_allocatorI15HIP_vector_typeIiLj2EEE8allocateEmPKv, .Lfunc_end11-_ZNSt15__new_allocatorI15HIP_vector_typeIiLj2EEE8allocateEmPKv
	.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:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB12_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB12_2:
	subq	$32, %rsp
	.cfi_adjust_cfa_offset 32
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movl	$constAVG, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movl	$384, %r9d                      # imm = 0x180
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$constNormaAVG, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movl	$128, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$__hip_module_dtor, %edi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end12:
	.size	__hip_module_ctor, .Lfunc_end12-__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	.LBB13_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
.LBB13_2:
	retq
.Lfunc_end13:
	.size	__hip_module_dtor, .Lfunc_end13-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	normaAvg,@object                # @normaAvg
	.bss
	.globl	normaAvg
	.p2align	4, 0x0
normaAvg:
	.zero	128
	.size	normaAvg, 128

	.type	avg,@object                     # @avg
	.globl	avg
	.p2align	4, 0x0
avg:
	.zero	384
	.size	avg, 384

	.type	constAVG,@object                # @constAVG
	.local	constAVG
	.comm	constAVG,384,16
	.type	constNormaAVG,@object           # @constNormaAVG
	.local	constNormaAVG
	.comm	constNormaAVG,128,16
	.type	_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii,@object # @_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.section	.rodata,"a",@progbits
	.globl	_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.p2align	3, 0x0
_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii:
	.quad	_Z34__device_stub__SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.size	_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"rb"
	.size	.L.str, 3

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"ERROR: something wrong with opening the file!\n"
	.size	.L.str.1, 47

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"ERROR: incorrect input.\n"
	.size	.L.str.2, 25

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"ERROR in %s:%d. Message: %s\n"
	.size	.L.str.3, 29

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/lveltman/PGP/master/lab3/time3.hip"
	.size	.L.str.4, 97

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"CPU"
	.size	.L.str.5, 4

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"time = "
	.size	.L.str.6, 8

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"time = %f\n"
	.size	.L.str.8, 11

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"blocks = (%d, %d)\n"
	.size	.L.str.9, 19

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"threads = (%d, %d)\n"
	.size	.L.str.10, 20

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"wb"
	.size	.L.str.11, 3

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"ERROR: something wrong with opening the file."
	.size	.L.str.12, 46

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"cannot create std::vector larger than max_size()"
	.size	.L.str.13, 49

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"vector::_M_realloc_insert"
	.size	.L.str.14, 26

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii"
	.size	.L__unnamed_1, 52

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"constAVG"
	.size	.L__unnamed_2, 9

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

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

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

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

	.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 _Z34__device_stub__SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym normaAvg
	.addrsig_sym avg
	.addrsig_sym constAVG
	.addrsig_sym constNormaAVG
	.addrsig_sym _Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.addrsig_sym _ZSt3cin
	.addrsig_sym _ZSt4cerr
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii ; -- Begin function _Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.globl	_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
	.p2align	8
	.type	_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii,@function
_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii: ; @_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
; %bb.0:
	s_clause 0x1
	s_load_b32 s10, s[0:1], 0x24
	s_load_b128 s[4:7], s[0:1], 0x8
	v_and_b32_e32 v3, 0x3ff, v0
	s_add_u32 s2, s0, 24
	s_addc_u32 s3, s1, 0
	s_mov_b32 s8, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s7, s10, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s14, s7, v[3:4]
	v_cmpx_gt_i32_e64 s4, v1
	s_cbranch_execz .LBB0_15
; %bb.1:                                ; %.preheader.lr.ph
	s_load_b64 s[12:13], s[2:3], 0x0
	s_load_b64 s[8:9], s[0:1], 0x0
	v_bfe_u32 v0, v0, 10, 10
	s_lshr_b32 s1, s10, 16
	s_cmp_gt_i32 s6, 0
	s_mov_b32 s11, 0
	s_cselect_b32 s3, -1, 0
	v_mad_u64_u32 v[2:3], null, s15, s1, v[0:1]
	s_mov_b32 s15, 0
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_gt_i32_e64 s0, s5, v2
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s7, s12, s7
	s_mul_i32 s14, s13, s1
.LBB0_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;       Child Loop BB0_6 Depth 3
                                        ;         Child Loop BB0_7 Depth 4
                                        ;       Child Loop BB0_10 Depth 3
	s_delay_alu instid0(VALU_DEP_1)
	s_and_saveexec_b32 s16, s0
	s_cbranch_execz .LBB0_13
; %bb.3:                                ; %.lr.ph.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_mov_b32_e32 v0, v2
	s_mov_b32 s17, 0
.LBB0_4:                                ; %.lr.ph
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_6 Depth 3
                                        ;         Child Loop BB0_7 Depth 4
                                        ;       Child Loop BB0_10 Depth 3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[3:4], null, v0, s4, v[1:2]
	v_ashrrev_i32_e32 v4, 31, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[3:4], 2, v[3:4]
	v_add_co_u32 v3, vcc_lo, s8, v3
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v4, vcc_lo, s9, v4, vcc_lo
	s_and_not1_b32 vcc_lo, exec_lo, s3
	s_cbranch_vccnz .LBB0_11
; %bb.5:                                ; %.lr.ph.i
                                        ;   in Loop: Header=BB0_4 Depth=2
	global_load_b32 v8, v[3:4], off
	s_mov_b32 s10, 0
	s_waitcnt vmcnt(0)
	v_and_b32_e32 v5, 0xff, v8
	v_perm_b32 v6, v8, v8, 0xc0c0201
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_u32_u24_e32 v5, v5, v5
	v_dot4_u32_u8 v5, v6, v6, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_f32_i32_e32 v5, v5
	v_mul_f32_e32 v6, 0x4f800000, v5
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v7, v5, v6, vcc_lo
	v_sqrt_f32_e32 v5, v7
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v6, -1, v5
	v_add_nc_u32_e32 v9, 1, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v10, -v6, v5, v7
	v_fma_f32 v11, -v9, v5, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s1, 0, v10
	v_cndmask_b32_e64 v5, v5, v6, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e64 s1, 0, v11
	v_cndmask_b32_e64 v5, v5, v9, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v6, 0x37800000, v5
	v_cndmask_b32_e32 v9, v5, v6, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v7, 0x260
	v_cvt_f32_ubyte0_e32 v5, v8
	v_cvt_f32_ubyte1_e32 v6, v8
	v_cvt_f32_ubyte2_e32 v8, v8
	v_cndmask_b32_e32 v7, v9, v7, vcc_lo
.LBB0_6:                                ; %.preheader.preheader.i
                                        ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_4 Depth=2
                                        ; =>    This Loop Header: Depth=3
                                        ;         Child Loop BB0_7 Depth 4
	s_mul_i32 s1, s10, 12
	s_getpc_b64 s[12:13]
	s_add_u32 s12, s12, constAVG@rel32@lo+4
	s_addc_u32 s13, s13, constAVG@rel32@hi+12
	s_mul_hi_u32 s2, s10, 12
	s_add_u32 s12, s1, s12
	s_addc_u32 s13, s2, s13
	s_getpc_b64 s[18:19]
	s_add_u32 s18, s18, constNormaAVG@rel32@lo+4
	s_addc_u32 s19, s19, constNormaAVG@rel32@hi+12
	s_lshl_b64 s[20:21], s[10:11], 2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s18, s20, s18
	s_addc_u32 s19, s21, s19
	s_load_b64 s[20:21], s[12:13], 0x0
	s_load_b32 s1, s[18:19], 0x0
	s_load_b32 s2, s[12:13], 0x8
	s_mov_b64 s[12:13], 0
	s_waitcnt lgkmcnt(0)
	v_dual_mul_f32 v12, s21, v6 :: v_dual_mul_f32 v13, s20, v5
	v_dual_mul_f32 v14, s1, v7 :: v_dual_mul_f32 v15, s2, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_scale_f32 v10, null, v14, v14, v12
	v_div_scale_f32 v11, null, v14, v14, v13
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_scale_f32 v16, null, v14, v14, v15
	v_rcp_f32_e32 v17, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v18, v11
	v_div_scale_f32 v20, vcc_lo, v12, v14, v12
	v_rcp_f32_e32 v19, v16
	v_div_scale_f32 v24, s2, v15, v14, v15
	v_div_scale_f32 v21, s1, v13, v14, v13
	s_delay_alu instid0(TRANS32_DEP_3) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_fma_f32 v9, -v10, v17, 1.0
	s_waitcnt_depctr 0xfff
	v_fma_f32 v22, -v11, v18, 1.0
	v_fma_f32 v23, -v16, v19, 1.0
	v_dual_fmac_f32 v17, v9, v17 :: v_dual_fmac_f32 v18, v22, v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_dual_fmac_f32 v19, v23, v19 :: v_dual_mul_f32 v22, v20, v17
	v_mul_f32_e32 v23, v21, v18
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v9, -v10, v22, v20
	v_dual_mul_f32 v25, v24, v19 :: v_dual_fmac_f32 v22, v9, v17
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fma_f32 v27, -v16, v25, v24
	v_mov_b32_e32 v9, 0
	v_fma_f32 v10, -v10, v22, v20
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v25, v27, v19
	v_div_fmas_f32 v17, v10, v17, v22
	v_mov_b32_e32 v10, 0
	v_fma_f32 v26, -v11, v23, v21
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_fma_f32 v16, -v16, v25, v24
	s_mov_b32 vcc_lo, s1
	v_div_fixup_f32 v12, v17, v14, v12
	v_fmac_f32_e32 v23, v26, v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v11, -v11, v23, v21
	v_div_fmas_f32 v18, v11, v18, v23
	s_mov_b32 vcc_lo, s2
	v_mov_b32_e32 v11, 0
	v_div_fmas_f32 v16, v16, v19, v25
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_div_fixup_f32 v13, v18, v14, v13
	v_div_fixup_f32 v14, v16, v14, v15
	v_mov_b32_e32 v15, 0
.LBB0_7:                                ; %.preheader.i
                                        ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_4 Depth=2
                                        ;       Parent Loop BB0_6 Depth=3
                                        ; =>      This Inner Loop Header: Depth=4
	s_cmp_eq_u32 s12, 1
	s_cselect_b32 vcc_lo, -1, 0
	s_cmp_eq_u32 s12, 2
	v_cndmask_b32_e32 v16, v10, v11, vcc_lo
	s_cselect_b32 s1, -1, 0
	s_cmp_eq_u32 s12, 0
	s_cselect_b32 s2, -1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v16, v16, v15, s1
	s_add_u32 s12, s12, 1
	s_addc_u32 s13, s13, 0
	s_cmp_eq_u32 s12, 3
	v_add_f32_e32 v16, v13, v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v16, v12, v16
	v_add_f32_e32 v16, v14, v16
	s_delay_alu instid0(VALU_DEP_1)
	v_cndmask_b32_e64 v10, v10, v16, s2
	v_cndmask_b32_e32 v11, v11, v16, vcc_lo
	v_cndmask_b32_e64 v15, v15, v16, s1
	v_add_f32_e32 v9, v9, v16
	s_cbranch_scc0 .LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=3
	s_lshl_b32 s1, s10, 2
	s_add_i32 s10, s10, 1
	s_add_i32 s1, s1, 16
	s_cmp_eq_u32 s10, s6
	scratch_store_b32 off, v9, s1
	s_cbranch_scc0 .LBB0_6
; %bb.9:                                ; %_Z18FormulaComputationPfi15HIP_vector_typeIhLj4EE.exit
                                        ;   in Loop: Header=BB0_4 Depth=2
	scratch_load_b32 v6, off, off offset:16
	v_mov_b32_e32 v7, 16
	v_mov_b32_e32 v5, 0
	s_mov_b32 s1, 0
.LBB0_10:                               ; %.lr.ph.i28
                                        ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_4 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	scratch_load_b32 v8, v7, off
	s_waitcnt vmcnt(0)
	v_cmp_gt_f32_e32 vcc_lo, v8, v6
	v_dual_cndmask_b32 v6, v6, v8 :: v_dual_add_nc_u32 v7, 4, v7
	v_cndmask_b32_e64 v5, v5, s1, vcc_lo
	s_add_i32 s1, s1, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u32 s6, s1
	s_cbranch_scc1 .LBB0_10
	s_branch .LBB0_12
.LBB0_11:                               ;   in Loop: Header=BB0_4 Depth=2
	v_mov_b32_e32 v5, 0
.LBB0_12:                               ; %_Z6ArgMaxPfi.exit
                                        ;   in Loop: Header=BB0_4 Depth=2
	v_add_nc_u32_e32 v0, s14, v0
	global_store_b8 v[3:4], v5, off offset:3
	v_cmp_le_i32_e32 vcc_lo, s5, v0
	s_or_b32 s17, vcc_lo, s17
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s17
	s_cbranch_execnz .LBB0_4
.LBB0_13:                               ; %Flow48
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s16
; %bb.14:                               ; %._crit_edge
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v1, s7, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_le_i32_e32 vcc_lo, s4, v1
	s_or_b32 s15, vcc_lo, s15
	s_and_not1_b32 exec_lo, exec_lo, s15
	s_cbranch_execnz .LBB0_2
.LBB0_15:                               ; %._crit_edge32
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 144
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 1
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 28
		.amdhsa_next_free_sgpr 22
		.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	_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii, .Lfunc_end0-_Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1104
; NumSgprs: 24
; NumVgprs: 28
; ScratchSize: 144
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 3
; NumSGPRsForWavesPerEU: 24
; NumVGPRsForWavesPerEU: 28
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 1
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.protected	constAVG                ; @constAVG
	.type	constAVG,@object
	.section	.bss,"aw",@nobits
	.globl	constAVG
	.p2align	4, 0x0
constAVG:
	.zero	384
	.size	constAVG, 384

	.protected	constNormaAVG           ; @constNormaAVG
	.type	constNormaAVG,@object
	.globl	constNormaAVG
	.p2align	4, 0x0
constNormaAVG:
	.zero	128
	.size	constNormaAVG, 128

	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym constAVG
	.addrsig_sym constNormaAVG
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii
    .private_segment_fixed_size: 144
    .sgpr_count:     24
    .sgpr_spill_count: 0
    .symbol:         _Z19SpectralAngleMethodP15HIP_vector_typeIhLj4EEiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     28
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
