
#include "cuda_runtime.h"
#include "device_launch_parameters.h"

#include <stdio.h>
#include <iostream>
#include <stdlib.h> 
#include <time.h> 
#include <iomanip>


void print_matrix(float* A, int n);

void print_matrix_code(float* A, int n);

void multiple_matrices(float* A, float* B, float* C, int n);

void add_matrices(float* A, float* B, float* C, int n);

void transpose_matrix(float* A, int n);

void copy_matrix(float* S, float* D, int n);

void normalize_vector(float* A, float* unit_vec_array, int n, int j);

float dot_product(float* A, float* unit_vec_array, int n, int jU, int jA);

void substract_vec(float* A, float* B, float* R, int n, int jA, int jB, int jR, float mn_B = 1.0, float mn_A = 1.0);

void amt_matrices(float* A, float* B, float* C, float* A_T, float* B_T, float* C_T, float* D, int n);

float compare_CPU_GPU(float* A_CPU, float* A_GPU, int n);

float max_error_CPU_GPU(float* A_CPU, float* A_GPU, int n);

float max_element(float* A, int n);
//===========================================================================================

__global__ void add_matrices_GPU(float* A, float* B, float* C, int n)
{

	int id_i = (blockIdx.x * blockDim.x + threadIdx.x);
	int id_j = (blockIdx.y * blockDim.y + threadIdx.y);
	//Dodawanie
	//-----------------------------------
	for (int i = id_i; i < n; i += blockDim.x + gridDim.x)
	{
		for (int j = id_j; j < n; j += blockDim.y + gridDim.y)
		{
			*(C + i * n + j) = (*(A + i * n + j) + *(B + i * n + j));
			//printf("%i, %i, %f\n", i, j, *(A + i * n + j));
		}
	}
	//-----------------------------------
}
__global__ void multiple_matrices_GPU(float* A, float* B, float* C, int n)
{

	int id_i = (blockIdx.x * blockDim.x + threadIdx.x);
	int id_j = (blockIdx.y * blockDim.y + threadIdx.y);
	int stride = blockDim.x * gridDim.x;
	//Mnozenie
	//-----------------------------------
	for (int i = id_i; i < n; i += stride)
	{
		for (int j = id_j; j < n; j += stride)
		{
			float C_ij = 0;
			for (int kAB = 0; kAB < n; kAB++)
			{
				C_ij += (*(A + i * n + kAB)) * (*(B + kAB * n + j));
			}
			*(C + i * n + j) = C_ij;
		}
	}
	//-----------------------------------
}

__global__ void transpose_matrix_GPU(float* A, int n)
{

	//Moze transponowanie z kopiowaniem ??? (zapisywac do innej macierzy - bedzie nawet łatwiej - bez buffa) 
	int id_i = (blockIdx.x * blockDim.x + threadIdx.x);
	int id_j = (blockIdx.y * blockDim.y + threadIdx.y);
	int stride = blockDim.x * gridDim.x;
	float buff = 0;
	//Transponowanie
	//-----------------------------------
	for (int i = id_i; i < n; i += stride)
	{
		for (int j = id_j; j < i; j += stride)
		{
			buff = *(A + i * n + j);
			*(A + i * n + j) = *(A + j * n + i);
			*(A + j * n + i) = buff;
		}
	}
	//-----------------------------------
}

__global__ void transpose_copy_matrix_GPU(float* A, float* A_T, int n)
{

	//Moze transponowanie z kopiowaniem ??? (zapisywac do innej macierzy - bedzie nawet łatwiej - bez buffa) 
	int id_i = (blockIdx.x * blockDim.x + threadIdx.x);
	int id_j = (blockIdx.y * blockDim.y + threadIdx.y);
	int stride_x = blockDim.x * gridDim.x;
	int stride_y = blockDim.y * gridDim.y;

	//Transponowanie
	//-----------------------------------
	for (int i = id_i; i < n; i += stride_x)
	{
		for (int j = id_j; j < n; j += stride_y)
		{
			*(A_T + i * n + j) = *(A + j * n + i);
		}
	}
	//-----------------------------------
}

__global__ void add_three_GPU(float* A, float* B, float* C, float* D, int n)
{

	int id_i = (blockIdx.x * blockDim.x + threadIdx.x);
	int id_j = (blockIdx.y * blockDim.y + threadIdx.y);
	//Dodawanie
	//-----------------------------------
	for (int i = id_i; i < n; i += blockDim.x + gridDim.x)
	{
		for (int j = id_j; j < n; j += blockDim.y + gridDim.y)
		{
			*(D + i * n + j) = *(A + i * n + j) + *(B + i * n + j) + *(C + i * n + j);
		}
	}
	//-----------------------------------
}

__global__ void multiple_matrices_shared(float* A, float* B, float* C, int n, const int bl_size)
{
	//Indeksy podbloku macierzy wynikowej C
	int blockRow = blockIdx.y;
	int blockCol = blockIdx.x;

	//Indeksy w podbloku
	int row = threadIdx.y;
	int col = threadIdx.x;

	
	for (int i = 0; i < (n / bl_size); i++)
	{
		//__shared__ float As[bl_size][bl_size];
		//__shared__ float Bs[bl_size][bl_size];
	}
}
//===========================================================================================


int main()
{
	bool if_print = false;
	bool if_print_GPU = false;

	srand(time(NULL));

	int n = 1;
	std::cout << "Give n: ";
	std::cin >> n;

	//Allocate memory

	//Macierze dla obliczen na CPU
	float* A = (float*)malloc(n * n * sizeof(float));
	float* B = (float*)malloc(n * n * sizeof(float));
	float* C = (float*)malloc(n * n * sizeof(float));

	float* A_T = (float*)malloc(n * n * sizeof(float));
	float* B_T = (float*)malloc(n * n * sizeof(float));
	float* C_T = (float*)malloc(n * n * sizeof(float));

	float* D = (float*)malloc(n * n * sizeof(float));

	// Initialize with random floats
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			*(A + i * n + j) = (2.0 * rand() / RAND_MAX) - 1.0;
			*(B + i * n + j) = (2.0 * rand() / RAND_MAX) - 1.0;
			
			*(A_T + i * n + j) = *(A + i * n + j);
			*(B_T + i * n + j) = *(B + i * n + j);
		}
	}

	//Obliczenia CPU
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	clock_t start_CPU = clock();

	multiple_matrices(A, B, C, n);
	transpose_matrix(A_T, n);
	transpose_matrix(B_T, n);

	copy_matrix(C, C_T, n);
	transpose_matrix(C_T, n);

	amt_matrices(A, B, C, A_T, B_T, C_T, D, n);



	clock_t stop_CPU = clock();
	//Print
	//====================================
	if (if_print)
	{
		std::cout << "\nA\n";
		print_matrix(A, n);

		std::cout << "\nB\n";
		print_matrix(B, n);

		std::cout << "\nC\n";
		print_matrix(C, n);

		std::cout << "\nA_T\n";
		print_matrix(A_T, n);

		std::cout << "\nD\n";
		print_matrix(D, n);

	}
	//====================================


	std::cout << "Czas_CPU: " << 1000 * (stop_CPU - start_CPU) / ((double)CLOCKS_PER_SEC) << " ms" << std::endl;
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


	//Same GPU
	//=================================================================================================

	//Macierze do skopiowania wynikow GPU
	float* C_h = (float*)malloc(n * n * sizeof(float));
	float* A_T_h = (float*)malloc(n * n * sizeof(float));
	float* B_T_h = (float*)malloc(n * n * sizeof(float));
	float* C_T_h = (float*)malloc(n * n * sizeof(float));
	float* D_h = (float*)malloc(n * n * sizeof(float));


	float* A_dev;
	float* B_dev;
	float* C_dev;

	float* A_T_dev;
	float* B_T_dev;
	float* C_T_dev;

	float* D_dev;
	float* D_A_dev;//Pomocnicze - B*B_T
	float* D_B_dev;//Pomocnicze - B*B_T
	float* D_C_dev;//Pomocnicze - C*C_T

	float* D_AB_dev;//Pomocnicze - B*B_T


	//Alokacja
	cudaMalloc(&A_dev, n * n * sizeof(float));
	cudaMalloc(&B_dev, n * n * sizeof(float));
	cudaMalloc(&C_dev, n * n * sizeof(float));

	cudaMalloc(&A_T_dev, n * n * sizeof(float));
	cudaMalloc(&B_T_dev, n * n * sizeof(float));
	cudaMalloc(&C_T_dev, n * n * sizeof(float));

	cudaMalloc(&D_dev, n * n * sizeof(float));
	cudaMalloc(&D_B_dev, n * n * sizeof(float));
	cudaMalloc(&D_C_dev, n * n * sizeof(float));
	cudaMalloc(&D_A_dev, n * n * sizeof(float));
	cudaMalloc(&D_AB_dev, n * n * sizeof(float));

	//Kopiowanie na Device
	cudaMemcpy(A_dev, A, n * n * sizeof(float), cudaMemcpyHostToDevice);
	cudaMemcpy(B_dev, B, n * n * sizeof(float), cudaMemcpyHostToDevice);


	int BLOCK_SIZE = 128;
	int GRID_SIZE = 16;
	dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);
	dim3 dimGrid(GRID_SIZE, GRID_SIZE);

	//obliczenia GPU
	clock_t start_GPU = clock();
	//C
	multiple_matrices_GPU <<<dimBlock, dimGrid >>> (A_dev, B_dev, C_dev, n);
	//Transpozycje
	transpose_copy_matrix_GPU <<<dimBlock, dimGrid >>> (A_dev, A_T_dev, n);
	transpose_copy_matrix_GPU <<<dimBlock, dimGrid >>> (B_dev, B_T_dev, n);
	transpose_copy_matrix_GPU <<<dimBlock, dimGrid >>> (C_dev, C_T_dev, n);
	
	// D matrix
	cudaDeviceSynchronize();
	multiple_matrices_GPU <<<dimBlock, dimGrid >>> (A_dev, A_T_dev, D_A_dev, n);
	cudaDeviceSynchronize();

	multiple_matrices_GPU <<<dimBlock, dimGrid >>> (B_dev, B_T_dev, D_B_dev, n);
	cudaDeviceSynchronize();

	multiple_matrices_GPU <<<dimBlock, dimGrid >>> (C_dev, C_T_dev, D_C_dev, n);
	cudaDeviceSynchronize();


	add_three_GPU <<<dimBlock, dimGrid >>> (D_A_dev, D_B_dev, D_C_dev, D_dev, n);

	cudaDeviceSynchronize();


	//Kopiowanie na Hosta
	cudaMemcpy(C_h, C_dev, n * n * sizeof(float), cudaMemcpyDeviceToHost);
	cudaMemcpy(A_T_h, A_T_dev, n * n * sizeof(float), cudaMemcpyDeviceToHost);
	cudaMemcpy(D_h, D_dev, n * n * sizeof(float), cudaMemcpyDeviceToHost);

	//Stop 
	clock_t stop_GPU = clock();


	if (if_print_GPU)
	{
		std::cout << "\nA\n";
		print_matrix(A, n);

		std::cout << "\nB\n";
		print_matrix(B, n);

		std::cout << "\nC_h\n";
		print_matrix(C_h, n);

		std::cout << "\nA_T_h\n";
		print_matrix(A_T_h, n);

		std::cout << "\nD_h\n";
		print_matrix(D_h, n);

	}

	//Porownanie GPU i CPU
	std::cout << "Czas_GPU: " << 1000 * (stop_GPU - start_GPU) / ((double)CLOCKS_PER_SEC) << " ms" << std::endl;
	float C_error = compare_CPU_GPU(A_T, A_T_h, n);
	//std::cout << "D errory: " << std::endl;
	float D_error = compare_CPU_GPU(D, D_h, n);
	float Max_D_error = max_error_CPU_GPU(D, D_h, n);


	std::cout << "Blad w C: " << C_error << std::endl;
	std::cout << "Blad w D: " << D_error << std::endl;
	std::cout << "Maksymalny blad w D: " << Max_D_error << std::endl;


	if (stop_GPU - start_GPU > 0)
	{
		std::cout << "Speedup: " << 1.0 * (stop_CPU - start_CPU) / (stop_GPU - start_GPU) << std::endl;
	}
	else
	{
		std::cout << "Czas obliczen zbyt krotki by okreslic speedup" << std::endl;
	}
	//=================================================================================================
	
	//Zwolnienie pamieci macierzy od GPU
	free(C_h);
	free(A_T_h);
	free(B_T_h);
	free(C_T_h);
	free(D_h);

	//Zwolnienie pamieci  GPU
	cudaFree(A_dev);
	cudaFree(B_dev);
	cudaFree(C_dev);
	cudaFree(A_T_dev);
	cudaFree(B_T_dev);
	cudaFree(C_T_dev);
	cudaFree(D_dev);

	//Zwolnienie pamieci macierzy od CPU
	free(A);
	free(B);
	free(C);
	free(A_T);
	free(B_T);
	free(C_T);
	free(D);


	return 0;
}




//##################################################################################3
float compare_CPU_GPU(float* A_CPU, float* A_GPU, int n)
{
	float error = 0.0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			error += powf(*(A_CPU + i * n + j) - *(A_GPU + i * n + j), 2.0);
		}
	}
	return error;
}

float max_error_CPU_GPU(float* A_CPU, float* A_GPU, int n)
{
	float max_error = 0.0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			float error = powf(*(A_CPU + i * n + j) - *(A_GPU + i * n + j), 2.0);
			if (error > max_error)
			{
				//std::cout << "*(A_CPU + i * n + j): " << *(A_CPU + i * n + j) << "\n *(A_GPU + i * n + j): " << *(A_GPU + i * n + j) << "\n\n";
				max_error = error;
			}

		}
	}
	return max_error;
}
float max_element(float* A, int n)
{
	float max_el = 0.0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (*(A + i * n + j) > max_el)
			{
				//std::cout << "*(A + i * n + j): " << *(A + i * n + j) << "\n\n";
				max_el = *(A + i * n + j);
			}

		}
	}
	return max_el;
}


void print_matrix(float* A, int n)
{
	for (int i = 0; i < n; i++)
	{

		for (int j = 0; j < n; j++)
		{
			std::cout << std::setw(12) << *(A + i * n + j) << " ";
		}
		std::cout << "\n";
	}
}

void print_matrix_code(float* A, int n)
{
	//WYPISANIE KOLUMNAMI
	std::cout << "[";
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			std::cout << *(A + j * n + i);
			if (j != n - 1)
				std::cout << ",";
		}
		if (i != n - 1)
			std::cout << "; ";
	}
	std::cout << "]";
}

void multiple_matrices(float* A, float* B, float* C, int n)
{
	//Mnozenie
	//-----------------------------------
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			//std::cout << "\n\n" << i << ", " << j << ": \n";
			float C_ij = 0;
			for (int kAB = 0; kAB < n; kAB++)
			{
				C_ij += (*(A + i * n + kAB)) * (*(B + kAB * n + j));
				//std::cout << "A " << i << ", " << kAB << "    *B " << kAB << ", " << j <<  "    : " << C_ij << "\n";				
			}
			*(C + i * n + j) = C_ij;
		}
	}
	//-----------------------------------
}

void add_matrices(float* A, float* B, float* C, int n)
{
	//Dodawanie
	//-----------------------------------
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			*(C + i * n + j) = (*(A + i * n + j) + *(B + i * n + j));
		}
	}
	//-----------------------------------
}

void transpose_matrix(float* A, int n)
{
	//Transponowanie
	//-----------------------------------
	float buff = 0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < i; j++)
		{
			buff = *(A + i * n + j);
			*(A + i * n + j) = *(A + j * n + i);
			*(A + j * n + i) = buff;
		}
	}
	//-----------------------------------
}

void copy_matrix(float* S, float* D, int n)
{
	//Kopiowanie
	//-----------------------------------
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			*(D + i * n + j) = *(S + i * n + j);
		}
	}
	//-----------------------------------
}

void normalize_vector(float* A, float* unit_vec_array, int n, int j)
{
	//Normalizing column vector (matrix A, col j) 
	//-----------------------------------
	float norm = 0.0;
	for (int i = 0; i < n; i++)//calculate norm
	{
		norm += pow(*(A + i * n + j), 2.0);
	}
	norm = sqrt(norm);

	for (int i = 0; i < n; i++)//calculate unit vector
	{
		*(unit_vec_array + i * n + j) = *(A + i * n + j) / norm;
	}
	//-----------------------------------
}

float dot_product(float* A, float* unit_vec_array, int n, int jU, int jA)
{
	float d_p = 0;
	//Iloczyn skalarny
	//-----------------------------------

	for (int i = 0; i < n; i++)//calculate unit vector
	{
		d_p += (*(unit_vec_array + i * n + jU)) * (*(A + i * n + jA));
		//std::cout << "i: " << i << ",  u_vec_a: = " << *(unit_vec_array + i * n + jU) << ", A_element = " << *(A + i * n + jA) << ",  d_p: " << d_p << "\n";
	}
	return d_p;
	//-----------------------------------
}

void substract_vec(float* A, float* B, float* R, int n, int jA, int jB, int jR, float mn_B, float mn_A)//mn - mnoznik
{
	float d_p = 0;
	//Odejmowanie
	//-----------------------------------
	for (int i = 0; i < n; i++)//calculate unit vector
	{
		//std::cout << "i: " << i << ", A_el = " << *(A + i * n + jA) << "\n";
		*(R + i * n + jR) = mn_A * (*(A + i * n + jA)) - mn_B * (*(B + i * n + jB));
		//std::cout << "i: "<< i << ",  R_el = " << *(R + i * n + jR) << ", A_el = " << *(A + i * n + jA) << ",  B_el =   " << *(B + i * n + jB) 
		//	<< ", B_el_multiplied = " << mn_B * (*(B + i * n + jB)) <<  "\n";
	}
	//-----------------------------------
}

void amt_matrices(float* A, float* B, float* C, float* A_T, float* B_T, float* C_T, float* D, int n)
{
	//D = A*A_T + B*B_T + C*C_T
	float* AA_T = (float*)malloc(n * n * sizeof(float));
	float* BB_T = (float*)malloc(n * n * sizeof(float));
	float* CC_T = (float*)malloc(n * n * sizeof(float));

	multiple_matrices(A, A_T, AA_T, n);
	multiple_matrices(B, B_T, BB_T, n);
	multiple_matrices(C, C_T, CC_T, n);
	add_matrices(AA_T, BB_T, D, n);
	add_matrices(D, CC_T, D, n);

	free(AA_T);
	free(BB_T);
	free(CC_T);
}


	.file	"tmpxft_0031a13a_00000000-6_matrices.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3931:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3931:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0, @function
_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0:
.LFB4614:
	.cfi_startproc
	jmp	cudaMalloc@PLT
	.cfi_endproc
.LFE4614:
	.size	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0, .-_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4615:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4615:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z15compare_CPU_GPUPfS_i
	.type	_Z15compare_CPU_GPUPfS_i, @function
_Z15compare_CPU_GPUPfS_i:
.LFB3916:
	.cfi_startproc
	endbr64
	movslq	%edx, %r10
	xorl	%r8d, %r8d
	xorps	%xmm1, %xmm1
	xorl	%r9d, %r9d
.L5:
	cmpl	%edx, %r9d
	jge	.L4
	leaq	0(,%r8,4), %rax
	xorl	%ecx, %ecx
.L6:
	movss	(%rdi,%rax), %xmm0
	subss	(%rsi,%rax), %xmm0
	incl	%ecx
	addq	$4, %rax
	mulss	%xmm0, %xmm0
	addss	%xmm0, %xmm1
	cmpl	%ecx, %edx
	jne	.L6
	incl	%r9d
	addq	%r10, %r8
	jmp	.L5
.L4:
	movaps	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE3916:
	.size	_Z15compare_CPU_GPUPfS_i, .-_Z15compare_CPU_GPUPfS_i
	.globl	_Z17max_error_CPU_GPUPfS_i
	.type	_Z17max_error_CPU_GPUPfS_i, @function
_Z17max_error_CPU_GPUPfS_i:
.LFB3917:
	.cfi_startproc
	endbr64
	movslq	%edx, %r10
	xorl	%r8d, %r8d
	xorps	%xmm1, %xmm1
	xorl	%r9d, %r9d
.L11:
	cmpl	%edx, %r9d
	jge	.L10
	leaq	0(,%r8,4), %rax
	xorl	%ecx, %ecx
.L13:
	movss	(%rdi,%rax), %xmm0
	subss	(%rsi,%rax), %xmm0
	incl	%ecx
	addq	$4, %rax
	mulss	%xmm0, %xmm0
	maxss	%xmm1, %xmm0
	movaps	%xmm0, %xmm1
	cmpl	%ecx, %edx
	jne	.L13
	incl	%r9d
	addq	%r10, %r8
	jmp	.L11
.L10:
	movaps	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE3917:
	.size	_Z17max_error_CPU_GPUPfS_i, .-_Z17max_error_CPU_GPUPfS_i
	.globl	_Z11max_elementPfi
	.type	_Z11max_elementPfi, @function
_Z11max_elementPfi:
.LFB3918:
	.cfi_startproc
	endbr64
	movslq	%esi, %r9
	xorl	%edx, %edx
	xorps	%xmm0, %xmm0
	xorl	%ecx, %ecx
.L18:
	cmpl	%esi, %ecx
	jge	.L17
	leaq	(%rdi,%rdx,4), %r8
	xorl	%eax, %eax
.L20:
	movss	(%r8,%rax,4), %xmm1
	incq	%rax
	maxss	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	cmpl	%eax, %esi
	jg	.L20
	incl	%ecx
	addq	%r9, %rdx
	jmp	.L18
.L17:
	ret
	.cfi_endproc
.LFE3918:
	.size	_Z11max_elementPfi, .-_Z11max_elementPfi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	" "
.LC2:
	.string	"\n"
	.text
	.globl	_Z12print_matrixPfi
	.type	_Z12print_matrixPfi, @function
_Z12print_matrixPfi:
.LFB3919:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	_ZSt4cout(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	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
	movq	%r15, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L25:
	cmpl	%ebx, %r14d
	jge	.L30
	leaq	(%r12,%rbp,4), %rdx
	addq	%r15, %rbp
	leaq	(%r12,%rbp,4), %rcx
.L26:
	movq	0(%r13), %rax
	movq	%r13, %rdi
	movq	%rdx, (%rsp)
	cvtss2sd	(%rdx), %xmm0
	movq	%rcx, 8(%rsp)
	movq	-24(%rax), %rax
	movq	$12, 16(%r13,%rax)
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	(%rsp), %rdx
	movq	8(%rsp), %rcx
	addq	$4, %rdx
	cmpq	%rcx, %rdx
	jne	.L26
	leaq	.LC2(%rip), %rsi
	movq	%r13, %rdi
	incl	%r14d
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L25
.L30:
	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
.LFE3919:
	.size	_Z12print_matrixPfi, .-_Z12print_matrixPfi
	.section	.rodata.str1.1
.LC3:
	.string	"["
.LC4:
	.string	","
.LC5:
	.string	"; "
.LC6:
	.string	"]"
	.text
	.globl	_Z17print_matrix_codePfi
	.type	_Z17print_matrix_codePfi, @function
_Z17print_matrix_codePfi:
.LFB3920:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movslq	%esi, %r14
	leaq	.LC3(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	0(,%r14,4), %r15
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r14, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%rdi, (%rsp)
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L32:
	movl	%ebx, 8(%rsp)
	cmpl	%ebx, %ebp
	jle	.L39
	movq	(%rsp), %rax
	xorl	%r12d, %r12d
	leaq	(%rax,%rbx,4), %r13
.L34:
	leaq	_ZSt4cout(%rip), %rdi
	cvtss2sd	0(%r13), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leal	-1(%rbp), %ecx
	cmpl	%r12d, %ecx
	je	.L33
	leaq	.LC4(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movl	%ecx, 12(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	12(%rsp), %ecx
.L33:
	incq	%r12
	addq	%r15, %r13
	cmpq	%r12, %r14
	jne	.L34
	movl	8(%rsp), %eax
	cmpl	%eax, %ecx
	je	.L35
	leaq	.LC5(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L35:
	incq	%rbx
	jmp	.L32
.L39:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	leaq	.LC6(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	.cfi_endproc
.LFE3920:
	.size	_Z17print_matrix_codePfi, .-_Z17print_matrix_codePfi
	.globl	_Z17multiple_matricesPfS_S_i
	.type	_Z17multiple_matricesPfS_S_i, @function
_Z17multiple_matricesPfS_S_i:
.LFB3921:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdi, %r8
	movq	%rsi, %r11
	movq	%rdx, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movslq	%ecx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	0(,%rbp,4), %r13
.L41:
	cmpl	%ecx, %r10d
	jge	.L40
	leaq	0(,%r9,4), %rax
	leaq	(%r8,%rax), %r12
	leaq	(%rdi,%rax), %rdx
	xorl	%eax, %eax
.L45:
	leaq	(%r11,%rax,4), %rbx
	xorl	%esi, %esi
	xorps	%xmm0, %xmm0
.L42:
	movss	(%r12,%rsi,4), %xmm1
	mulss	(%rbx), %xmm1
	incq	%rsi
	addq	%r13, %rbx
	addss	%xmm1, %xmm0
	cmpl	%esi, %ecx
	jg	.L42
	movss	%xmm0, (%rdx,%rax,4)
	incq	%rax
	cmpl	%eax, %ecx
	jg	.L45
	incl	%r10d
	addq	%rbp, %r9
	jmp	.L41
.L40:
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3921:
	.size	_Z17multiple_matricesPfS_S_i, .-_Z17multiple_matricesPfS_S_i
	.globl	_Z12add_matricesPfS_S_i
	.type	_Z12add_matricesPfS_S_i, @function
_Z12add_matricesPfS_S_i:
.LFB3922:
	.cfi_startproc
	endbr64
	movq	%rdi, %r9
	movslq	%ecx, %r11
	xorl	%r8d, %r8d
	xorl	%edi, %edi
.L49:
	cmpl	%ecx, %edi
	jge	.L53
	leaq	0(,%r8,4), %rax
	xorl	%r10d, %r10d
.L50:
	movss	(%r9,%rax), %xmm0
	addss	(%rsi,%rax), %xmm0
	incl	%r10d
	movss	%xmm0, (%rdx,%rax)
	addq	$4, %rax
	cmpl	%r10d, %ecx
	jne	.L50
	incl	%edi
	addq	%r11, %r8
	jmp	.L49
.L53:
	ret
	.cfi_endproc
.LFE3922:
	.size	_Z12add_matricesPfS_S_i, .-_Z12add_matricesPfS_S_i
	.globl	_Z16transpose_matrixPfi
	.type	_Z16transpose_matrixPfi, @function
_Z16transpose_matrixPfi:
.LFB3923:
	.cfi_startproc
	endbr64
	movslq	%esi, %r10
	xorl	%r9d, %r9d
	xorl	%eax, %eax
	salq	$2, %r10
.L55:
	movl	%eax, %r11d
	cmpl	%eax, %esi
	jle	.L54
	movslq	%r9d, %rdx
	xorl	%r8d, %r8d
	leaq	(%rdi,%rdx,4), %rcx
	leaq	(%rdi,%rax,4), %rdx
.L58:
	cmpl	%r11d, %r8d
	je	.L59
	movss	(%rcx), %xmm0
	movss	(%rdx), %xmm1
	incl	%r8d
	addq	$4, %rcx
	movss	%xmm1, -4(%rcx)
	movss	%xmm0, (%rdx)
	addq	%r10, %rdx
	jmp	.L58
.L59:
	incq	%rax
	addl	%esi, %r9d
	jmp	.L55
.L54:
	ret
	.cfi_endproc
.LFE3923:
	.size	_Z16transpose_matrixPfi, .-_Z16transpose_matrixPfi
	.globl	_Z11copy_matrixPfS_i
	.type	_Z11copy_matrixPfS_i, @function
_Z11copy_matrixPfS_i:
.LFB3924:
	.cfi_startproc
	endbr64
	movslq	%edx, %r10
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
.L61:
	cmpl	%edx, %ecx
	jge	.L65
	leaq	0(,%r8,4), %rax
	xorl	%r9d, %r9d
.L62:
	movss	(%rdi,%rax), %xmm0
	incl	%r9d
	movss	%xmm0, (%rsi,%rax)
	addq	$4, %rax
	cmpl	%r9d, %edx
	jne	.L62
	incl	%ecx
	addq	%r10, %r8
	jmp	.L61
.L65:
	ret
	.cfi_endproc
.LFE3924:
	.size	_Z11copy_matrixPfS_i, .-_Z11copy_matrixPfS_i
	.globl	_Z16normalize_vectorPfS_ii
	.type	_Z16normalize_vectorPfS_ii, @function
_Z16normalize_vectorPfS_ii:
.LFB3925:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	movq	%rsi, %r14
	xorps	%xmm0, %xmm0
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movslq	%edx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rbp
	salq	$2, %r12
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movslq	%ecx, %rbx
	salq	$2, %rbx
	leaq	(%rdi,%rbx), %rdx
.L67:
	cmpl	%ebp, %eax
	jge	.L72
	cvtss2sd	(%rdx), %xmm1
	mulsd	%xmm1, %xmm1
	cvtss2sd	%xmm0, %xmm0
	incl	%eax
	addq	%r12, %rdx
	addsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	jmp	.L67
.L72:
	call	sqrtf@PLT
	xorl	%eax, %eax
.L69:
	cmpl	%ebp, %eax
	jge	.L73
	movss	0(%r13,%rbx), %xmm1
	incl	%eax
	divss	%xmm0, %xmm1
	movss	%xmm1, (%r14,%rbx)
	addq	%r12, %rbx
	jmp	.L69
.L73:
	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
.LFE3925:
	.size	_Z16normalize_vectorPfS_ii, .-_Z16normalize_vectorPfS_ii
	.globl	_Z11dot_productPfS_iii
	.type	_Z11dot_productPfS_iii, @function
_Z11dot_productPfS_iii:
.LFB3926:
	.cfi_startproc
	endbr64
	movslq	%ecx, %rcx
	movslq	%edx, %rax
	xorps	%xmm0, %xmm0
	movslq	%r8d, %r8
	leaq	(%rsi,%rcx,4), %rsi
	salq	$2, %rax
	leaq	(%rdi,%r8,4), %rdi
	xorl	%ecx, %ecx
.L75:
	cmpl	%edx, %ecx
	jge	.L77
	movss	(%rsi), %xmm1
	mulss	(%rdi), %xmm1
	incl	%ecx
	addq	%rax, %rsi
	addq	%rax, %rdi
	addss	%xmm1, %xmm0
	jmp	.L75
.L77:
	ret
	.cfi_endproc
.LFE3926:
	.size	_Z11dot_productPfS_iii, .-_Z11dot_productPfS_iii
	.globl	_Z13substract_vecPfS_S_iiiiff
	.type	_Z13substract_vecPfS_S_iiiiff, @function
_Z13substract_vecPfS_S_iiiiff:
.LFB3927:
	.cfi_startproc
	endbr64
	movq	%rsi, %rax
	movslq	%r8d, %r8
	movslq	%r9d, %r9
	movslq	%ecx, %rsi
	leaq	(%rdi,%r8,4), %rdi
	leaq	(%rax,%r9,4), %r8
	movslq	8(%rsp), %rax
	movq	%rdx, %r10
	xorl	%ecx, %ecx
	movq	%rsi, %rdx
	salq	$2, %rsi
	leaq	(%r10,%rax,4), %r9
	xorl	%eax, %eax
.L79:
	cmpl	%edx, %ecx
	jge	.L81
	movss	(%rdi,%rax), %xmm2
	movss	(%r8,%rax), %xmm3
	incl	%ecx
	mulss	%xmm1, %xmm2
	mulss	%xmm0, %xmm3
	subss	%xmm3, %xmm2
	movss	%xmm2, (%r9,%rax)
	addq	%rsi, %rax
	jmp	.L79
.L81:
	ret
	.cfi_endproc
.LFE3927:
	.size	_Z13substract_vecPfS_S_iiiiff, .-_Z13substract_vecPfS_S_iiiiff
	.globl	_Z12amt_matricesPfS_S_S_S_S_S_i
	.type	_Z12amt_matricesPfS_S_S_S_S_S_i, @function
_Z12amt_matricesPfS_S_S_S_S_S_i:
.LFB3928:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r8, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r9, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movl	120(%rsp), %ebx
	movq	112(%rsp), %rax
	movq	%rcx, 40(%rsp)
	movq	%rax, 16(%rsp)
	movl	%ebx, %eax
	imull	%ebx, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rdi
	movq	%rax, 24(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rdi
	movq	%rax, 32(%rsp)
	call	malloc@PLT
	movq	24(%rsp), %rdx
	movl	%ebx, %ecx
	movq	%r15, %rdi
	movq	40(%rsp), %rsi
	movq	%rax, 8(%rsp)
	call	_Z17multiple_matricesPfS_S_i
	movq	32(%rsp), %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	_Z17multiple_matricesPfS_S_i
	movq	8(%rsp), %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	_Z17multiple_matricesPfS_S_i
	movq	16(%rsp), %rdx
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdi
	call	_Z12add_matricesPfS_S_i
	movq	16(%rsp), %rdx
	movq	8(%rsp), %rsi
	movq	%rdx, %rdi
	call	_Z12add_matricesPfS_S_i
	movq	24(%rsp), %rdi
	call	free@PLT
	movq	32(%rsp), %rdi
	call	free@PLT
	movq	8(%rsp), %rdi
	addq	$56, %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
	jmp	free@PLT
	.cfi_endproc
.LFE3928:
	.size	_Z12amt_matricesPfS_S_S_S_S_S_i, .-_Z12amt_matricesPfS_S_S_S_S_S_i
	.globl	_Z41__device_stub__Z16add_matrices_GPUPfS_S_iPfS_S_i
	.type	_Z41__device_stub__Z16add_matrices_GPUPfS_S_iPfS_S_i, @function
_Z41__device_stub__Z16add_matrices_GPUPfS_S_iPfS_S_i:
.LFB3953:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 4(%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	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%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	.L84
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z16add_matrices_GPUPfS_S_i(%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
.L84:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L86
	call	__stack_chk_fail@PLT
.L86:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3953:
	.size	_Z41__device_stub__Z16add_matrices_GPUPfS_S_iPfS_S_i, .-_Z41__device_stub__Z16add_matrices_GPUPfS_S_iPfS_S_i
	.globl	_Z16add_matrices_GPUPfS_S_i
	.type	_Z16add_matrices_GPUPfS_S_i, @function
_Z16add_matrices_GPUPfS_S_i:
.LFB3954:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z16add_matrices_GPUPfS_S_iPfS_S_i
	.cfi_endproc
.LFE3954:
	.size	_Z16add_matrices_GPUPfS_S_i, .-_Z16add_matrices_GPUPfS_S_i
	.globl	_Z46__device_stub__Z21multiple_matrices_GPUPfS_S_iPfS_S_i
	.type	_Z46__device_stub__Z21multiple_matrices_GPUPfS_S_iPfS_S_i, @function
_Z46__device_stub__Z21multiple_matrices_GPUPfS_S_iPfS_S_i:
.LFB3955:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 4(%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	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%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	.L89
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z21multiple_matrices_GPUPfS_S_i(%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
.L89:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L91
	call	__stack_chk_fail@PLT
.L91:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3955:
	.size	_Z46__device_stub__Z21multiple_matrices_GPUPfS_S_iPfS_S_i, .-_Z46__device_stub__Z21multiple_matrices_GPUPfS_S_iPfS_S_i
	.globl	_Z21multiple_matrices_GPUPfS_S_i
	.type	_Z21multiple_matrices_GPUPfS_S_i, @function
_Z21multiple_matrices_GPUPfS_S_i:
.LFB3956:
	.cfi_startproc
	endbr64
	jmp	_Z46__device_stub__Z21multiple_matrices_GPUPfS_S_iPfS_S_i
	.cfi_endproc
.LFE3956:
	.size	_Z21multiple_matrices_GPUPfS_S_i, .-_Z21multiple_matrices_GPUPfS_S_i
	.globl	_Z41__device_stub__Z20transpose_matrix_GPUPfiPfi
	.type	_Z41__device_stub__Z20transpose_matrix_GPUPfiPfi, @function
_Z41__device_stub__Z20transpose_matrix_GPUPfiPfi:
.LFB3957:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L94
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z20transpose_matrix_GPUPfi(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L94:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L96
	call	__stack_chk_fail@PLT
.L96:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3957:
	.size	_Z41__device_stub__Z20transpose_matrix_GPUPfiPfi, .-_Z41__device_stub__Z20transpose_matrix_GPUPfiPfi
	.globl	_Z20transpose_matrix_GPUPfi
	.type	_Z20transpose_matrix_GPUPfi, @function
_Z20transpose_matrix_GPUPfi:
.LFB3958:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z20transpose_matrix_GPUPfiPfi
	.cfi_endproc
.LFE3958:
	.size	_Z20transpose_matrix_GPUPfi, .-_Z20transpose_matrix_GPUPfi
	.globl	_Z48__device_stub__Z25transpose_copy_matrix_GPUPfS_iPfS_i
	.type	_Z48__device_stub__Z25transpose_copy_matrix_GPUPfS_iPfS_i, @function
_Z48__device_stub__Z25transpose_copy_matrix_GPUPfS_iPfS_i:
.LFB3959:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L99
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z25transpose_copy_matrix_GPUPfS_i(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L99:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L101
	call	__stack_chk_fail@PLT
.L101:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3959:
	.size	_Z48__device_stub__Z25transpose_copy_matrix_GPUPfS_iPfS_i, .-_Z48__device_stub__Z25transpose_copy_matrix_GPUPfS_iPfS_i
	.globl	_Z25transpose_copy_matrix_GPUPfS_i
	.type	_Z25transpose_copy_matrix_GPUPfS_i, @function
_Z25transpose_copy_matrix_GPUPfS_i:
.LFB3960:
	.cfi_startproc
	endbr64
	jmp	_Z48__device_stub__Z25transpose_copy_matrix_GPUPfS_iPfS_i
	.cfi_endproc
.LFE3960:
	.size	_Z25transpose_copy_matrix_GPUPfS_i, .-_Z25transpose_copy_matrix_GPUPfS_i
	.globl	_Z40__device_stub__Z13add_three_GPUPfS_S_S_iPfS_S_S_i
	.type	_Z40__device_stub__Z13add_three_GPUPfS_S_S_iPfS_S_S_i, @function
_Z40__device_stub__Z13add_three_GPUPfS_S_S_iPfS_S_S_i:
.LFB3961:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L104
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z13add_three_GPUPfS_S_S_i(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 192
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L104:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L106
	call	__stack_chk_fail@PLT
.L106:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3961:
	.size	_Z40__device_stub__Z13add_three_GPUPfS_S_S_iPfS_S_S_i, .-_Z40__device_stub__Z13add_three_GPUPfS_S_S_iPfS_S_S_i
	.globl	_Z13add_three_GPUPfS_S_S_i
	.type	_Z13add_three_GPUPfS_S_S_i, @function
_Z13add_three_GPUPfS_S_S_i:
.LFB3962:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z13add_three_GPUPfS_S_S_iPfS_S_S_i
	.cfi_endproc
.LFE3962:
	.size	_Z13add_three_GPUPfS_S_S_i, .-_Z13add_three_GPUPfS_S_S_i
	.section	.rodata.str1.1
.LC7:
	.string	"Give n: "
.LC10:
	.string	"Czas_CPU: "
.LC12:
	.string	" ms"
.LC13:
	.string	"Czas_GPU: "
.LC14:
	.string	"Blad w C: "
.LC15:
	.string	"Blad w D: "
.LC16:
	.string	"Maksymalny blad w D: "
.LC17:
	.string	"Speedup: "
.LC18:
	.string	"Czas obliczen zbyt krotki by okreslic speedup"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3915:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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	$200, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
	leaq	.LC7(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movl	$1, 68(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	68(%rsp), %rsi
	leaq	_ZSt3cin(%rip), %rdi
	call	_ZNSirsERi@PLT
	movl	68(%rsp), %r13d
	imull	%r13d, %r13d
	movslq	%r13d, %r13
	salq	$2, %r13
	movq	%r13, %rdi
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, %r12
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, (%rsp)
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movq	%r13, %rdi
	xorl	%r13d, %r13d
	movq	%rax, 16(%rsp)
	call	malloc@PLT
	movq	%rax, 24(%rsp)
.L110:
	cmpl	%r13d, 68(%rsp)
	jle	.L127
	xorl	%r14d, %r14d
.L112:
	cmpl	%r14d, 68(%rsp)
	jle	.L128
	call	rand@PLT
	movl	%eax, %edx
	movl	68(%rsp), %eax
	cvtsi2sdl	%edx, %xmm0
	imull	%r13d, %eax
	addsd	%xmm0, %xmm0
	divsd	.LC8(%rip), %xmm0
	cltq
	subsd	.LC9(%rip), %xmm0
	addq	%r14, %rax
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%rbx,%rax,4)
	call	rand@PLT
	movq	8(%rsp), %rcx
	movl	%eax, %edx
	movl	68(%rsp), %eax
	cvtsi2sdl	%edx, %xmm0
	imull	%r13d, %eax
	cltq
	addsd	%xmm0, %xmm0
	divsd	.LC8(%rip), %xmm0
	subsd	.LC9(%rip), %xmm0
	addq	%r14, %rax
	incq	%r14
	movss	(%rbx,%rax,4), %xmm1
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r12,%rax,4)
	movss	%xmm1, 0(%rbp,%rax,4)
	movss	%xmm0, (%rcx,%rax,4)
	jmp	.L112
.L128:
	incl	%r13d
	jmp	.L110
.L127:
	call	clock@PLT
	movl	68(%rsp), %r13d
	movq	%r12, %rsi
	movq	%rbx, %rdi
	movq	(%rsp), %rdx
	movq	%rax, %r15
	movl	%r13d, %ecx
	call	_Z17multiple_matricesPfS_S_i
	movl	%r13d, %esi
	movq	%rbp, %rdi
	call	_Z16transpose_matrixPfi
	movq	8(%rsp), %rdi
	call	_Z16transpose_matrixPfi
	movq	16(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	%r13d, %edx
	call	_Z11copy_matrixPfS_i
	movq	16(%rsp), %rdi
	movl	%r13d, %esi
	call	_Z16transpose_matrixPfi
	pushq	%r13
	.cfi_def_cfa_offset 264
	movq	%rbp, %rcx
	movq	%r12, %rsi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 272
	movq	32(%rsp), %r9
	movq	%rbx, %rdi
	movq	24(%rsp), %r8
	movq	16(%rsp), %rdx
	call	_Z12amt_matricesPfS_S_S_S_S_S_i
	call	clock@PLT
	leaq	.LC10(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rax, %r14
	popq	%rax
	.cfi_def_cfa_offset 264
	popq	%rdx
	.cfi_def_cfa_offset 256
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	subq	%r15, %r14
	movq	%rax, %rdi
	imulq	$1000, %r14, %rax
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC11(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC12(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	68(%rsp), %r13d
	imull	%r13d, %r13d
	movslq	%r13d, %r13
	salq	$2, %r13
	movq	%r13, %rdi
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, 48(%rsp)
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, 40(%rsp)
	call	malloc@PLT
	leaq	72(%rsp), %rdi
	movq	%r13, %rsi
	movq	%rax, 32(%rsp)
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	68(%rsp), %esi
	leaq	80(%rsp), %rdi
	imull	%esi, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	68(%rsp), %esi
	leaq	88(%rsp), %rdi
	imull	%esi, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	68(%rsp), %esi
	leaq	96(%rsp), %rdi
	imull	%esi, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	68(%rsp), %esi
	leaq	104(%rsp), %rdi
	imull	%esi, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	68(%rsp), %esi
	leaq	112(%rsp), %rdi
	imull	%esi, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	68(%rsp), %esi
	leaq	120(%rsp), %rdi
	imull	%esi, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	68(%rsp), %esi
	leaq	136(%rsp), %rdi
	imull	%esi, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	68(%rsp), %esi
	leaq	144(%rsp), %rdi
	imull	%esi, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	68(%rsp), %esi
	leaq	128(%rsp), %rdi
	imull	%esi, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	68(%rsp), %esi
	leaq	152(%rsp), %rdi
	imull	%esi, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	68(%rsp), %edx
	movq	72(%rsp), %rdi
	movq	%rbx, %rsi
	movl	$1, %ecx
	imull	%edx, %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	68(%rsp), %edx
	movq	80(%rsp), %rdi
	movq	%r12, %rsi
	movl	$1, %ecx
	imull	%edx, %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movabsq	$549755814016, %rax
	movl	$1, 168(%rsp)
	movq	%rax, 160(%rsp)
	movabsq	$68719476752, %rax
	movq	%rax, 172(%rsp)
	movl	$1, 180(%rsp)
	call	clock@PLT
	movl	180(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	172(%rsp), %rdx
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	xorl	%r8d, %r8d
	movq	%rax, %r15
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L113
	movl	68(%rsp), %ecx
	movq	88(%rsp), %rdx
	movq	80(%rsp), %rsi
	movq	72(%rsp), %rdi
	call	_Z46__device_stub__Z21multiple_matrices_GPUPfS_S_iPfS_S_i
.L113:
	movl	180(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	172(%rsp), %rdx
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L114
	movl	68(%rsp), %edx
	movq	96(%rsp), %rsi
	movq	72(%rsp), %rdi
	call	_Z48__device_stub__Z25transpose_copy_matrix_GPUPfS_iPfS_i
.L114:
	movl	180(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	172(%rsp), %rdx
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L115
	movl	68(%rsp), %edx
	movq	104(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z48__device_stub__Z25transpose_copy_matrix_GPUPfS_iPfS_i
.L115:
	movl	180(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	172(%rsp), %rdx
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L116
	movl	68(%rsp), %edx
	movq	112(%rsp), %rsi
	movq	88(%rsp), %rdi
	call	_Z48__device_stub__Z25transpose_copy_matrix_GPUPfS_iPfS_i
.L116:
	call	cudaDeviceSynchronize@PLT
	movl	180(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	172(%rsp), %rdx
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L117
	movl	68(%rsp), %ecx
	movq	128(%rsp), %rdx
	movq	96(%rsp), %rsi
	movq	72(%rsp), %rdi
	call	_Z46__device_stub__Z21multiple_matrices_GPUPfS_S_iPfS_S_i
.L117:
	call	cudaDeviceSynchronize@PLT
	movl	180(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	172(%rsp), %rdx
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L118
	movl	68(%rsp), %ecx
	movq	136(%rsp), %rdx
	movq	104(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z46__device_stub__Z21multiple_matrices_GPUPfS_S_iPfS_S_i
.L118:
	call	cudaDeviceSynchronize@PLT
	movl	180(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	172(%rsp), %rdx
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L119
	movl	68(%rsp), %ecx
	movq	144(%rsp), %rdx
	movq	112(%rsp), %rsi
	movq	88(%rsp), %rdi
	call	_Z46__device_stub__Z21multiple_matrices_GPUPfS_S_iPfS_S_i
.L119:
	call	cudaDeviceSynchronize@PLT
	movl	180(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	172(%rsp), %rdx
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L120
	movl	68(%rsp), %r8d
	movq	120(%rsp), %rcx
	movq	144(%rsp), %rdx
	movq	136(%rsp), %rsi
	movq	128(%rsp), %rdi
	call	_Z40__device_stub__Z13add_three_GPUPfS_S_S_iPfS_S_S_i
.L120:
	call	cudaDeviceSynchronize@PLT
	movl	68(%rsp), %edx
	movq	88(%rsp), %rsi
	movl	$2, %ecx
	movq	48(%rsp), %rdi
	imull	%edx, %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	68(%rsp), %edx
	movq	96(%rsp), %rsi
	movl	$2, %ecx
	movq	40(%rsp), %rdi
	imull	%edx, %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	68(%rsp), %edx
	movq	120(%rsp), %rsi
	movl	$2, %ecx
	movq	32(%rsp), %rdi
	imull	%edx, %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	call	clock@PLT
	leaq	.LC13(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rax, %r13
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	subq	%r15, %r13
	movq	%rax, %rdi
	imulq	$1000, %r13, %rax
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC11(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC12(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	68(%rsp), %edx
	movq	40(%rsp), %rsi
	movq	%rbp, %rdi
	call	_Z15compare_CPU_GPUPfS_i
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdi
	movss	%xmm0, 60(%rsp)
	call	_Z15compare_CPU_GPUPfS_i
	movss	%xmm0, 56(%rsp)
	call	_Z17max_error_CPU_GPUPfS_i
	leaq	.LC14(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movd	%xmm0, %r15d
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	60(%rsp), %xmm2
	movq	%rax, %rdi
	cvtss2sd	%xmm2, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC15(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	56(%rsp), %xmm1
	movq	%rax, %rdi
	cvtss2sd	%xmm1, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC16(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movd	%r15d, %xmm3
	movq	%rax, %rdi
	cvtss2sd	%xmm3, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	testq	%r13, %r13
	jle	.L121
	leaq	.LC17(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtsi2sdq	%r14, %xmm0
	cvtsi2sdq	%r13, %xmm1
	movq	%rax, %rdi
	divsd	%xmm1, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	jmp	.L126
.L121:
	leaq	.LC18(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L126:
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	48(%rsp), %rdi
	call	free@PLT
	movq	40(%rsp), %rdi
	call	free@PLT
	movq	32(%rsp), %rdi
	call	free@PLT
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movq	96(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rdi
	call	cudaFree@PLT
	movq	112(%rsp), %rdi
	call	cudaFree@PLT
	movq	120(%rsp), %rdi
	call	cudaFree@PLT
	movq	%rbx, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	(%rsp), %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	8(%rsp), %rdi
	call	free@PLT
	movq	16(%rsp), %rdi
	call	free@PLT
	movq	24(%rsp), %rdi
	call	free@PLT
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L123
	call	__stack_chk_fail@PLT
.L123:
	addq	$200, %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
.LFE3915:
	.size	main, .-main
	.text
	.globl	_Z50__device_stub__Z24multiple_matrices_sharedPfS_S_iiPfS_S_ii
	.type	_Z50__device_stub__Z24multiple_matrices_sharedPfS_S_iiPfS_S_ii, @function
_Z50__device_stub__Z24multiple_matrices_sharedPfS_S_iiPfS_S_ii:
.LFB3963:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L129
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z24multiple_matrices_sharedPfS_S_ii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L129:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L131
	call	__stack_chk_fail@PLT
.L131:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3963:
	.size	_Z50__device_stub__Z24multiple_matrices_sharedPfS_S_iiPfS_S_ii, .-_Z50__device_stub__Z24multiple_matrices_sharedPfS_S_iiPfS_S_ii
	.globl	_Z24multiple_matrices_sharedPfS_S_ii
	.type	_Z24multiple_matrices_sharedPfS_S_ii, @function
_Z24multiple_matrices_sharedPfS_S_ii:
.LFB3964:
	.cfi_startproc
	endbr64
	jmp	_Z50__device_stub__Z24multiple_matrices_sharedPfS_S_iiPfS_S_ii
	.cfi_endproc
.LFE3964:
	.size	_Z24multiple_matrices_sharedPfS_S_ii, .-_Z24multiple_matrices_sharedPfS_S_ii
	.section	.rodata.str1.1
.LC19:
	.string	"_Z24multiple_matrices_sharedPfS_S_ii"
.LC20:
	.string	"_Z13add_three_GPUPfS_S_S_i"
.LC21:
	.string	"_Z25transpose_copy_matrix_GPUPfS_i"
.LC22:
	.string	"_Z20transpose_matrix_GPUPfi"
.LC23:
	.string	"_Z21multiple_matrices_GPUPfS_S_i"
.LC24:
	.string	"_Z16add_matrices_GPUPfS_S_i"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3966:
	.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	.LC19(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z24multiple_matrices_sharedPfS_S_ii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC20(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z13add_three_GPUPfS_S_S_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC21(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z25transpose_copy_matrix_GPUPfS_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC22(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z20transpose_matrix_GPUPfi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC23(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z21multiple_matrices_GPUPfS_S_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC24(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z16add_matrices_GPUPfS_S_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3966:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC8:
	.long	-4194304
	.long	1105199103
	.align 8
.LC9:
	.long	0
	.long	1072693248
	.align 8
.LC11:
	.long	0
	.long	1093567616
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include "hip/hip_runtime.h"


#include <stdio.h>
#include <iostream>
#include <stdlib.h> 
#include <time.h> 
#include <iomanip>


void print_matrix(float* A, int n);

void print_matrix_code(float* A, int n);

void multiple_matrices(float* A, float* B, float* C, int n);

void add_matrices(float* A, float* B, float* C, int n);

void transpose_matrix(float* A, int n);

void copy_matrix(float* S, float* D, int n);

void normalize_vector(float* A, float* unit_vec_array, int n, int j);

float dot_product(float* A, float* unit_vec_array, int n, int jU, int jA);

void substract_vec(float* A, float* B, float* R, int n, int jA, int jB, int jR, float mn_B = 1.0, float mn_A = 1.0);

void amt_matrices(float* A, float* B, float* C, float* A_T, float* B_T, float* C_T, float* D, int n);

float compare_CPU_GPU(float* A_CPU, float* A_GPU, int n);

float max_error_CPU_GPU(float* A_CPU, float* A_GPU, int n);

float max_element(float* A, int n);
//===========================================================================================

__global__ void add_matrices_GPU(float* A, float* B, float* C, int n)
{

	int id_i = (blockIdx.x * blockDim.x + threadIdx.x);
	int id_j = (blockIdx.y * blockDim.y + threadIdx.y);
	//Dodawanie
	//-----------------------------------
	for (int i = id_i; i < n; i += blockDim.x + gridDim.x)
	{
		for (int j = id_j; j < n; j += blockDim.y + gridDim.y)
		{
			*(C + i * n + j) = (*(A + i * n + j) + *(B + i * n + j));
			//printf("%i, %i, %f\n", i, j, *(A + i * n + j));
		}
	}
	//-----------------------------------
}
__global__ void multiple_matrices_GPU(float* A, float* B, float* C, int n)
{

	int id_i = (blockIdx.x * blockDim.x + threadIdx.x);
	int id_j = (blockIdx.y * blockDim.y + threadIdx.y);
	int stride = blockDim.x * gridDim.x;
	//Mnozenie
	//-----------------------------------
	for (int i = id_i; i < n; i += stride)
	{
		for (int j = id_j; j < n; j += stride)
		{
			float C_ij = 0;
			for (int kAB = 0; kAB < n; kAB++)
			{
				C_ij += (*(A + i * n + kAB)) * (*(B + kAB * n + j));
			}
			*(C + i * n + j) = C_ij;
		}
	}
	//-----------------------------------
}

__global__ void transpose_matrix_GPU(float* A, int n)
{

	//Moze transponowanie z kopiowaniem ??? (zapisywac do innej macierzy - bedzie nawet łatwiej - bez buffa) 
	int id_i = (blockIdx.x * blockDim.x + threadIdx.x);
	int id_j = (blockIdx.y * blockDim.y + threadIdx.y);
	int stride = blockDim.x * gridDim.x;
	float buff = 0;
	//Transponowanie
	//-----------------------------------
	for (int i = id_i; i < n; i += stride)
	{
		for (int j = id_j; j < i; j += stride)
		{
			buff = *(A + i * n + j);
			*(A + i * n + j) = *(A + j * n + i);
			*(A + j * n + i) = buff;
		}
	}
	//-----------------------------------
}

__global__ void transpose_copy_matrix_GPU(float* A, float* A_T, int n)
{

	//Moze transponowanie z kopiowaniem ??? (zapisywac do innej macierzy - bedzie nawet łatwiej - bez buffa) 
	int id_i = (blockIdx.x * blockDim.x + threadIdx.x);
	int id_j = (blockIdx.y * blockDim.y + threadIdx.y);
	int stride_x = blockDim.x * gridDim.x;
	int stride_y = blockDim.y * gridDim.y;

	//Transponowanie
	//-----------------------------------
	for (int i = id_i; i < n; i += stride_x)
	{
		for (int j = id_j; j < n; j += stride_y)
		{
			*(A_T + i * n + j) = *(A + j * n + i);
		}
	}
	//-----------------------------------
}

__global__ void add_three_GPU(float* A, float* B, float* C, float* D, int n)
{

	int id_i = (blockIdx.x * blockDim.x + threadIdx.x);
	int id_j = (blockIdx.y * blockDim.y + threadIdx.y);
	//Dodawanie
	//-----------------------------------
	for (int i = id_i; i < n; i += blockDim.x + gridDim.x)
	{
		for (int j = id_j; j < n; j += blockDim.y + gridDim.y)
		{
			*(D + i * n + j) = *(A + i * n + j) + *(B + i * n + j) + *(C + i * n + j);
		}
	}
	//-----------------------------------
}

__global__ void multiple_matrices_shared(float* A, float* B, float* C, int n, const int bl_size)
{
	//Indeksy podbloku macierzy wynikowej C
	int blockRow = blockIdx.y;
	int blockCol = blockIdx.x;

	//Indeksy w podbloku
	int row = threadIdx.y;
	int col = threadIdx.x;

	
	for (int i = 0; i < (n / bl_size); i++)
	{
		//__shared__ float As[bl_size][bl_size];
		//__shared__ float Bs[bl_size][bl_size];
	}
}
//===========================================================================================


int main()
{
	bool if_print = false;
	bool if_print_GPU = false;

	srand(time(NULL));

	int n = 1;
	std::cout << "Give n: ";
	std::cin >> n;

	//Allocate memory

	//Macierze dla obliczen na CPU
	float* A = (float*)malloc(n * n * sizeof(float));
	float* B = (float*)malloc(n * n * sizeof(float));
	float* C = (float*)malloc(n * n * sizeof(float));

	float* A_T = (float*)malloc(n * n * sizeof(float));
	float* B_T = (float*)malloc(n * n * sizeof(float));
	float* C_T = (float*)malloc(n * n * sizeof(float));

	float* D = (float*)malloc(n * n * sizeof(float));

	// Initialize with random floats
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			*(A + i * n + j) = (2.0 * rand() / RAND_MAX) - 1.0;
			*(B + i * n + j) = (2.0 * rand() / RAND_MAX) - 1.0;
			
			*(A_T + i * n + j) = *(A + i * n + j);
			*(B_T + i * n + j) = *(B + i * n + j);
		}
	}

	//Obliczenia CPU
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	clock_t start_CPU = clock();

	multiple_matrices(A, B, C, n);
	transpose_matrix(A_T, n);
	transpose_matrix(B_T, n);

	copy_matrix(C, C_T, n);
	transpose_matrix(C_T, n);

	amt_matrices(A, B, C, A_T, B_T, C_T, D, n);



	clock_t stop_CPU = clock();
	//Print
	//====================================
	if (if_print)
	{
		std::cout << "\nA\n";
		print_matrix(A, n);

		std::cout << "\nB\n";
		print_matrix(B, n);

		std::cout << "\nC\n";
		print_matrix(C, n);

		std::cout << "\nA_T\n";
		print_matrix(A_T, n);

		std::cout << "\nD\n";
		print_matrix(D, n);

	}
	//====================================


	std::cout << "Czas_CPU: " << 1000 * (stop_CPU - start_CPU) / ((double)CLOCKS_PER_SEC) << " ms" << std::endl;
	//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


	//Same GPU
	//=================================================================================================

	//Macierze do skopiowania wynikow GPU
	float* C_h = (float*)malloc(n * n * sizeof(float));
	float* A_T_h = (float*)malloc(n * n * sizeof(float));
	float* B_T_h = (float*)malloc(n * n * sizeof(float));
	float* C_T_h = (float*)malloc(n * n * sizeof(float));
	float* D_h = (float*)malloc(n * n * sizeof(float));


	float* A_dev;
	float* B_dev;
	float* C_dev;

	float* A_T_dev;
	float* B_T_dev;
	float* C_T_dev;

	float* D_dev;
	float* D_A_dev;//Pomocnicze - B*B_T
	float* D_B_dev;//Pomocnicze - B*B_T
	float* D_C_dev;//Pomocnicze - C*C_T

	float* D_AB_dev;//Pomocnicze - B*B_T


	//Alokacja
	hipMalloc(&A_dev, n * n * sizeof(float));
	hipMalloc(&B_dev, n * n * sizeof(float));
	hipMalloc(&C_dev, n * n * sizeof(float));

	hipMalloc(&A_T_dev, n * n * sizeof(float));
	hipMalloc(&B_T_dev, n * n * sizeof(float));
	hipMalloc(&C_T_dev, n * n * sizeof(float));

	hipMalloc(&D_dev, n * n * sizeof(float));
	hipMalloc(&D_B_dev, n * n * sizeof(float));
	hipMalloc(&D_C_dev, n * n * sizeof(float));
	hipMalloc(&D_A_dev, n * n * sizeof(float));
	hipMalloc(&D_AB_dev, n * n * sizeof(float));

	//Kopiowanie na Device
	hipMemcpy(A_dev, A, n * n * sizeof(float), hipMemcpyHostToDevice);
	hipMemcpy(B_dev, B, n * n * sizeof(float), hipMemcpyHostToDevice);


	int BLOCK_SIZE = 128;
	int GRID_SIZE = 16;
	dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);
	dim3 dimGrid(GRID_SIZE, GRID_SIZE);

	//obliczenia GPU
	clock_t start_GPU = clock();
	//C
	multiple_matrices_GPU <<<dimBlock, dimGrid >>> (A_dev, B_dev, C_dev, n);
	//Transpozycje
	transpose_copy_matrix_GPU <<<dimBlock, dimGrid >>> (A_dev, A_T_dev, n);
	transpose_copy_matrix_GPU <<<dimBlock, dimGrid >>> (B_dev, B_T_dev, n);
	transpose_copy_matrix_GPU <<<dimBlock, dimGrid >>> (C_dev, C_T_dev, n);
	
	// D matrix
	hipDeviceSynchronize();
	multiple_matrices_GPU <<<dimBlock, dimGrid >>> (A_dev, A_T_dev, D_A_dev, n);
	hipDeviceSynchronize();

	multiple_matrices_GPU <<<dimBlock, dimGrid >>> (B_dev, B_T_dev, D_B_dev, n);
	hipDeviceSynchronize();

	multiple_matrices_GPU <<<dimBlock, dimGrid >>> (C_dev, C_T_dev, D_C_dev, n);
	hipDeviceSynchronize();


	add_three_GPU <<<dimBlock, dimGrid >>> (D_A_dev, D_B_dev, D_C_dev, D_dev, n);

	hipDeviceSynchronize();


	//Kopiowanie na Hosta
	hipMemcpy(C_h, C_dev, n * n * sizeof(float), hipMemcpyDeviceToHost);
	hipMemcpy(A_T_h, A_T_dev, n * n * sizeof(float), hipMemcpyDeviceToHost);
	hipMemcpy(D_h, D_dev, n * n * sizeof(float), hipMemcpyDeviceToHost);

	//Stop 
	clock_t stop_GPU = clock();


	if (if_print_GPU)
	{
		std::cout << "\nA\n";
		print_matrix(A, n);

		std::cout << "\nB\n";
		print_matrix(B, n);

		std::cout << "\nC_h\n";
		print_matrix(C_h, n);

		std::cout << "\nA_T_h\n";
		print_matrix(A_T_h, n);

		std::cout << "\nD_h\n";
		print_matrix(D_h, n);

	}

	//Porownanie GPU i CPU
	std::cout << "Czas_GPU: " << 1000 * (stop_GPU - start_GPU) / ((double)CLOCKS_PER_SEC) << " ms" << std::endl;
	float C_error = compare_CPU_GPU(A_T, A_T_h, n);
	//std::cout << "D errory: " << std::endl;
	float D_error = compare_CPU_GPU(D, D_h, n);
	float Max_D_error = max_error_CPU_GPU(D, D_h, n);


	std::cout << "Blad w C: " << C_error << std::endl;
	std::cout << "Blad w D: " << D_error << std::endl;
	std::cout << "Maksymalny blad w D: " << Max_D_error << std::endl;


	if (stop_GPU - start_GPU > 0)
	{
		std::cout << "Speedup: " << 1.0 * (stop_CPU - start_CPU) / (stop_GPU - start_GPU) << std::endl;
	}
	else
	{
		std::cout << "Czas obliczen zbyt krotki by okreslic speedup" << std::endl;
	}
	//=================================================================================================
	
	//Zwolnienie pamieci macierzy od GPU
	free(C_h);
	free(A_T_h);
	free(B_T_h);
	free(C_T_h);
	free(D_h);

	//Zwolnienie pamieci  GPU
	hipFree(A_dev);
	hipFree(B_dev);
	hipFree(C_dev);
	hipFree(A_T_dev);
	hipFree(B_T_dev);
	hipFree(C_T_dev);
	hipFree(D_dev);

	//Zwolnienie pamieci macierzy od CPU
	free(A);
	free(B);
	free(C);
	free(A_T);
	free(B_T);
	free(C_T);
	free(D);


	return 0;
}




//##################################################################################3
float compare_CPU_GPU(float* A_CPU, float* A_GPU, int n)
{
	float error = 0.0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			error += powf(*(A_CPU + i * n + j) - *(A_GPU + i * n + j), 2.0);
		}
	}
	return error;
}

float max_error_CPU_GPU(float* A_CPU, float* A_GPU, int n)
{
	float max_error = 0.0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			float error = powf(*(A_CPU + i * n + j) - *(A_GPU + i * n + j), 2.0);
			if (error > max_error)
			{
				//std::cout << "*(A_CPU + i * n + j): " << *(A_CPU + i * n + j) << "\n *(A_GPU + i * n + j): " << *(A_GPU + i * n + j) << "\n\n";
				max_error = error;
			}

		}
	}
	return max_error;
}
float max_element(float* A, int n)
{
	float max_el = 0.0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (*(A + i * n + j) > max_el)
			{
				//std::cout << "*(A + i * n + j): " << *(A + i * n + j) << "\n\n";
				max_el = *(A + i * n + j);
			}

		}
	}
	return max_el;
}


void print_matrix(float* A, int n)
{
	for (int i = 0; i < n; i++)
	{

		for (int j = 0; j < n; j++)
		{
			std::cout << std::setw(12) << *(A + i * n + j) << " ";
		}
		std::cout << "\n";
	}
}

void print_matrix_code(float* A, int n)
{
	//WYPISANIE KOLUMNAMI
	std::cout << "[";
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			std::cout << *(A + j * n + i);
			if (j != n - 1)
				std::cout << ",";
		}
		if (i != n - 1)
			std::cout << "; ";
	}
	std::cout << "]";
}

void multiple_matrices(float* A, float* B, float* C, int n)
{
	//Mnozenie
	//-----------------------------------
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			//std::cout << "\n\n" << i << ", " << j << ": \n";
			float C_ij = 0;
			for (int kAB = 0; kAB < n; kAB++)
			{
				C_ij += (*(A + i * n + kAB)) * (*(B + kAB * n + j));
				//std::cout << "A " << i << ", " << kAB << "    *B " << kAB << ", " << j <<  "    : " << C_ij << "\n";				
			}
			*(C + i * n + j) = C_ij;
		}
	}
	//-----------------------------------
}

void add_matrices(float* A, float* B, float* C, int n)
{
	//Dodawanie
	//-----------------------------------
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			*(C + i * n + j) = (*(A + i * n + j) + *(B + i * n + j));
		}
	}
	//-----------------------------------
}

void transpose_matrix(float* A, int n)
{
	//Transponowanie
	//-----------------------------------
	float buff = 0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < i; j++)
		{
			buff = *(A + i * n + j);
			*(A + i * n + j) = *(A + j * n + i);
			*(A + j * n + i) = buff;
		}
	}
	//-----------------------------------
}

void copy_matrix(float* S, float* D, int n)
{
	//Kopiowanie
	//-----------------------------------
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			*(D + i * n + j) = *(S + i * n + j);
		}
	}
	//-----------------------------------
}

void normalize_vector(float* A, float* unit_vec_array, int n, int j)
{
	//Normalizing column vector (matrix A, col j) 
	//-----------------------------------
	float norm = 0.0;
	for (int i = 0; i < n; i++)//calculate norm
	{
		norm += pow(*(A + i * n + j), 2.0);
	}
	norm = sqrt(norm);

	for (int i = 0; i < n; i++)//calculate unit vector
	{
		*(unit_vec_array + i * n + j) = *(A + i * n + j) / norm;
	}
	//-----------------------------------
}

float dot_product(float* A, float* unit_vec_array, int n, int jU, int jA)
{
	float d_p = 0;
	//Iloczyn skalarny
	//-----------------------------------

	for (int i = 0; i < n; i++)//calculate unit vector
	{
		d_p += (*(unit_vec_array + i * n + jU)) * (*(A + i * n + jA));
		//std::cout << "i: " << i << ",  u_vec_a: = " << *(unit_vec_array + i * n + jU) << ", A_element = " << *(A + i * n + jA) << ",  d_p: " << d_p << "\n";
	}
	return d_p;
	//-----------------------------------
}

void substract_vec(float* A, float* B, float* R, int n, int jA, int jB, int jR, float mn_B, float mn_A)//mn - mnoznik
{
	float d_p = 0;
	//Odejmowanie
	//-----------------------------------
	for (int i = 0; i < n; i++)//calculate unit vector
	{
		//std::cout << "i: " << i << ", A_el = " << *(A + i * n + jA) << "\n";
		*(R + i * n + jR) = mn_A * (*(A + i * n + jA)) - mn_B * (*(B + i * n + jB));
		//std::cout << "i: "<< i << ",  R_el = " << *(R + i * n + jR) << ", A_el = " << *(A + i * n + jA) << ",  B_el =   " << *(B + i * n + jB) 
		//	<< ", B_el_multiplied = " << mn_B * (*(B + i * n + jB)) <<  "\n";
	}
	//-----------------------------------
}

void amt_matrices(float* A, float* B, float* C, float* A_T, float* B_T, float* C_T, float* D, int n)
{
	//D = A*A_T + B*B_T + C*C_T
	float* AA_T = (float*)malloc(n * n * sizeof(float));
	float* BB_T = (float*)malloc(n * n * sizeof(float));
	float* CC_T = (float*)malloc(n * n * sizeof(float));

	multiple_matrices(A, A_T, AA_T, n);
	multiple_matrices(B, B_T, BB_T, n);
	multiple_matrices(C, C_T, CC_T, n);
	add_matrices(AA_T, BB_T, D, n);
	add_matrices(D, CC_T, D, n);

	free(AA_T);
	free(BB_T);
	free(CC_T);
}


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

                                        # End of file scope inline assembly
	.globl	_Z31__device_stub__add_matrices_GPUPfS_S_i # -- Begin function _Z31__device_stub__add_matrices_GPUPfS_S_i
	.type	_Z31__device_stub__add_matrices_GPUPfS_S_i,@function
_Z31__device_stub__add_matrices_GPUPfS_S_i: # @_Z31__device_stub__add_matrices_GPUPfS_S_i
	.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	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z16add_matrices_GPUPfS_S_i, %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_end0:
	.size	_Z31__device_stub__add_matrices_GPUPfS_S_i, .Lfunc_end0-_Z31__device_stub__add_matrices_GPUPfS_S_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z36__device_stub__multiple_matrices_GPUPfS_S_i # -- Begin function _Z36__device_stub__multiple_matrices_GPUPfS_S_i
	.type	_Z36__device_stub__multiple_matrices_GPUPfS_S_i,@function
_Z36__device_stub__multiple_matrices_GPUPfS_S_i: # @_Z36__device_stub__multiple_matrices_GPUPfS_S_i
	.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	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z21multiple_matrices_GPUPfS_S_i, %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_end1:
	.size	_Z36__device_stub__multiple_matrices_GPUPfS_S_i, .Lfunc_end1-_Z36__device_stub__multiple_matrices_GPUPfS_S_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z35__device_stub__transpose_matrix_GPUPfi # -- Begin function _Z35__device_stub__transpose_matrix_GPUPfi
	.type	_Z35__device_stub__transpose_matrix_GPUPfi,@function
_Z35__device_stub__transpose_matrix_GPUPfi: # @_Z35__device_stub__transpose_matrix_GPUPfi
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	4(%rsp), %rcx
	movl	%esi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z20transpose_matrix_GPUPfi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z35__device_stub__transpose_matrix_GPUPfi, .Lfunc_end2-_Z35__device_stub__transpose_matrix_GPUPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z40__device_stub__transpose_copy_matrix_GPUPfS_i # -- Begin function _Z40__device_stub__transpose_copy_matrix_GPUPfS_i
	.type	_Z40__device_stub__transpose_copy_matrix_GPUPfS_i,@function
_Z40__device_stub__transpose_copy_matrix_GPUPfS_i: # @_Z40__device_stub__transpose_copy_matrix_GPUPfS_i
	.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	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%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	$_Z25transpose_copy_matrix_GPUPfS_i, %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	_Z40__device_stub__transpose_copy_matrix_GPUPfS_i, .Lfunc_end3-_Z40__device_stub__transpose_copy_matrix_GPUPfS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z28__device_stub__add_three_GPUPfS_S_S_i # -- Begin function _Z28__device_stub__add_three_GPUPfS_S_S_i
	.type	_Z28__device_stub__add_three_GPUPfS_S_S_i,@function
_Z28__device_stub__add_three_GPUPfS_S_S_i: # @_Z28__device_stub__add_three_GPUPfS_S_S_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	12(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%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	$_Z13add_three_GPUPfS_S_S_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z28__device_stub__add_three_GPUPfS_S_S_i, .Lfunc_end4-_Z28__device_stub__add_three_GPUPfS_S_S_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z39__device_stub__multiple_matrices_sharedPfS_S_ii # -- Begin function _Z39__device_stub__multiple_matrices_sharedPfS_S_ii
	.type	_Z39__device_stub__multiple_matrices_sharedPfS_S_ii,@function
_Z39__device_stub__multiple_matrices_sharedPfS_S_ii: # @_Z39__device_stub__multiple_matrices_sharedPfS_S_ii
	.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	$128, %rsp
	.cfi_def_cfa_offset 176
	.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	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%rsp), %rdx
	movl	%ecx, (%rdx)
	movq	%rsp, %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z24multiple_matrices_sharedPfS_S_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	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_end5:
	.size	_Z39__device_stub__multiple_matrices_sharedPfS_S_ii, .Lfunc_end5-_Z39__device_stub__multiple_matrices_sharedPfS_S_ii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI6_0:
	.quad	0x41dfffffffc00000              # double 2147483647
.LCPI6_1:
	.quad	0xbff0000000000000              # double -1
.LCPI6_2:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$200, %rsp
	.cfi_def_cfa_offset 256
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	leaq	4(%rsp), %rbx
	movl	$1, (%rbx)
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$8, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt3cin, %edi
	movq	%rbx, %rsi
	callq	_ZNSirsERi
	movl	(%rbx), %r13d
	movl	%r13d, %ebx
	imull	%ebx, %ebx
	shlq	$2, %rbx
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 56(%rsp)                  # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 104(%rsp)                 # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 152(%rsp)                 # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	xorl	%ecx, %ecx
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	testl	%r13d, %r13d
	jle	.LBB6_5
.LBB6_1:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_3 Depth 2
	testl	%r13d, %r13d
	jle	.LBB6_4
# %bb.2:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB6_1 Depth=1
	movslq	%ecx, %rax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movq	56(%rsp), %r14                  # 8-byte Reload
	movq	64(%rsp), %rbp                  # 8-byte Reload
	movq	24(%rsp), %r15                  # 8-byte Reload
	movq	48(%rsp), %r12                  # 8-byte Reload
	xorl	%ebx, %ebx
.LBB6_3:                                # %.lr.ph
                                        #   Parent Loop BB6_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%rcx, %r13
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	addsd	%xmm0, %xmm0
	divsd	.LCPI6_0(%rip), %xmm0
	addsd	.LCPI6_1(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movslq	4(%rsp), %rax
	imulq	8(%rsp), %rax                   # 8-byte Folded Reload
	movss	%xmm0, (%rbp,%rax,4)
	callq	rand
	movsd	.LCPI6_1(%rip), %xmm2           # xmm2 = mem[0],zero
	movsd	.LCPI6_0(%rip), %xmm1           # xmm1 = mem[0],zero
	movq	%r13, %rcx
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	addsd	%xmm0, %xmm0
	divsd	%xmm1, %xmm0
	addsd	%xmm2, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movslq	4(%rsp), %r13
	movl	%ecx, %eax
	imull	%r13d, %eax
	cltq
	movss	%xmm0, (%r14,%rax,4)
	movss	(%rbp,%rax,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	movss	%xmm1, (%r15,%rax,4)
	movss	%xmm0, (%r12,%rax,4)
	incq	%rbx
	addq	$4, %r12
	addq	$4, %r15
	addq	$4, %rbp
	addq	$4, %r14
	cmpq	%r13, %rbx
	jl	.LBB6_3
.LBB6_4:                                # %._crit_edge
                                        #   in Loop: Header=BB6_1 Depth=1
	incl	%ecx
	cmpl	%r13d, %ecx
	jl	.LBB6_1
.LBB6_5:                                # %._crit_edge275
	callq	clock
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movl	4(%rsp), %ebx
	testl	%ebx, %ebx
	movq	56(%rsp), %rsi                  # 8-byte Reload
	movq	104(%rsp), %r12                 # 8-byte Reload
	movq	152(%rsp), %r9                  # 8-byte Reload
	movq	16(%rsp), %rbp                  # 8-byte Reload
	jle	.LBB6_29
# %bb.6:                                # %.preheader26.lr.ph.i
	leaq	(,%rbx,4), %r13
	xorl	%eax, %eax
	movq	64(%rsp), %rcx                  # 8-byte Reload
.LBB6_7:                                # %.preheader.lr.ph.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_8 Depth 2
                                        #       Child Loop BB6_9 Depth 3
	movq	%rax, %rdx
	imulq	%rbx, %rdx
	leaq	(%r12,%rdx,4), %rdx
	movq	%rsi, %r10
	xorl	%edi, %edi
.LBB6_8:                                # %.preheader.i
                                        #   Parent Loop BB6_7 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB6_9 Depth 3
	xorps	%xmm0, %xmm0
	movq	%r10, %r8
	xorl	%r11d, %r11d
.LBB6_9:                                #   Parent Loop BB6_7 Depth=1
                                        #     Parent Loop BB6_8 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%rcx,%r11), %xmm1              # xmm1 = mem[0],zero,zero,zero
	mulss	(%r8), %xmm1
	addss	%xmm1, %xmm0
	addq	$4, %r11
	addq	%r13, %r8
	cmpq	%r11, %r13
	jne	.LBB6_9
# %bb.10:                               # %._crit_edge.i
                                        #   in Loop: Header=BB6_8 Depth=2
	movss	%xmm0, (%rdx,%rdi,4)
	incq	%rdi
	addq	$4, %r10
	cmpq	%rbx, %rdi
	jne	.LBB6_8
# %bb.11:                               # %._crit_edge30.i
                                        #   in Loop: Header=BB6_7 Depth=1
	incq	%rax
	addq	%r13, %rcx
	cmpq	%rbx, %rax
	jne	.LBB6_7
# %bb.12:                               # %.preheader.i160.preheader
	xorl	%eax, %eax
	movq	24(%rsp), %rdx                  # 8-byte Reload
	movq	%rdx, %rcx
.LBB6_13:                               # %.preheader.i160
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_15 Depth 2
	testq	%rax, %rax
	je	.LBB6_16
# %bb.14:                               # %.lr.ph.i
                                        #   in Loop: Header=BB6_13 Depth=1
	movq	%rdx, %r8
	xorl	%edi, %edi
.LBB6_15:                               #   Parent Loop BB6_13 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rcx,%rdi,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	(%r8), %xmm1                    # xmm1 = mem[0],zero,zero,zero
	movss	%xmm1, (%rcx,%rdi,4)
	movss	%xmm0, (%r8)
	incq	%rdi
	addq	%r13, %r8
	cmpq	%rdi, %rax
	jne	.LBB6_15
.LBB6_16:                               # %._crit_edge.i166
                                        #   in Loop: Header=BB6_13 Depth=1
	incq	%rax
	addq	$4, %rdx
	addq	%r13, %rcx
	cmpq	%rbx, %rax
	jne	.LBB6_13
# %bb.17:                               # %.preheader.i169.preheader
	xorl	%eax, %eax
	movq	48(%rsp), %rdx                  # 8-byte Reload
	movq	%rdx, %rcx
.LBB6_18:                               # %.preheader.i169
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_20 Depth 2
	testq	%rax, %rax
	je	.LBB6_21
# %bb.19:                               # %.lr.ph.i172
                                        #   in Loop: Header=BB6_18 Depth=1
	movq	%rdx, %rsi
	xorl	%edi, %edi
.LBB6_20:                               #   Parent Loop BB6_18 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rcx,%rdi,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	(%rsi), %xmm1                   # xmm1 = mem[0],zero,zero,zero
	movss	%xmm1, (%rcx,%rdi,4)
	movss	%xmm0, (%rsi)
	incq	%rdi
	addq	%r13, %rsi
	cmpq	%rdi, %rax
	jne	.LBB6_20
.LBB6_21:                               # %._crit_edge.i178
                                        #   in Loop: Header=BB6_18 Depth=1
	incq	%rax
	addq	$4, %rdx
	addq	%r13, %rcx
	cmpq	%rbx, %rax
	jne	.LBB6_18
# %bb.22:                               # %.preheader.lr.ph.i182
	xorl	%r14d, %r14d
	movq	%r9, %rbp
	movq	%rbx, %r15
.LBB6_23:                               # %.lr.ph.i183
                                        # =>This Inner Loop Header: Depth=1
	leaq	(%r14,%rbp), %rdi
	leaq	(%r12,%r14), %rsi
	movq	%r13, %rdx
	callq	memcpy@PLT
	addq	%r13, %r14
	decq	%r15
	jne	.LBB6_23
# %bb.24:                               # %.preheader.i190.preheader
	xorl	%eax, %eax
	movq	%rbp, %rcx
	movq	%rbp, %rdx
	movq	%rbp, %r9
	movq	16(%rsp), %rbp                  # 8-byte Reload
	movq	56(%rsp), %rsi                  # 8-byte Reload
.LBB6_25:                               # %.preheader.i190
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_27 Depth 2
	testq	%rax, %rax
	je	.LBB6_28
# %bb.26:                               # %.lr.ph.i193
                                        #   in Loop: Header=BB6_25 Depth=1
	movq	%rdx, %r8
	xorl	%edi, %edi
.LBB6_27:                               #   Parent Loop BB6_25 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rcx,%rdi,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	(%r8), %xmm1                    # xmm1 = mem[0],zero,zero,zero
	movss	%xmm1, (%rcx,%rdi,4)
	movss	%xmm0, (%r8)
	incq	%rdi
	addq	%r13, %r8
	cmpq	%rdi, %rax
	jne	.LBB6_27
.LBB6_28:                               # %._crit_edge.i199
                                        #   in Loop: Header=BB6_25 Depth=1
	incq	%rax
	addq	$4, %rdx
	addq	%r13, %rcx
	cmpq	%rbx, %rax
	jne	.LBB6_25
.LBB6_29:                               # %_Z16transpose_matrixPfi.exit202
	movabsq	$68719476752, %r15              # imm = 0x1000000010
	movq	64(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rdi
	movq	%r12, %rdx
	movq	24(%rsp), %rcx                  # 8-byte Reload
	movq	48(%rsp), %r8                   # 8-byte Reload
	pushq	%rbx
	.cfi_adjust_cfa_offset 8
	pushq	%rbp
	.cfi_adjust_cfa_offset 8
	movq	%rsi, %r12
	callq	_Z12amt_matricesPfS_S_S_S_S_S_i
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	callq	clock
	movq	%rax, %rbx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$10, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	subq	8(%rsp), %rbx                   # 8-byte Folded Reload
	movq	%rbx, 184(%rsp)                 # 8-byte Spill
	imulq	$1000, %rbx, %rax               # imm = 0x3E8
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI6_2(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.7, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	4(%rsp), %ebx
	imull	%ebx, %ebx
	shlq	$2, %rbx
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	leaq	88(%rsp), %r13
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	movl	4(%rsp), %esi
	imull	%esi, %esi
	shlq	$2, %rsi
	leaq	80(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipMalloc
	movl	4(%rsp), %esi
	imull	%esi, %esi
	shlq	$2, %rsi
	leaq	32(%rsp), %rdi
	callq	hipMalloc
	movl	4(%rsp), %esi
	imull	%esi, %esi
	shlq	$2, %rsi
	leaq	72(%rsp), %rdi
	callq	hipMalloc
	movl	4(%rsp), %esi
	imull	%esi, %esi
	shlq	$2, %rsi
	leaq	128(%rsp), %rdi
	callq	hipMalloc
	movl	4(%rsp), %esi
	imull	%esi, %esi
	shlq	$2, %rsi
	leaq	120(%rsp), %rdi
	callq	hipMalloc
	movl	4(%rsp), %esi
	imull	%esi, %esi
	shlq	$2, %rsi
	leaq	112(%rsp), %rdi
	callq	hipMalloc
	movl	4(%rsp), %esi
	imull	%esi, %esi
	shlq	$2, %rsi
	leaq	168(%rsp), %rdi
	callq	hipMalloc
	movl	4(%rsp), %esi
	imull	%esi, %esi
	shlq	$2, %rsi
	leaq	160(%rsp), %rdi
	callq	hipMalloc
	movl	4(%rsp), %esi
	imull	%esi, %esi
	shlq	$2, %rsi
	leaq	176(%rsp), %rdi
	callq	hipMalloc
	movl	4(%rsp), %esi
	imull	%esi, %esi
	shlq	$2, %rsi
	leaq	192(%rsp), %rdi
	callq	hipMalloc
	movq	(%r13), %rdi
	movl	4(%rsp), %edx
	imull	%edx, %edx
	shlq	$2, %rdx
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rbx), %rdi
	movq	%r15, %rbx
	movabsq	$549755814016, %r15             # imm = 0x8000000080
	movl	4(%rsp), %edx
	imull	%edx, %edx
	shlq	$2, %rdx
	movq	%r12, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	callq	clock
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_31
# %bb.30:
	movq	88(%rsp), %rdi
	movq	80(%rsp), %rsi
	movq	32(%rsp), %rdx
	movl	4(%rsp), %ecx
	callq	_Z36__device_stub__multiple_matrices_GPUPfS_S_i
.LBB6_31:
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_33
# %bb.32:
	movq	88(%rsp), %rdi
	movq	72(%rsp), %rsi
	movl	4(%rsp), %edx
	callq	_Z40__device_stub__transpose_copy_matrix_GPUPfS_i
.LBB6_33:
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	movq	16(%rsp), %r14                  # 8-byte Reload
	movq	96(%rsp), %r12                  # 8-byte Reload
	jne	.LBB6_35
# %bb.34:
	movq	80(%rsp), %rdi
	movq	128(%rsp), %rsi
	movl	4(%rsp), %edx
	callq	_Z40__device_stub__transpose_copy_matrix_GPUPfS_i
.LBB6_35:
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_37
# %bb.36:
	movq	32(%rsp), %rdi
	movq	120(%rsp), %rsi
	movl	4(%rsp), %edx
	callq	_Z40__device_stub__transpose_copy_matrix_GPUPfS_i
.LBB6_37:
	callq	hipDeviceSynchronize
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_39
# %bb.38:
	movq	88(%rsp), %rdi
	movq	72(%rsp), %rsi
	movq	176(%rsp), %rdx
	movl	4(%rsp), %ecx
	callq	_Z36__device_stub__multiple_matrices_GPUPfS_S_i
.LBB6_39:
	callq	hipDeviceSynchronize
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_41
# %bb.40:
	movq	80(%rsp), %rdi
	movq	128(%rsp), %rsi
	movq	168(%rsp), %rdx
	movl	4(%rsp), %ecx
	callq	_Z36__device_stub__multiple_matrices_GPUPfS_S_i
.LBB6_41:
	callq	hipDeviceSynchronize
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_43
# %bb.42:
	movq	32(%rsp), %rdi
	movq	120(%rsp), %rsi
	movq	160(%rsp), %rdx
	movl	4(%rsp), %ecx
	callq	_Z36__device_stub__multiple_matrices_GPUPfS_S_i
.LBB6_43:
	callq	hipDeviceSynchronize
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_45
# %bb.44:
	movq	176(%rsp), %rdi
	movq	168(%rsp), %rsi
	movq	160(%rsp), %rdx
	movq	112(%rsp), %rcx
	movl	4(%rsp), %r8d
	callq	_Z28__device_stub__add_three_GPUPfS_S_S_i
.LBB6_45:
	callq	hipDeviceSynchronize
	movq	32(%rsp), %rsi
	movl	4(%rsp), %edx
	imull	%edx, %edx
	shlq	$2, %rdx
	movq	8(%rsp), %rdi                   # 8-byte Reload
	movl	$2, %ecx
	callq	hipMemcpy
	movq	72(%rsp), %rsi
	movl	4(%rsp), %edx
	imull	%edx, %edx
	shlq	$2, %rdx
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movq	112(%rsp), %rsi
	movl	4(%rsp), %edx
	imull	%edx, %edx
	shlq	$2, %rdx
	movq	%r12, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	callq	clock
	movq	%rax, %r13
	movl	$_ZSt4cout, %edi
	movl	$.L.str.11, %esi
	movl	$10, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	subq	40(%rsp), %r13                  # 8-byte Folded Reload
	imulq	$1000, %r13, %rax               # imm = 0x3E8
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI6_2(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.7, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.LBB6_46
# %bb.47:                               # %.preheader.lr.ph.i203
	leaq	(,%rax,4), %rcx
	xorpd	%xmm0, %xmm0
	xorl	%edx, %edx
	movq	24(%rsp), %rsi                  # 8-byte Reload
.LBB6_48:                               # %.lr.ph.i204
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_49 Depth 2
	xorl	%r8d, %r8d
.LBB6_49:                               #   Parent Loop BB6_48 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rsi,%r8,4), %xmm1             # xmm1 = mem[0],zero,zero,zero
	subss	(%r14,%r8,4), %xmm1
	mulss	%xmm1, %xmm1
	addss	%xmm1, %xmm0
	incq	%r8
	cmpq	%r8, %rax
	jne	.LBB6_49
# %bb.50:                               # %._crit_edge.i208
                                        #   in Loop: Header=BB6_48 Depth=1
	incq	%rdx
	addq	%rcx, %r14
	addq	%rcx, %rsi
	cmpq	%rax, %rdx
	jne	.LBB6_48
# %bb.51:                               # %.lr.ph.i212.preheader
	xorps	%xmm1, %xmm1
	xorl	%edx, %edx
	movq	%rbp, %rsi
	movq	%r12, %rdi
.LBB6_52:                               # %.lr.ph.i212
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_53 Depth 2
	xorl	%r8d, %r8d
.LBB6_53:                               #   Parent Loop BB6_52 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rsi,%r8,4), %xmm2             # xmm2 = mem[0],zero,zero,zero
	subss	(%rdi,%r8,4), %xmm2
	mulss	%xmm2, %xmm2
	addss	%xmm2, %xmm1
	incq	%r8
	cmpq	%r8, %rax
	jne	.LBB6_53
# %bb.54:                               # %._crit_edge.i220
                                        #   in Loop: Header=BB6_52 Depth=1
	incq	%rdx
	addq	%rcx, %rdi
	addq	%rcx, %rsi
	cmpq	%rax, %rdx
	jne	.LBB6_52
# %bb.55:                               # %.lr.ph.i226.preheader
	xorpd	%xmm2, %xmm2
	xorl	%edx, %edx
	movq	%rbp, %rsi
.LBB6_56:                               # %.lr.ph.i226
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_57 Depth 2
	xorl	%r8d, %r8d
.LBB6_57:                               #   Parent Loop BB6_56 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movapd	%xmm2, %xmm3
	movss	(%rsi,%r8,4), %xmm2             # xmm2 = mem[0],zero,zero,zero
	subss	(%r12,%r8,4), %xmm2
	mulss	%xmm2, %xmm2
	maxss	%xmm3, %xmm2
	incq	%r8
	cmpq	%r8, %rax
	jne	.LBB6_57
# %bb.58:                               # %._crit_edge.i232
                                        #   in Loop: Header=BB6_56 Depth=1
	incq	%rdx
	addq	%rcx, %r12
	addq	%rcx, %rsi
	cmpq	%rax, %rdx
	jne	.LBB6_56
# %bb.59:                               # %_Z17max_error_CPU_GPUPfS_i.exit.loopexit
	cvtss2sd	%xmm0, %xmm0
	movsd	%xmm0, 136(%rsp)                # 8-byte Spill
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm0
	movsd	%xmm0, 144(%rsp)                # 8-byte Spill
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm2, %xmm0
	jmp	.LBB6_60
.LBB6_46:
	xorpd	%xmm0, %xmm0
	movsd	%xmm0, 144(%rsp)                # 8-byte Spill
	movsd	%xmm0, 136(%rsp)                # 8-byte Spill
.LBB6_60:                               # %_Z17max_error_CPU_GPUPfS_i.exit
	movsd	%xmm0, 40(%rsp)                 # 8-byte Spill
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.12, %esi
	movl	$10, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movsd	136(%rsp), %xmm0                # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.13, %esi
	movl	$10, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movsd	144(%rsp), %xmm0                # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.14, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movsd	40(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	testq	%r13, %r13
	jle	.LBB6_62
# %bb.61:
	movl	$.L.str.15, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtsi2sdq	184(%rsp), %xmm0        # 8-byte Folded Reload
	cvtsi2sd	%r13, %xmm1
	divsd	%xmm1, %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	jmp	.LBB6_63
.LBB6_62:
	movl	$.L.str.16, %esi
	movl	$45, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB6_63:
	movq	104(%rsp), %r14                 # 8-byte Reload
	movq	96(%rsp), %r15                  # 8-byte Reload
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	8(%rsp), %rdi                   # 8-byte Reload
	callq	free
	movq	16(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	%r15, %rdi
	callq	free
	movq	88(%rsp), %rdi
	callq	hipFree
	movq	80(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	72(%rsp), %rdi
	callq	hipFree
	movq	128(%rsp), %rdi
	callq	hipFree
	movq	120(%rsp), %rdi
	callq	hipFree
	movq	112(%rsp), %rdi
	callq	hipFree
	movq	64(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	56(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	%r14, %rdi
	callq	free
	movq	24(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	48(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	152(%rsp), %rdi                 # 8-byte Reload
	callq	free
	movq	%rbp, %rdi
	callq	free
	xorl	%eax, %eax
	addq	$200, %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_end6:
	.size	main, .Lfunc_end6-main
	.cfi_endproc
                                        # -- End function
	.globl	_Z17multiple_matricesPfS_S_i    # -- Begin function _Z17multiple_matricesPfS_S_i
	.type	_Z17multiple_matricesPfS_S_i,@function
_Z17multiple_matricesPfS_S_i:           # @_Z17multiple_matricesPfS_S_i
	.cfi_startproc
# %bb.0:
	testl	%ecx, %ecx
	jle	.LBB7_8
# %bb.1:                                # %.preheader26.lr.ph
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	%ecx, %eax
	leaq	(,%rax,4), %rcx
	xorl	%r8d, %r8d
.LBB7_2:                                # %.preheader.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_3 Depth 2
                                        #       Child Loop BB7_4 Depth 3
	movq	%r8, %r9
	imulq	%rax, %r9
	leaq	(%rdx,%r9,4), %r9
	movq	%rsi, %r10
	xorl	%r11d, %r11d
.LBB7_3:                                # %.preheader
                                        #   Parent Loop BB7_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB7_4 Depth 3
	xorps	%xmm0, %xmm0
	movq	%r10, %rbx
	xorl	%r14d, %r14d
.LBB7_4:                                #   Parent Loop BB7_2 Depth=1
                                        #     Parent Loop BB7_3 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%rdi,%r14,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	mulss	(%rbx), %xmm1
	addss	%xmm1, %xmm0
	incq	%r14
	addq	%rcx, %rbx
	cmpq	%r14, %rax
	jne	.LBB7_4
# %bb.5:                                # %._crit_edge
                                        #   in Loop: Header=BB7_3 Depth=2
	movss	%xmm0, (%r9,%r11,4)
	incq	%r11
	addq	$4, %r10
	cmpq	%rax, %r11
	jne	.LBB7_3
# %bb.6:                                # %._crit_edge30
                                        #   in Loop: Header=BB7_2 Depth=1
	incq	%r8
	addq	%rcx, %rdi
	cmpq	%rax, %r8
	jne	.LBB7_2
# %bb.7:
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
.LBB7_8:                                # %._crit_edge32
	retq
.Lfunc_end7:
	.size	_Z17multiple_matricesPfS_S_i, .Lfunc_end7-_Z17multiple_matricesPfS_S_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z16transpose_matrixPfi         # -- Begin function _Z16transpose_matrixPfi
	.type	_Z16transpose_matrixPfi,@function
_Z16transpose_matrixPfi:                # @_Z16transpose_matrixPfi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB8_6
# %bb.1:                                # %.preheader.preheader
	movl	%esi, %eax
	leaq	(,%rax,4), %rcx
	xorl	%edx, %edx
	movq	%rdi, %rsi
.LBB8_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB8_4 Depth 2
	testq	%rdx, %rdx
	je	.LBB8_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB8_2 Depth=1
	movq	%rsi, %r8
	xorl	%r9d, %r9d
.LBB8_4:                                #   Parent Loop BB8_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rdi,%r9,4), %xmm0             # xmm0 = mem[0],zero,zero,zero
	movss	(%r8), %xmm1                    # xmm1 = mem[0],zero,zero,zero
	movss	%xmm1, (%rdi,%r9,4)
	movss	%xmm0, (%r8)
	incq	%r9
	addq	%rcx, %r8
	cmpq	%r9, %rdx
	jne	.LBB8_4
.LBB8_5:                                # %._crit_edge
                                        #   in Loop: Header=BB8_2 Depth=1
	incq	%rdx
	addq	$4, %rsi
	addq	%rcx, %rdi
	cmpq	%rax, %rdx
	jne	.LBB8_2
.LBB8_6:                                # %._crit_edge26
	retq
.Lfunc_end8:
	.size	_Z16transpose_matrixPfi, .Lfunc_end8-_Z16transpose_matrixPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z11copy_matrixPfS_i            # -- Begin function _Z11copy_matrixPfS_i
	.type	_Z11copy_matrixPfS_i,@function
_Z11copy_matrixPfS_i:                   # @_Z11copy_matrixPfS_i
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB9_5
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %eax
	leaq	(,%rax,4), %rcx
	xorl	%edx, %edx
.LBB9_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB9_3 Depth 2
	xorl	%r8d, %r8d
.LBB9_3:                                #   Parent Loop BB9_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rdi,%r8,4), %xmm0             # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rsi,%r8,4)
	incq	%r8
	cmpq	%r8, %rax
	jne	.LBB9_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB9_2 Depth=1
	incq	%rdx
	addq	%rcx, %rsi
	addq	%rcx, %rdi
	cmpq	%rax, %rdx
	jne	.LBB9_2
.LBB9_5:                                # %._crit_edge17
	retq
.Lfunc_end9:
	.size	_Z11copy_matrixPfS_i, .Lfunc_end9-_Z11copy_matrixPfS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z12amt_matricesPfS_S_S_S_S_S_i # -- Begin function _Z12amt_matricesPfS_S_S_S_S_S_i
	.type	_Z12amt_matricesPfS_S_S_S_S_S_i,@function
_Z12amt_matricesPfS_S_S_S_S_S_i:        # @_Z12amt_matricesPfS_S_S_S_S_S_i
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	.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	%r9, 24(%rsp)                   # 8-byte Spill
	movq	%r8, 16(%rsp)                   # 8-byte Spill
	movq	%rcx, %r14
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movl	104(%rsp), %eax
	movl	%eax, 4(%rsp)                   # 4-byte Spill
	movq	96(%rsp), %rbp
	movl	%eax, %r12d
	imull	%r12d, %r12d
	shlq	$2, %r12
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movq	%r12, %rdi
	callq	malloc
	movq	%r12, %rdi
	movq	%rax, %r12
	callq	malloc
	movq	32(%rsp), %rdi                  # 8-byte Reload
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movl	4(%rsp), %eax                   # 4-byte Reload
	testl	%eax, %eax
	jle	.LBB10_27
# %bb.1:                                # %.preheader26.lr.ph.i
	movl	%eax, %eax
	leaq	(,%rax,4), %rcx
	xorl	%edx, %edx
.LBB10_2:                               # %.preheader.lr.ph.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_3 Depth 2
                                        #       Child Loop BB10_4 Depth 3
	movq	%rdx, %rsi
	imulq	%rax, %rsi
	leaq	(%rdi,%rsi,4), %rsi
	movq	%r14, %r11
	xorl	%r8d, %r8d
.LBB10_3:                               # %.preheader.i
                                        #   Parent Loop BB10_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB10_4 Depth 3
	xorps	%xmm0, %xmm0
	movq	%r11, %r9
	xorl	%r10d, %r10d
.LBB10_4:                               #   Parent Loop BB10_2 Depth=1
                                        #     Parent Loop BB10_3 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%r15,%r10), %xmm1              # xmm1 = mem[0],zero,zero,zero
	mulss	(%r9), %xmm1
	addss	%xmm1, %xmm0
	addq	$4, %r10
	addq	%rcx, %r9
	cmpq	%r10, %rcx
	jne	.LBB10_4
# %bb.5:                                # %._crit_edge.i
                                        #   in Loop: Header=BB10_3 Depth=2
	movss	%xmm0, (%rsi,%r8,4)
	incq	%r8
	addq	$4, %r11
	cmpq	%rax, %r8
	jne	.LBB10_3
# %bb.6:                                # %._crit_edge30.i
                                        #   in Loop: Header=BB10_2 Depth=1
	incq	%rdx
	addq	%rcx, %r15
	cmpq	%rax, %rdx
	jne	.LBB10_2
# %bb.7:                                # %.preheader.lr.ph.i30.preheader
	xorl	%edx, %edx
	movq	24(%rsp), %r14                  # 8-byte Reload
	movq	16(%rsp), %r15                  # 8-byte Reload
.LBB10_8:                               # %.preheader.lr.ph.i30
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_9 Depth 2
                                        #       Child Loop BB10_10 Depth 3
	movq	%rdx, %rsi
	imulq	%rax, %rsi
	leaq	(%r12,%rsi,4), %rsi
	movq	%r15, %r11
	xorl	%r8d, %r8d
.LBB10_9:                               # %.preheader.i32
                                        #   Parent Loop BB10_8 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB10_10 Depth 3
	xorps	%xmm0, %xmm0
	movq	%r11, %r9
	xorl	%r10d, %r10d
.LBB10_10:                              #   Parent Loop BB10_8 Depth=1
                                        #     Parent Loop BB10_9 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%rbx,%r10), %xmm1              # xmm1 = mem[0],zero,zero,zero
	mulss	(%r9), %xmm1
	addss	%xmm1, %xmm0
	addq	$4, %r10
	addq	%rcx, %r9
	cmpq	%r10, %rcx
	jne	.LBB10_10
# %bb.11:                               # %._crit_edge.i40
                                        #   in Loop: Header=BB10_9 Depth=2
	movss	%xmm0, (%rsi,%r8,4)
	incq	%r8
	addq	$4, %r11
	cmpq	%rax, %r8
	jne	.LBB10_9
# %bb.12:                               # %._crit_edge30.i43
                                        #   in Loop: Header=BB10_8 Depth=1
	incq	%rdx
	addq	%rcx, %rbx
	cmpq	%rax, %rdx
	jne	.LBB10_8
# %bb.13:                               # %.preheader.lr.ph.i49.preheader
	xorl	%edx, %edx
	movq	8(%rsp), %rbx                   # 8-byte Reload
.LBB10_14:                              # %.preheader.lr.ph.i49
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_15 Depth 2
                                        #       Child Loop BB10_16 Depth 3
	movq	%rdx, %rsi
	imulq	%rax, %rsi
	leaq	(%rbx,%rsi,4), %rsi
	movq	%r14, %r11
	xorl	%r8d, %r8d
.LBB10_15:                              # %.preheader.i51
                                        #   Parent Loop BB10_14 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB10_16 Depth 3
	xorps	%xmm0, %xmm0
	movq	%r11, %r9
	xorl	%r10d, %r10d
.LBB10_16:                              #   Parent Loop BB10_14 Depth=1
                                        #     Parent Loop BB10_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%r13,%r10), %xmm1              # xmm1 = mem[0],zero,zero,zero
	mulss	(%r9), %xmm1
	addss	%xmm1, %xmm0
	addq	$4, %r10
	addq	%rcx, %r9
	cmpq	%r10, %rcx
	jne	.LBB10_16
# %bb.17:                               # %._crit_edge.i59
                                        #   in Loop: Header=BB10_15 Depth=2
	movss	%xmm0, (%rsi,%r8,4)
	incq	%r8
	addq	$4, %r11
	cmpq	%rax, %r8
	jne	.LBB10_15
# %bb.18:                               # %._crit_edge30.i62
                                        #   in Loop: Header=BB10_14 Depth=1
	incq	%rdx
	addq	%rcx, %r13
	cmpq	%rax, %rdx
	jne	.LBB10_14
# %bb.19:                               # %.lr.ph.i.preheader
	xorl	%edx, %edx
	movq	%rdi, %rsi
	movq	%r12, %r10
	movq	%rbp, %r8
.LBB10_20:                              # %.lr.ph.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_21 Depth 2
	xorl	%r9d, %r9d
.LBB10_21:                              #   Parent Loop BB10_20 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rsi,%r9,4), %xmm0             # xmm0 = mem[0],zero,zero,zero
	addss	(%r10,%r9,4), %xmm0
	movss	%xmm0, (%r8,%r9,4)
	incq	%r9
	cmpq	%r9, %rax
	jne	.LBB10_21
# %bb.22:                               # %._crit_edge.i70
                                        #   in Loop: Header=BB10_20 Depth=1
	incq	%rdx
	addq	%rcx, %r8
	addq	%rcx, %r10
	addq	%rcx, %rsi
	cmpq	%rax, %rdx
	jne	.LBB10_20
# %bb.23:                               # %.lr.ph.i73.preheader
	xorl	%edx, %edx
	movq	%rbx, %rsi
.LBB10_24:                              # %.lr.ph.i73
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_25 Depth 2
	xorl	%r8d, %r8d
.LBB10_25:                              #   Parent Loop BB10_24 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rbp,%r8,4), %xmm0             # xmm0 = mem[0],zero,zero,zero
	addss	(%rsi,%r8,4), %xmm0
	movss	%xmm0, (%rbp,%r8,4)
	incq	%r8
	cmpq	%r8, %rax
	jne	.LBB10_25
# %bb.26:                               # %._crit_edge.i78
                                        #   in Loop: Header=BB10_24 Depth=1
	incq	%rdx
	addq	%rcx, %rsi
	addq	%rcx, %rbp
	cmpq	%rax, %rdx
	jne	.LBB10_24
.LBB10_27:                              # %_Z12add_matricesPfS_S_i.exit81
	callq	free
	movq	%r12, %rdi
	callq	free
	movq	8(%rsp), %rdi                   # 8-byte Reload
	addq	$40, %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
	jmp	free                            # TAILCALL
.Lfunc_end10:
	.size	_Z12amt_matricesPfS_S_S_S_S_S_i, .Lfunc_end10-_Z12amt_matricesPfS_S_S_S_S_S_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z12print_matrixPfi             # -- Begin function _Z12print_matrixPfi
	.type	_Z12print_matrixPfi,@function
_Z12print_matrixPfi:                    # @_Z12print_matrixPfi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB11_6
# %bb.1:                                # %.preheader.lr.ph
	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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
	leaq	(,%r14,4), %r15
	xorl	%r12d, %r12d
.LBB11_2:                               # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB11_3 Depth 2
	xorl	%r13d, %r13d
.LBB11_3:                               #   Parent Loop BB11_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	movq	$12, _ZSt4cout+16(%rax)
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbx,%r13,4), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.17, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r13
	cmpq	%r13, %r14
	jne	.LBB11_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB11_2 Depth=1
	movl	$_ZSt4cout, %edi
	movl	$.L.str.18, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r12
	addq	%r15, %rbx
	cmpq	%r14, %r12
	jne	.LBB11_2
# %bb.5:
	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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
.LBB11_6:                               # %._crit_edge13
	retq
.Lfunc_end11:
	.size	_Z12print_matrixPfi, .Lfunc_end11-_Z12print_matrixPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z15compare_CPU_GPUPfS_i        # -- Begin function _Z15compare_CPU_GPUPfS_i
	.type	_Z15compare_CPU_GPUPfS_i,@function
_Z15compare_CPU_GPUPfS_i:               # @_Z15compare_CPU_GPUPfS_i
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB12_1
# %bb.3:                                # %.preheader.lr.ph
	movl	%edx, %eax
	leaq	(,%rax,4), %rcx
	xorps	%xmm0, %xmm0
	xorl	%edx, %edx
.LBB12_4:                               # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB12_5 Depth 2
	xorl	%r8d, %r8d
.LBB12_5:                               #   Parent Loop BB12_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rdi,%r8,4), %xmm1             # xmm1 = mem[0],zero,zero,zero
	subss	(%rsi,%r8,4), %xmm1
	mulss	%xmm1, %xmm1
	addss	%xmm1, %xmm0
	incq	%r8
	cmpq	%r8, %rax
	jne	.LBB12_5
# %bb.6:                                # %._crit_edge
                                        #   in Loop: Header=BB12_4 Depth=1
	incq	%rdx
	addq	%rcx, %rsi
	addq	%rcx, %rdi
	cmpq	%rax, %rdx
	jne	.LBB12_4
# %bb.2:                                # %._crit_edge22
	retq
.LBB12_1:
	xorps	%xmm0, %xmm0
	retq
.Lfunc_end12:
	.size	_Z15compare_CPU_GPUPfS_i, .Lfunc_end12-_Z15compare_CPU_GPUPfS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z17max_error_CPU_GPUPfS_i      # -- Begin function _Z17max_error_CPU_GPUPfS_i
	.type	_Z17max_error_CPU_GPUPfS_i,@function
_Z17max_error_CPU_GPUPfS_i:             # @_Z17max_error_CPU_GPUPfS_i
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB13_1
# %bb.3:                                # %.preheader.lr.ph
	movl	%edx, %eax
	leaq	(,%rax,4), %rcx
	xorps	%xmm0, %xmm0
	xorl	%edx, %edx
.LBB13_4:                               # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB13_5 Depth 2
	xorl	%r8d, %r8d
.LBB13_5:                               #   Parent Loop BB13_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movaps	%xmm0, %xmm1
	movss	(%rdi,%r8,4), %xmm0             # xmm0 = mem[0],zero,zero,zero
	subss	(%rsi,%r8,4), %xmm0
	mulss	%xmm0, %xmm0
	maxss	%xmm1, %xmm0
	incq	%r8
	cmpq	%r8, %rax
	jne	.LBB13_5
# %bb.6:                                # %._crit_edge
                                        #   in Loop: Header=BB13_4 Depth=1
	incq	%rdx
	addq	%rcx, %rsi
	addq	%rcx, %rdi
	cmpq	%rax, %rdx
	jne	.LBB13_4
# %bb.2:                                # %._crit_edge25
	retq
.LBB13_1:
	xorps	%xmm0, %xmm0
	retq
.Lfunc_end13:
	.size	_Z17max_error_CPU_GPUPfS_i, .Lfunc_end13-_Z17max_error_CPU_GPUPfS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z11max_elementPfi              # -- Begin function _Z11max_elementPfi
	.type	_Z11max_elementPfi,@function
_Z11max_elementPfi:                     # @_Z11max_elementPfi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB14_1
# %bb.3:                                # %.preheader.lr.ph
	movl	%esi, %eax
	leaq	(,%rax,4), %rcx
	xorps	%xmm0, %xmm0
	xorl	%edx, %edx
.LBB14_4:                               # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB14_5 Depth 2
	xorl	%esi, %esi
.LBB14_5:                               #   Parent Loop BB14_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movaps	%xmm0, %xmm1
	movss	(%rdi,%rsi,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	maxss	%xmm1, %xmm0
	incq	%rsi
	cmpq	%rsi, %rax
	jne	.LBB14_5
# %bb.6:                                # %._crit_edge
                                        #   in Loop: Header=BB14_4 Depth=1
	incq	%rdx
	addq	%rcx, %rdi
	cmpq	%rax, %rdx
	jne	.LBB14_4
# %bb.2:                                # %._crit_edge23
	retq
.LBB14_1:
	xorps	%xmm0, %xmm0
	retq
.Lfunc_end14:
	.size	_Z11max_elementPfi, .Lfunc_end14-_Z11max_elementPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z17print_matrix_codePfi        # -- Begin function _Z17print_matrix_codePfi
	.type	_Z17print_matrix_codePfi,@function
_Z17print_matrix_codePfi:               # @_Z17print_matrix_codePfi
	.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
	pushq	%rax
	.cfi_def_cfa_offset 64
	.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	%esi, %ebx
	movq	%rdi, %r14
	movl	$_ZSt4cout, %edi
	movl	$.L.str.19, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	testl	%ebx, %ebx
	jle	.LBB15_9
# %bb.1:                                # %.preheader.lr.ph
	movl	%ebx, %r15d
	decl	%ebx
	leaq	(,%r15,4), %r12
	xorl	%r13d, %r13d
.LBB15_2:                               # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB15_3 Depth 2
	movq	%r14, (%rsp)                    # 8-byte Spill
	movq	%r14, %rbp
	xorl	%r14d, %r14d
.LBB15_3:                               #   Parent Loop BB15_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbp), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	cmpq	%r14, %rbx
	je	.LBB15_5
# %bb.4:                                #   in Loop: Header=BB15_3 Depth=2
	movl	$_ZSt4cout, %edi
	movl	$.L.str.20, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB15_5:                               #   in Loop: Header=BB15_3 Depth=2
	incq	%r14
	addq	%r12, %rbp
	cmpq	%r14, %r15
	jne	.LBB15_3
# %bb.6:                                # %._crit_edge
                                        #   in Loop: Header=BB15_2 Depth=1
	cmpq	%rbx, %r13
	je	.LBB15_8
# %bb.7:                                #   in Loop: Header=BB15_2 Depth=1
	movl	$_ZSt4cout, %edi
	movl	$.L.str.21, %esi
	movl	$2, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB15_8:                               #   in Loop: Header=BB15_2 Depth=1
	incq	%r13
	movq	(%rsp), %r14                    # 8-byte Reload
	addq	$4, %r14
	cmpq	%r15, %r13
	jne	.LBB15_2
.LBB15_9:                               # %._crit_edge18
	movl	$_ZSt4cout, %edi
	movl	$.L.str.22, %esi
	movl	$1, %edx
	addq	$8, %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
	jmp	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l # TAILCALL
.Lfunc_end15:
	.size	_Z17print_matrix_codePfi, .Lfunc_end15-_Z17print_matrix_codePfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z12add_matricesPfS_S_i         # -- Begin function _Z12add_matricesPfS_S_i
	.type	_Z12add_matricesPfS_S_i,@function
_Z12add_matricesPfS_S_i:                # @_Z12add_matricesPfS_S_i
	.cfi_startproc
# %bb.0:
	testl	%ecx, %ecx
	jle	.LBB16_5
# %bb.1:                                # %.preheader.lr.ph
	movl	%ecx, %eax
	leaq	(,%rax,4), %rcx
	xorl	%r8d, %r8d
.LBB16_2:                               # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB16_3 Depth 2
	xorl	%r9d, %r9d
.LBB16_3:                               #   Parent Loop BB16_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rdi,%r9,4), %xmm0             # xmm0 = mem[0],zero,zero,zero
	addss	(%rsi,%r9,4), %xmm0
	movss	%xmm0, (%rdx,%r9,4)
	incq	%r9
	cmpq	%r9, %rax
	jne	.LBB16_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB16_2 Depth=1
	incq	%r8
	addq	%rcx, %rdx
	addq	%rcx, %rsi
	addq	%rcx, %rdi
	cmpq	%rax, %r8
	jne	.LBB16_2
.LBB16_5:                               # %._crit_edge21
	retq
.Lfunc_end16:
	.size	_Z12add_matricesPfS_S_i, .Lfunc_end16-_Z12add_matricesPfS_S_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z16normalize_vectorPfS_ii      # -- Begin function _Z16normalize_vectorPfS_ii
	.type	_Z16normalize_vectorPfS_ii,@function
_Z16normalize_vectorPfS_ii:             # @_Z16normalize_vectorPfS_ii
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB17_10
# %bb.1:                                # %.lr.ph
	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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %ebp
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movslq	%ecx, %r15
	leaq	(%rdi,%r15,4), %rax
	movl	%edx, %r12d
	leaq	(,%r12,4), %rcx
	xorps	%xmm0, %xmm0
	movq	%r12, %rdx
.LBB17_2:                               # =>This Inner Loop Header: Depth=1
	xorps	%xmm1, %xmm1
	cvtss2sd	(%rax), %xmm1
	mulsd	%xmm1, %xmm1
	cvtss2sd	%xmm0, %xmm0
	addsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	addq	%rcx, %rax
	decq	%rdx
	jne	.LBB17_2
# %bb.3:                                # %._crit_edge
	xorpd	%xmm1, %xmm1
	ucomiss	%xmm1, %xmm0
	jb	.LBB17_5
# %bb.4:
	sqrtss	%xmm0, %xmm0
	jmp	.LBB17_6
.LBB17_5:                               # %call.sqrt
	callq	sqrtf@PLT
.LBB17_6:                               # %._crit_edge.split
	testl	%ebp, %ebp
	jle	.LBB17_9
# %bb.7:                                # %.lr.ph27
	shlq	$2, %r15
	leaq	(,%r12,4), %rax
.LBB17_8:                               # =>This Inner Loop Header: Depth=1
	movss	(%r14,%r15), %xmm1              # xmm1 = mem[0],zero,zero,zero
	divss	%xmm0, %xmm1
	movss	%xmm1, (%rbx,%r15)
	addq	%rax, %r15
	decq	%r12
	jne	.LBB17_8
.LBB17_9:
	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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB17_10:                              # %._crit_edge28
	retq
.Lfunc_end17:
	.size	_Z16normalize_vectorPfS_ii, .Lfunc_end17-_Z16normalize_vectorPfS_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z11dot_productPfS_iii          # -- Begin function _Z11dot_productPfS_iii
	.type	_Z11dot_productPfS_iii,@function
_Z11dot_productPfS_iii:                 # @_Z11dot_productPfS_iii
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB18_1
# %bb.3:                                # %.lr.ph
	movslq	%ecx, %rax
	leaq	(%rsi,%rax,4), %rax
	movslq	%r8d, %rcx
	leaq	(%rdi,%rcx,4), %rcx
	movl	%edx, %edx
	leaq	(,%rdx,4), %rsi
	xorps	%xmm0, %xmm0
	xorl	%edi, %edi
.LBB18_4:                               # =>This Inner Loop Header: Depth=1
	movss	(%rax,%rdi), %xmm1              # xmm1 = mem[0],zero,zero,zero
	mulss	(%rcx,%rdi), %xmm1
	addss	%xmm1, %xmm0
	addq	%rsi, %rdi
	decq	%rdx
	jne	.LBB18_4
# %bb.2:                                # %._crit_edge
	retq
.LBB18_1:
	xorps	%xmm0, %xmm0
	retq
.Lfunc_end18:
	.size	_Z11dot_productPfS_iii, .Lfunc_end18-_Z11dot_productPfS_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z13substract_vecPfS_S_iiiiff   # -- Begin function _Z13substract_vecPfS_S_iiiiff
	.type	_Z13substract_vecPfS_S_iiiiff,@function
_Z13substract_vecPfS_S_iiiiff:          # @_Z13substract_vecPfS_S_iiiiff
	.cfi_startproc
# %bb.0:
	testl	%ecx, %ecx
	jle	.LBB19_3
# %bb.1:                                # %.lr.ph
	movslq	%r8d, %rax
	leaq	(%rdi,%rax,4), %rax
	movslq	%r9d, %rdi
	leaq	(%rsi,%rdi,4), %rsi
	movslq	8(%rsp), %rdi
	leaq	(%rdx,%rdi,4), %rdx
	movl	%ecx, %ecx
	leaq	(,%rcx,4), %rdi
	xorl	%r8d, %r8d
.LBB19_2:                               # =>This Inner Loop Header: Depth=1
	movss	(%rax,%r8), %xmm2               # xmm2 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm2
	movss	(%rsi,%r8), %xmm3               # xmm3 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm3
	subss	%xmm3, %xmm2
	movss	%xmm2, (%rdx,%r8)
	addq	%rdi, %r8
	decq	%rcx
	jne	.LBB19_2
.LBB19_3:                               # %._crit_edge
	retq
.Lfunc_end19:
	.size	_Z13substract_vecPfS_S_iiiiff, .Lfunc_end19-_Z13substract_vecPfS_S_iiiiff
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB20_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB20_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z16add_matrices_GPUPfS_S_i, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z21multiple_matrices_GPUPfS_S_i, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z20transpose_matrix_GPUPfi, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z25transpose_copy_matrix_GPUPfS_i, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z13add_three_GPUPfS_S_S_i, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z24multiple_matrices_sharedPfS_S_ii, %esi
	movl	$.L__unnamed_6, %edx
	movl	$.L__unnamed_6, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end20:
	.size	__hip_module_ctor, .Lfunc_end20-__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	.LBB21_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
.LBB21_2:
	retq
.Lfunc_end21:
	.size	__hip_module_dtor, .Lfunc_end21-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z16add_matrices_GPUPfS_S_i,@object # @_Z16add_matrices_GPUPfS_S_i
	.section	.rodata,"a",@progbits
	.globl	_Z16add_matrices_GPUPfS_S_i
	.p2align	3, 0x0
_Z16add_matrices_GPUPfS_S_i:
	.quad	_Z31__device_stub__add_matrices_GPUPfS_S_i
	.size	_Z16add_matrices_GPUPfS_S_i, 8

	.type	_Z21multiple_matrices_GPUPfS_S_i,@object # @_Z21multiple_matrices_GPUPfS_S_i
	.globl	_Z21multiple_matrices_GPUPfS_S_i
	.p2align	3, 0x0
_Z21multiple_matrices_GPUPfS_S_i:
	.quad	_Z36__device_stub__multiple_matrices_GPUPfS_S_i
	.size	_Z21multiple_matrices_GPUPfS_S_i, 8

	.type	_Z20transpose_matrix_GPUPfi,@object # @_Z20transpose_matrix_GPUPfi
	.globl	_Z20transpose_matrix_GPUPfi
	.p2align	3, 0x0
_Z20transpose_matrix_GPUPfi:
	.quad	_Z35__device_stub__transpose_matrix_GPUPfi
	.size	_Z20transpose_matrix_GPUPfi, 8

	.type	_Z25transpose_copy_matrix_GPUPfS_i,@object # @_Z25transpose_copy_matrix_GPUPfS_i
	.globl	_Z25transpose_copy_matrix_GPUPfS_i
	.p2align	3, 0x0
_Z25transpose_copy_matrix_GPUPfS_i:
	.quad	_Z40__device_stub__transpose_copy_matrix_GPUPfS_i
	.size	_Z25transpose_copy_matrix_GPUPfS_i, 8

	.type	_Z13add_three_GPUPfS_S_S_i,@object # @_Z13add_three_GPUPfS_S_S_i
	.globl	_Z13add_three_GPUPfS_S_S_i
	.p2align	3, 0x0
_Z13add_three_GPUPfS_S_S_i:
	.quad	_Z28__device_stub__add_three_GPUPfS_S_S_i
	.size	_Z13add_three_GPUPfS_S_S_i, 8

	.type	_Z24multiple_matrices_sharedPfS_S_ii,@object # @_Z24multiple_matrices_sharedPfS_S_ii
	.globl	_Z24multiple_matrices_sharedPfS_S_ii
	.p2align	3, 0x0
_Z24multiple_matrices_sharedPfS_S_ii:
	.quad	_Z39__device_stub__multiple_matrices_sharedPfS_S_ii
	.size	_Z24multiple_matrices_sharedPfS_S_ii, 8

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

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Czas_CPU: "
	.size	.L.str.6, 11

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

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

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Blad w C: "
	.size	.L.str.12, 11

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"Blad w D: "
	.size	.L.str.13, 11

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"Maksymalny blad w D: "
	.size	.L.str.14, 22

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"Speedup: "
	.size	.L.str.15, 10

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"Czas obliczen zbyt krotki by okreslic speedup"
	.size	.L.str.16, 46

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

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

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

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

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"; "
	.size	.L.str.21, 3

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z16add_matrices_GPUPfS_S_i"
	.size	.L__unnamed_1, 28

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z21multiple_matrices_GPUPfS_S_i"
	.size	.L__unnamed_2, 33

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

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z25transpose_copy_matrix_GPUPfS_i"
	.size	.L__unnamed_4, 35

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_Z13add_three_GPUPfS_S_S_i"
	.size	.L__unnamed_5, 27

	.type	.L__unnamed_6,@object           # @5
.L__unnamed_6:
	.asciz	"_Z24multiple_matrices_sharedPfS_S_ii"
	.size	.L__unnamed_6, 37

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

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

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z31__device_stub__add_matrices_GPUPfS_S_i
	.addrsig_sym _Z36__device_stub__multiple_matrices_GPUPfS_S_i
	.addrsig_sym _Z35__device_stub__transpose_matrix_GPUPfi
	.addrsig_sym _Z40__device_stub__transpose_copy_matrix_GPUPfS_i
	.addrsig_sym _Z28__device_stub__add_three_GPUPfS_S_S_i
	.addrsig_sym _Z39__device_stub__multiple_matrices_sharedPfS_S_ii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z16add_matrices_GPUPfS_S_i
	.addrsig_sym _Z21multiple_matrices_GPUPfS_S_i
	.addrsig_sym _Z20transpose_matrix_GPUPfi
	.addrsig_sym _Z25transpose_copy_matrix_GPUPfS_i
	.addrsig_sym _Z13add_three_GPUPfS_S_S_i
	.addrsig_sym _Z24multiple_matrices_sharedPfS_S_ii
	.addrsig_sym _ZSt4cout
	.addrsig_sym _ZSt3cin
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z16add_matrices_GPUPfS_S_i ; -- Begin function _Z16add_matrices_GPUPfS_S_i
	.globl	_Z16add_matrices_GPUPfS_S_i
	.p2align	8
	.type	_Z16add_matrices_GPUPfS_S_i,@function
_Z16add_matrices_GPUPfS_S_i:            ; @_Z16add_matrices_GPUPfS_S_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s9, s[0:1], 0x2c
	s_load_b32 s8, s[0:1], 0x18
	v_and_b32_e32 v3, 0x3ff, v0
	s_add_u32 s2, s0, 32
	s_addc_u32 s3, s1, 0
	s_mov_b32 s4, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s10, s9, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s14, s10, v[3:4]
	v_cmpx_gt_i32_e64 s8, v1
	s_cbranch_execz .LBB0_6
; %bb.1:                                ; %.preheader.lr.ph
	s_load_b64 s[12:13], s[2:3], 0x0
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[2:3], s[0:1], 0x10
	v_bfe_u32 v0, v0, 10, 10
	s_lshr_b32 s0, s9, 16
	s_mov_b32 s11, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, s15, s0, v[0:1]
	v_cmp_gt_i32_e32 vcc_lo, s8, v2
	s_waitcnt lgkmcnt(0)
	s_add_i32 s9, s13, s0
	s_add_i32 s10, s12, s10
.LBB0_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	s_and_saveexec_b32 s12, vcc_lo
	s_cbranch_execz .LBB0_5
; %bb.3:                                ; %.lr.ph
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_mul_lo_u32 v3, v1, s8
	s_mov_b32 s13, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v4, 31, v3
	v_lshlrev_b64 v[3:4], 2, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v0, s0, s4, v3
	v_add_co_ci_u32_e64 v5, s0, s5, v4, s0
	v_add_co_u32 v6, s0, s6, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v7, s0, s7, v4, s0
	v_add_co_u32 v8, s0, s2, v3
	v_add_co_ci_u32_e64 v9, s0, s3, v4, s0
	v_mov_b32_e32 v3, v2
.LBB0_4:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v4, 31, v3
	v_lshlrev_b64 v[10:11], 2, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v12, s0, v0, v10
	v_add_co_ci_u32_e64 v13, s0, v5, v11, s0
	v_add_co_u32 v14, s0, v6, v10
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v15, s0, v7, v11, s0
	v_add_co_u32 v10, s1, v8, v10
	global_load_b32 v4, v[12:13], off
	global_load_b32 v12, v[14:15], off
	v_add_nc_u32_e32 v3, s9, v3
	v_add_co_ci_u32_e64 v11, s1, v9, v11, s1
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v4, v4, v12
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_cmp_le_i32_e64 s0, s8, v3
	global_store_b32 v[10:11], v4, off
	s_or_b32 s13, s0, s13
	s_and_not1_b32 exec_lo, exec_lo, s13
	s_cbranch_execnz .LBB0_4
.LBB0_5:                                ; %Flow44
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
	v_add_nc_u32_e32 v1, s10, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_le_i32_e64 s0, s8, v1
	s_or_b32 s11, s0, s11
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s11
	s_cbranch_execnz .LBB0_2
.LBB0_6:                                ; %._crit_edge31
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z16add_matrices_GPUPfS_S_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 16
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z16add_matrices_GPUPfS_S_i, .Lfunc_end0-_Z16add_matrices_GPUPfS_S_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 424
; NumSgprs: 18
; NumVgprs: 16
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 16
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z21multiple_matrices_GPUPfS_S_i ; -- Begin function _Z21multiple_matrices_GPUPfS_S_i
	.globl	_Z21multiple_matrices_GPUPfS_S_i
	.p2align	8
	.type	_Z21multiple_matrices_GPUPfS_S_i,@function
_Z21multiple_matrices_GPUPfS_S_i:       ; @_Z21multiple_matrices_GPUPfS_S_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s9, s[0:1], 0x2c
	s_load_b32 s10, s[0:1], 0x18
	v_and_b32_e32 v3, 0x3ff, v0
	s_add_u32 s2, s0, 32
	s_addc_u32 s3, s1, 0
	s_mov_b32 s4, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s8, s9, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s14, s8, v[3:4]
	v_cmpx_gt_i32_e64 s10, v1
	s_cbranch_execz .LBB1_10
; %bb.1:                                ; %.preheader35.lr.ph
	s_load_b32 s12, s[2:3], 0x0
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[2:3], s[0:1], 0x10
	v_bfe_u32 v0, v0, 10, 10
	s_lshr_b32 s0, s9, 16
	s_cmp_gt_i32 s10, 0
	s_mov_b32 s9, 0
	s_cselect_b32 s11, -1, 0
	v_mad_u64_u32 v[2:3], null, s15, s0, v[0:1]
	v_mul_lo_u32 v3, s10, v1
	s_mov_b32 s14, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_cmp_gt_i32_e64 s0, s10, v2
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s12, s12, s8
	s_mul_i32 s13, s12, s10
.LBB1_2:                                ; %.preheader35
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_4 Depth 2
                                        ;       Child Loop BB1_6 Depth 3
	s_delay_alu instid0(VALU_DEP_1)
	s_and_saveexec_b32 s15, s0
	s_cbranch_execz .LBB1_9
; %bb.3:                                ; %.preheader.lr.ph
                                        ;   in Loop: Header=BB1_2 Depth=1
	v_mul_lo_u32 v5, v1, s10
	v_ashrrev_i32_e32 v4, 31, v3
	s_mov_b32 s16, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[7:8], 2, v[3:4]
	v_ashrrev_i32_e32 v6, 31, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, s4, v7
	v_lshlrev_b64 v[9:10], 2, v[5:6]
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v8, vcc_lo
	v_mov_b32_e32 v6, v2
	v_add_co_u32 v0, vcc_lo, s2, v9
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v11, vcc_lo, s3, v10, vcc_lo
.LBB1_4:                                ; %.preheader
                                        ;   Parent Loop BB1_2 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB1_6 Depth 3
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v7, 31, v6
	s_and_not1_b32 vcc_lo, exec_lo, s11
	v_lshlrev_b64 v[7:8], 2, v[6:7]
	s_cbranch_vccnz .LBB1_7
; %bb.5:                                ; %.lr.ph
                                        ;   in Loop: Header=BB1_4 Depth=2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_add_co_u32 v13, vcc_lo, s6, v7
	v_mov_b32_e32 v10, v5
	v_add_co_ci_u32_e32 v14, vcc_lo, s7, v8, vcc_lo
	v_dual_mov_b32 v12, 0 :: v_dual_mov_b32 v9, v4
	s_mov_b32 s8, 0
	s_mov_b32 s1, s10
.LBB1_6:                                ;   Parent Loop BB1_2 Depth=1
                                        ;     Parent Loop BB1_4 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	s_lshl_b64 s[18:19], s[8:9], 2
	s_add_i32 s1, s1, -1
	v_add_co_u32 v15, vcc_lo, v13, s18
	v_add_co_ci_u32_e32 v16, vcc_lo, s19, v14, vcc_lo
	s_add_i32 s8, s8, s10
	s_cmp_eq_u32 s1, 0
	global_load_b32 v17, v[9:10], off
	global_load_b32 v15, v[15:16], off
	v_add_co_u32 v9, vcc_lo, v9, 4
	v_add_co_ci_u32_e32 v10, vcc_lo, 0, v10, vcc_lo
	s_waitcnt vmcnt(0)
	v_fmac_f32_e32 v12, v17, v15
	s_cbranch_scc0 .LBB1_6
	s_branch .LBB1_8
.LBB1_7:                                ;   in Loop: Header=BB1_4 Depth=2
	v_mov_b32_e32 v12, 0
.LBB1_8:                                ; %._crit_edge
                                        ;   in Loop: Header=BB1_4 Depth=2
	v_add_nc_u32_e32 v6, s12, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v7, s1, v0, v7
	v_add_co_ci_u32_e64 v8, s1, v11, v8, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_cmp_le_i32_e32 vcc_lo, s10, v6
	global_store_b32 v[7:8], v12, off
	s_or_b32 s16, vcc_lo, s16
	s_and_not1_b32 exec_lo, exec_lo, s16
	s_cbranch_execnz .LBB1_4
.LBB1_9:                                ; %Flow62
                                        ;   in Loop: Header=BB1_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s15
	v_add_nc_u32_e32 v1, s12, v1
	v_add_nc_u32_e32 v3, s13, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_le_i32_e32 vcc_lo, s10, v1
	s_or_b32 s14, vcc_lo, s14
	s_and_not1_b32 exec_lo, exec_lo, s14
	s_cbranch_execnz .LBB1_2
.LBB1_10:                               ; %._crit_edge41
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z21multiple_matrices_GPUPfS_S_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 18
		.amdhsa_next_free_sgpr 20
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z21multiple_matrices_GPUPfS_S_i, .Lfunc_end1-_Z21multiple_matrices_GPUPfS_S_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 496
; NumSgprs: 22
; NumVgprs: 18
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 22
; NumVGPRsForWavesPerEU: 18
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z20transpose_matrix_GPUPfi ; -- Begin function _Z20transpose_matrix_GPUPfi
	.globl	_Z20transpose_matrix_GPUPfi
	.p2align	8
	.type	_Z20transpose_matrix_GPUPfi,@function
_Z20transpose_matrix_GPUPfi:            ; @_Z20transpose_matrix_GPUPfi
; %bb.0:
	s_clause 0x1
	s_load_b32 s7, s[0:1], 0x1c
	s_load_b32 s8, s[0:1], 0x8
	v_and_b32_e32 v3, 0x3ff, v0
	s_add_u32 s4, s0, 16
	s_addc_u32 s5, s1, 0
	s_mov_b32 s2, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s6, s7, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s14, s6, v[3:4]
	v_cmpx_gt_i32_e64 s8, v1
	s_cbranch_execz .LBB2_6
; %bb.1:                                ; %.preheader.preheader
	v_bfe_u32 v0, v0, 10, 10
	s_load_b64 s[2:3], s[0:1], 0x0
	s_load_b32 s0, s[4:5], 0x0
	s_lshr_b32 s1, s7, 16
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[3:4], null, s15, s1, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v4, 31, v3
	v_mul_lo_u32 v0, s8, v3
	v_lshlrev_b64 v[5:6], 2, v[3:4]
	v_mul_lo_u32 v4, s8, v1
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s4, s0, s6
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_ashr_i32 s5, s4, 31
	v_add_co_u32 v9, vcc_lo, s2, v5
	v_add_co_ci_u32_e32 v10, vcc_lo, s3, v6, vcc_lo
	s_mul_i32 s1, s4, s8
	s_lshl_b64 s[6:7], s[4:5], 2
	s_mov_b32 s5, 0
.LBB2_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB2_4 Depth 2
	s_mov_b32 s9, exec_lo
	v_cmpx_lt_i32_e64 v3, v1
	s_cbranch_execz .LBB2_5
; %bb.3:                                ; %.lr.ph
                                        ;   in Loop: Header=BB2_2 Depth=1
	v_ashrrev_i32_e32 v5, 31, v4
	v_ashrrev_i32_e32 v2, 31, v1
	s_mov_b32 s10, 0
	v_mov_b32_e32 v12, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[5:6], 2, v[4:5]
	v_lshlrev_b64 v[7:8], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v5, vcc_lo, v9, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, v10, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v2, vcc_lo, s2, v7
	v_add_co_ci_u32_e32 v11, vcc_lo, s3, v8, vcc_lo
	v_mov_b32_e32 v7, v0
.LBB2_4:                                ;   Parent Loop BB2_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v8, 31, v7
	v_add_nc_u32_e32 v12, s4, v12
	v_lshlrev_b64 v[13:14], 2, v[7:8]
	v_add_nc_u32_e32 v7, s1, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v13, vcc_lo, v2, v13
	v_add_co_ci_u32_e32 v14, vcc_lo, v11, v14, vcc_lo
	v_cmp_ge_i32_e32 vcc_lo, v12, v1
	global_load_b32 v8, v[13:14], off
	global_load_b32 v15, v[5:6], off
	s_or_b32 s10, vcc_lo, s10
	s_waitcnt vmcnt(1)
	global_store_b32 v[5:6], v8, off
	v_add_co_u32 v5, s0, v5, s6
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v6, s0, s7, v6, s0
	s_waitcnt vmcnt(0)
	global_store_b32 v[13:14], v15, off
	s_and_not1_b32 exec_lo, exec_lo, s10
	s_cbranch_execnz .LBB2_4
.LBB2_5:                                ; %Flow44
                                        ;   in Loop: Header=BB2_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s9
	v_add_nc_u32_e32 v1, s4, v1
	v_add_nc_u32_e32 v4, s1, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_le_i32_e32 vcc_lo, s8, v1
	s_or_b32 s5, vcc_lo, s5
	s_and_not1_b32 exec_lo, exec_lo, s5
	s_cbranch_execnz .LBB2_2
.LBB2_6:                                ; %._crit_edge33
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z20transpose_matrix_GPUPfi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 16
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z20transpose_matrix_GPUPfi, .Lfunc_end2-_Z20transpose_matrix_GPUPfi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 436
; NumSgprs: 18
; NumVgprs: 16
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 16
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z25transpose_copy_matrix_GPUPfS_i ; -- Begin function _Z25transpose_copy_matrix_GPUPfS_i
	.globl	_Z25transpose_copy_matrix_GPUPfS_i
	.p2align	8
	.type	_Z25transpose_copy_matrix_GPUPfS_i,@function
_Z25transpose_copy_matrix_GPUPfS_i:     ; @_Z25transpose_copy_matrix_GPUPfS_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s10, s[0:1], 0x24
	s_load_b32 s8, s[0:1], 0x10
	v_and_b32_e32 v3, 0x3ff, v0
	s_add_u32 s2, s0, 24
	s_addc_u32 s3, s1, 0
	s_mov_b32 s4, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s9, s10, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s14, s9, v[3:4]
	v_cmpx_gt_i32_e64 s8, v1
	s_cbranch_execz .LBB3_6
; %bb.1:                                ; %.preheader.lr.ph
	v_bfe_u32 v0, v0, 10, 10
	s_load_b128 s[4:7], s[0:1], 0x0
	s_lshr_b32 s0, s10, 16
	s_load_b64 s[12:13], s[2:3], 0x0
	v_mul_lo_u32 v5, s8, v1
	v_mad_u64_u32 v[3:4], null, s15, s0, v[0:1]
	s_mov_b32 s11, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_ashrrev_i32_e32 v4, 31, v3
	v_mul_lo_u32 v0, s8, v3
	v_cmp_gt_i32_e32 vcc_lo, s8, v3
	v_lshlrev_b64 v[6:7], 2, v[3:4]
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s2, s13, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v4, s0, s6, v6
	v_add_co_ci_u32_e64 v10, s0, s7, v7, s0
	s_mul_i32 s9, s12, s9
	s_ashr_i32 s3, s2, 31
	s_mul_i32 s10, s9, s8
	s_lshl_b64 s[6:7], s[2:3], 2
	s_mul_i32 s3, s2, s8
.LBB3_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB3_4 Depth 2
	s_and_saveexec_b32 s12, vcc_lo
	s_cbranch_execz .LBB3_5
; %bb.3:                                ; %.lr.ph
                                        ;   in Loop: Header=BB3_2 Depth=1
	v_ashrrev_i32_e32 v6, 31, v5
	v_ashrrev_i32_e32 v2, 31, v1
	v_mov_b32_e32 v12, v3
	s_mov_b32 s13, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[6:7], 2, v[5:6]
	v_lshlrev_b64 v[8:9], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v6, s0, v4, v6
	v_add_co_ci_u32_e64 v7, s0, v10, v7, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v2, s0, s4, v8
	v_add_co_ci_u32_e64 v11, s0, s5, v9, s0
	v_mov_b32_e32 v8, v0
.LBB3_4:                                ;   Parent Loop BB3_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v9, 31, v8
	v_add_nc_u32_e32 v12, s2, v12
	v_lshlrev_b64 v[13:14], 2, v[8:9]
	v_add_nc_u32_e32 v8, s3, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v13, s0, v2, v13
	v_add_co_ci_u32_e64 v14, s0, v11, v14, s0
	v_cmp_le_i32_e64 s0, s8, v12
	global_load_b32 v9, v[13:14], off
	s_or_b32 s13, s0, s13
	s_waitcnt vmcnt(0)
	global_store_b32 v[6:7], v9, off
	v_add_co_u32 v6, s1, v6, s6
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v7, s1, s7, v7, s1
	s_and_not1_b32 exec_lo, exec_lo, s13
	s_cbranch_execnz .LBB3_4
.LBB3_5:                                ; %Flow43
                                        ;   in Loop: Header=BB3_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
	v_add_nc_u32_e32 v1, s9, v1
	v_add_nc_u32_e32 v5, s10, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_le_i32_e64 s0, s8, v1
	s_or_b32 s11, s0, s11
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s11
	s_cbranch_execnz .LBB3_2
.LBB3_6:                                ; %._crit_edge28
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z25transpose_copy_matrix_GPUPfS_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.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 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 15
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end3:
	.size	_Z25transpose_copy_matrix_GPUPfS_i, .Lfunc_end3-_Z25transpose_copy_matrix_GPUPfS_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 444
; NumSgprs: 18
; NumVgprs: 15
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 15
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z13add_three_GPUPfS_S_S_i ; -- Begin function _Z13add_three_GPUPfS_S_S_i
	.globl	_Z13add_three_GPUPfS_S_S_i
	.p2align	8
	.type	_Z13add_three_GPUPfS_S_S_i,@function
_Z13add_three_GPUPfS_S_S_i:             ; @_Z13add_three_GPUPfS_S_S_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s13, s[0:1], 0x34
	s_load_b32 s12, s[0:1], 0x20
	v_and_b32_e32 v3, 0x3ff, v0
	s_add_u32 s2, s0, 40
	s_addc_u32 s3, s1, 0
	s_mov_b32 s4, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s16, s13, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s14, s16, v[3:4]
	v_cmpx_gt_i32_e64 s12, v1
	s_cbranch_execz .LBB4_6
; %bb.1:                                ; %.preheader.lr.ph
	s_load_b64 s[18:19], s[2:3], 0x0
	s_load_b256 s[4:11], s[0:1], 0x0
	v_bfe_u32 v0, v0, 10, 10
	s_lshr_b32 s0, s13, 16
	s_mov_b32 s13, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, s15, s0, v[0:1]
	v_cmp_gt_i32_e32 vcc_lo, s12, v2
	s_waitcnt lgkmcnt(0)
	s_add_i32 s2, s19, s0
	s_add_i32 s3, s18, s16
.LBB4_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB4_4 Depth 2
	s_and_saveexec_b32 s14, vcc_lo
	s_cbranch_execz .LBB4_5
; %bb.3:                                ; %.lr.ph
                                        ;   in Loop: Header=BB4_2 Depth=1
	v_mul_lo_u32 v3, v1, s12
	s_mov_b32 s15, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v4, 31, v3
	v_lshlrev_b64 v[3:4], 2, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v0, s0, s4, v3
	v_add_co_ci_u32_e64 v5, s0, s5, v4, s0
	v_add_co_u32 v6, s0, s6, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v7, s0, s7, v4, s0
	v_add_co_u32 v8, s0, s8, v3
	v_add_co_ci_u32_e64 v9, s0, s9, v4, s0
	v_add_co_u32 v10, s0, s10, v3
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v11, s0, s11, v4, s0
	v_mov_b32_e32 v3, v2
.LBB4_4:                                ;   Parent Loop BB4_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v4, 31, v3
	v_lshlrev_b64 v[12:13], 2, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v14, s0, v0, v12
	v_add_co_ci_u32_e64 v15, s0, v5, v13, s0
	v_add_co_u32 v16, s0, v6, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v17, s0, v7, v13, s0
	v_add_co_u32 v18, s0, v8, v12
	v_add_co_ci_u32_e64 v19, s0, v9, v13, s0
	global_load_b32 v4, v[14:15], off
	global_load_b32 v14, v[16:17], off
	global_load_b32 v15, v[18:19], off
	v_add_nc_u32_e32 v3, s2, v3
	v_add_co_u32 v12, s1, v10, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e64 v13, s1, v11, v13, s1
	s_waitcnt vmcnt(1)
	v_add_f32_e32 v4, v4, v14
	v_cmp_le_i32_e64 s0, s12, v3
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v4, v4, v15
	s_delay_alu instid0(VALU_DEP_2)
	s_or_b32 s15, s0, s15
	global_store_b32 v[12:13], v4, off
	s_and_not1_b32 exec_lo, exec_lo, s15
	s_cbranch_execnz .LBB4_4
.LBB4_5:                                ; %Flow52
                                        ;   in Loop: Header=BB4_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s14
	v_add_nc_u32_e32 v1, s3, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_le_i32_e64 s0, s12, v1
	s_or_b32 s13, s0, s13
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s13
	s_cbranch_execnz .LBB4_2
.LBB4_6:                                ; %._crit_edge36
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z13add_three_GPUPfS_S_S_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 20
		.amdhsa_next_free_sgpr 20
		.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_end4:
	.size	_Z13add_three_GPUPfS_S_S_i, .Lfunc_end4-_Z13add_three_GPUPfS_S_S_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 468
; NumSgprs: 22
; NumVgprs: 20
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 22
; NumVGPRsForWavesPerEU: 20
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z24multiple_matrices_sharedPfS_S_ii ; -- Begin function _Z24multiple_matrices_sharedPfS_S_ii
	.globl	_Z24multiple_matrices_sharedPfS_S_ii
	.p2align	8
	.type	_Z24multiple_matrices_sharedPfS_S_ii,@function
_Z24multiple_matrices_sharedPfS_S_ii:   ; @_Z24multiple_matrices_sharedPfS_S_ii
; %bb.0:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z24multiple_matrices_sharedPfS_S_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 32
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 1
		.amdhsa_next_free_sgpr 1
		.amdhsa_reserve_vcc 0
		.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_end5:
	.size	_Z24multiple_matrices_sharedPfS_S_ii, .Lfunc_end5-_Z24multiple_matrices_sharedPfS_S_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 4
; NumSgprs: 0
; NumVgprs: 0
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 1
; NumVGPRsForWavesPerEU: 1
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z16add_matrices_GPUPfS_S_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z16add_matrices_GPUPfS_S_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     16
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z21multiple_matrices_GPUPfS_S_i
    .private_segment_fixed_size: 0
    .sgpr_count:     22
    .sgpr_spill_count: 0
    .symbol:         _Z21multiple_matrices_GPUPfS_S_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     18
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         20
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         28
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         30
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         32
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         34
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         36
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         38
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         80
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z20transpose_matrix_GPUPfi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z20transpose_matrix_GPUPfi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     16
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .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:           _Z25transpose_copy_matrix_GPUPfS_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z25transpose_copy_matrix_GPUPfS_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     15
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z13add_three_GPUPfS_S_S_i
    .private_segment_fixed_size: 0
    .sgpr_count:     22
    .sgpr_spill_count: 0
    .symbol:         _Z13add_three_GPUPfS_S_S_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     20
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 32
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z24multiple_matrices_sharedPfS_S_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     0
    .sgpr_spill_count: 0
    .symbol:         _Z24multiple_matrices_sharedPfS_S_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     0
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
