#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <sys/time.h>

#define error 1e-6
#define BLOCK_SIZE 32

///////////////////////////////////////// UTILITIES ////////////////////////////////////////////////////////////////////////////////////////////
/*
**********************************************************************
function name: init_Array
description: create a matrix with random values
parameters:
            &x pointer to a row x col Matrix
return: None
**********************************************************************
*/

void init_Array(float *x, int m, int n){
    for(int i = 0; i < m; i++){
        for(int j = 0; j < n; j++){
            x[i * n + j] = rand() % 1000;
        }
    } 
}

/*
**********************************************************************
function name: init_0_Array
description: create a matrix that cointains a high number of zero values, but every row have at least one non-zero values
parameters:
            &x pointer to a row x col Matrix
return: None
**********************************************************************
*/

void init_0_Array(float *x, int row, int col){
    bool ultimo =  false;

    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){

            if(j ==  col - 1 && !ultimo){
                ultimo = true;
            }
            float r = (float) rand() / RAND_MAX;
            if(r <= 0.25){

                x[i*col + j] = rand() % 1000;
                ultimo = false;

            } else{

                if (!ultimo){

                    x[i*col + j] = 0;

                } else {

                    x[i*col + j] = rand() % 1000;
                    ultimo = false;

                }
            }
        }
    }

}

/*
**********************************************************************
function name: count_NUM
description: count the non-zero elements of a matrix
parameters:
            &x pointer to a row x col Matrix
return: the total number of non-zero elements
**********************************************************************
*/

int count_Num(float *x, int row, int col){

    int count = 0;

    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){
            if(x[i*col + j] != 0){
                count++;
            }
        }
    }

    return count;
}

/*
**********************************************************************
function name: sparse_matrix
description: convert a matric in a sparse matrix format in CSR
parameters:
            &x pointer to a row x col matrix
            &rows pointer to a rows + 1 vector: points to the first element in each row and assigns it the value of its index in value
            &cols pointer to a size vector: the column to which each non-zero value belongs 
            &val pointer to a size vector: contains every non-zero value of the x matrix
return: None
**********************************************************************
*/

void sparse_matrix(float *x, int *rows, int *cols, float *val, int row, int col){

    int antes = -1;
    int count = 0;
    int count_row = 0;
    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){
            if(x[i*col + j] != 0){

                if(i != antes){
                    rows[count_row] = count;
                    antes = i;
                    count_row++;
                }
                cols[count] = j;
                val[count] = x[i*col + j];
                count++;
            }
        }
    }
}

/*
**********************************************************************
function name: cpuSecond()
description: when it is called you obtain the exact time in this moment
return: the time in microseonds
**********************************************************************
*/

double cpuSecond() {
    struct timeval tp;
    gettimeofday(&tp,NULL);
    return ((double)tp.tv_sec + (double)tp.tv_usec*1.e-6);
}

/*
**********************************************************************
function name: print_matrix
description: print a matrix compose by (float) elements
parameters:
            &a pointer to a row x col Matrix
return: None
**********************************************************************
*/

void print_matrix(float *a, int row, int col){

    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){
            printf("%f ",a[i * col + j]);
        }
        printf("\n");
    }
    printf("\n");
}

/*
**********************************************************************
function name: print_imatrix
description: print a matrix compose by (int) elements
parameters:
            &a pointer to a row x col Matrix
return: None
**********************************************************************
*/

void print_imatrix(int *a, int row, int col){

    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){
            printf("%d ",a[i * col + j]);
        }
        printf("\n");
    }
    printf("\n");
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////









//////////////////////////////////////// GPU KERNEL METHODS //////////////////////////////////////////////////////////////////
/*
*********************************************************************
function name: mmatrix
description: dot product of two matrix (not only square) in GPU
parameters: 
            &a GPU device pointer to a m X n matrix (A)
            &b GPU device pointer to a n X k matrix (B)
            &c GPU device output purpose pointer to a m X k matrix (C) 
            to store the result
Note:
    grid and block should be configured as:
        dim3 dimGrid((k + BLOCK_SIZE - 1) / BLOCK_SIZE,(m + BLOCK_SIZE - 1) / BLOCK_SIZE;
        dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);
    further sppedup can be obtained by using shared memory to decrease global memory access times
return: none
*********************************************************************
*/

__global__ void mmatrix(float *a, float *b, float *c, int m, int n, int k){

    unsigned int row = blockIdx.y * blockDim.y + threadIdx.y;
    unsigned int col = blockIdx.x * blockDim.x + threadIdx.x;
    float sum = 0.0;


    if(col < k && row < m){

        for(int i = 0; i < n; i++){
            sum += a[row * n + i] * b[i * k + col];
        }

        c[row * k + col] = sum;
    }
}

/*
*********************************************************************
function name: gpuMatrixConv
description: implementation of the convultion  operation
parameters: 
            &a GPU device pointer to a row1 X col1 matrix (A)
            &b GPU device pointer to a row2 X col2 matrix (B)
            &c GPU device output purpose pointer to a row3 X col3 matrix (C) 
            to store the result
Note:
    grid and block should be configured as:
        dim3 dimGrid((col3 + BLOCK_SIZE - 1) / BLOCK_SIZE,(row3 + BLOCK_SIZE - 1) / BLOCK_SIZE;
        dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);
    further sppedup can be obtained by using shared memory to decrease global memory access times
return: none
*********************************************************************
*/

__global__ void gpuMatrixConv(float *a, float *b, float *c, int row1, int col1, int row2, int col2, int row3, int col3)
{
	unsigned int row = blockIdx.y * blockDim.y + threadIdx.y;
	unsigned int col = blockIdx.x * blockDim.x + threadIdx.x;
    float sum = 0.0;

	if (row < row3 && col < col3) {
		for (int i = 0; i < row2; i++) {
			for (int j = 0; j < col2; j++) {
                sum += a[(row + i) * col1 + col + j] * b[i * row2 + j];
                
            }
        }
		c[row * col3 + col] = sum;
	}
}

/*
*********************************************************************
function name: gpu_matrix_transpose
description: matrix transpose
parameters: 
            &mat_in GPU device pointer to a rows X cols matrix
            &mat_out GPU device output purpose pointer to a cols X rows matrix 
            to store the result
Note:
    grid and block should be configured as:
        dim3 dim_grid((col + BLOCK_SIZE - 1) / BLOCK_SIZE, (row + BLOCK_SIZE - 1) / BLOCK_SIZE, 1);
        dim3 dim_block(BLOCK_SIZE, BLOCK_SIZE, 1);

return: none
*********************************************************************
*/

__global__ void gpuMatrixTranpose(float *a, float *b, int rows, int cols){

    unsigned int row = blockIdx.y * blockDim.y + threadIdx.y;
    unsigned int col = blockIdx.x * blockDim.x + threadIdx.x;

    if(row < rows && col < cols){

        int pos_a = row * cols + col;
        int pos_b = col * rows + row;
        b[pos_b] = a[pos_a];
        
    }
}

/*
*********************************************************************
function name: gpuMatrixConv
description: implementation the matrix * vector in sparse format CSR
parameters: 
            &values GPU device pointer to a size vector (values): the non-zero values for the original matrix
            &vector GPU device pointer to a col vector (x): to multiply the non-zero values
            &rows GPU device pointer to a rows + 1 vector (row): points to the first element in each row and assigns it the value of its index in value
            &cols GPU device pointer to a col size vector (col): the column to which each non-zero value belongs 
            &res GPU device output purpose pointer to a row vector (C) 
            to store the result
Note:
    grid and block should be configured as:
        dim3 dimGrid((col3 + BLOCK_SIZE - 1) / BLOCK_SIZE,(row3 + BLOCK_SIZE - 1) / BLOCK_SIZE;
        dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);
    further sppedup can be obtained by using shared memory to decrease global memory access times
return: none
*********************************************************************
*/
__global__ void gpuMVSparse(float *values, float *vector, int *rows, int *cols,float *res, int row){

    unsigned int Id = threadIdx.x + blockDim.x * blockIdx.x;

    if(Id < row){
        for(int k = rows[Id]; k < rows[Id+1]; k++){
            res[Id] += values[k]*vector[cols[k]];
        }
    }
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////










//////////////////////////////////////////////////// CPU METHODS AND GPU PREPARATION ///////////////////////////////////////////////////////////

/*
**********************************************************************
function name: sparse_preparation
description:    compare the CPU and GPU implementation of a matrix * vector multiplication in sparse format
                1º obtaint the size of the matrix 
                2º create the matrix 
                3º count the non-zero values
                4º tranfor into CSR format
                5º Do the operation
                6º compare the results
                Optional: print the results           
return: None
**********************************************************************
*/

void sparse_preparation(){

    int col, row, val;
    bool bien = true;

    printf("\n");
    printf("\n");
    SP1: printf("Introduce the rows of A:\n");
    fflush(stdout);
    val = scanf("%d", &row);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto SP1;
    }
    SP2: printf("Introduce the columns of A:\n");
    fflush(stdout);
    val = scanf("%d", &col);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto SP2;
    }


    double start_GPU, stop_GPU;
    double start_CPU, stop_CPU;
    double diferencia_CPU, diferencia_GPU;

    float *A = (float *)malloc(row * col * sizeof(float));
    float *vector = (float *)malloc(col * sizeof(float));

    init_Array(vector, 1, col);
    init_0_Array(A, row, col);
    int size = count_Num(A, row, col);

    float *values = (float *)malloc(size * sizeof(float));
    int *rows = (int *)malloc((row + 1) * sizeof(int));
    int *cols = (int *)malloc(size * sizeof(int));

    float *res = (float *)malloc(row * sizeof(float));
    float *res_F = (float *)malloc(row * sizeof(float));

    sparse_matrix(A, rows, cols, values, row, col);
    rows[row] = size;

    int *rows_GPU;
    int *cols_GPU;
    float *values_GPU;
    float *res_GPU;
    float *vector_GPU;

    cudaMalloc(&rows_GPU, (row + 1) * sizeof(int));
    cudaMalloc(&cols_GPU, size * sizeof(int));
    cudaMalloc(&values_GPU, size * sizeof(float));
    cudaMalloc(&res_GPU, row * sizeof(float));
    cudaMalloc(&vector_GPU, col * sizeof(float));
    cudaMemset(res_GPU, 0, row * sizeof(float));

    cudaMemcpy(rows_GPU, rows, (row +1) * sizeof(int), cudaMemcpyHostToDevice);
    cudaMemcpy(cols_GPU, cols, size * sizeof(int), cudaMemcpyHostToDevice);
    cudaMemcpy(values_GPU, values, size * sizeof(float), cudaMemcpyHostToDevice);
    cudaMemcpy(vector_GPU, vector, col * sizeof(float), cudaMemcpyHostToDevice);
    //Start CPU Part//

    start_CPU = cpuSecond();


    for(int k = 0; k < row; k++){
        res[k] = 0;
    }
    for(int i = 0; i < row; i++){
        for(int k = rows[i]; k < rows[i + 1]; k++){

            res[i] += values[k]*vector[cols[k]];
        }
    }

    stop_CPU = cpuSecond();
    diferencia_CPU = stop_CPU - start_CPU;
    

    //Stop Cpu Part // 

    unsigned int GRID = col + BLOCK_SIZE - 1 / BLOCK_SIZE;

    
    //Init GPU part//

    start_GPU = cpuSecond();

    gpuMVSparse<<<GRID, BLOCK_SIZE>>>(values_GPU, vector_GPU, rows_GPU, cols_GPU, res_GPU, row);

    cudaDeviceSynchronize();
    cudaMemcpy(res_F, res_GPU, row * sizeof(float), cudaMemcpyDeviceToHost);

    stop_GPU = cpuSecond();

    diferencia_GPU = stop_GPU - start_GPU;

    //Stop GPU part//

    //Start Checking //
    
    for(int j = 0; j < row; j++){
        if(fabs(res_F[j] - res[j]) >= error ){
            bien = false;
            printf("Error en: %f %f\n", res_F[j], res[j]);
        }
    }


    if(bien){
        printf("Comparing the output for each implementation.. Correct!\n");
    }else {
        printf("Comparing the output for each implementation.. Incorrect!\n");
    }

    char d;
    printf("Do you want to print the matrix:\n");
    printf("YES: y  or NO: n\n");
    fflush(stdout);
    scanf(" %c", &d);
    if(d == 'y'){
        print_matrix(A,row,col);
        print_matrix(values, 1, size);
        print_imatrix(rows, 1, (col + 1));
        print_imatrix(cols, 1 ,size);
        print_matrix(res,row,1);
        print_matrix(res_F,row,1);
        fflush(stdout);
    }

    printf("Duration of the CPU: %f\n", diferencia_CPU);
    printf("Duration of the GPU: %f\n", diferencia_GPU);

    delete[] A;
    delete[] vector;
    delete[] cols;
    delete[] rows;
    delete[] res;
    delete[] res_F;
    delete[] values;
    cudaFree(values_GPU);
    cudaFree(cols_GPU);
    cudaFree(rows_GPU);
    cudaFree(res_GPU);
    cudaFree(vector_GPU);
    
}

/*
**********************************************************************
function name: transpose_preparation
description:    compare the CPU and GPU implementation of the transpose operation
                1º obtaint the size of the matrix 
                2º create the matrix 
                3º Do the operation
                4º compare the results
                Optional: print the results           
return: None
**********************************************************************
*/

void tranpose_preparation(){

    int col, row, val;
    bool bien = true;

    printf("\n");
    printf("\n");
    TR1: printf("Introduce the rows of A:\n");
    fflush(stdout);
    val = scanf("%d", &row);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto TR1;
    }
    TR2: printf("Introduce the columns of A:\n");
    fflush(stdout);
    val = scanf("%d", &col);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto TR2;
    }


    double start_GPU, stop_GPU;
    double start_CPU, stop_CPU;
    double diferencia_CPU, diferencia_GPU;

    float *A = (float *)malloc(row * col * sizeof(float));
    float *res = (float *)malloc(row * col * sizeof(float));
    float *res_F = (float *)malloc(row * col * sizeof(float));



    float *A_GPU;
    float *res_GPU;

    cudaMalloc(&A_GPU, row * col * sizeof(float));
    cudaMalloc(&res_GPU, row  * col * sizeof(float));

    init_Array(A, row, col);

    cudaMemcpy(A_GPU, A, row * col * sizeof(float), cudaMemcpyHostToDevice);

    //Start CPU Part//

    start_CPU = cpuSecond();

    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){

            int pos_a = i * col + j;
            int pos_res = j * row + i;

            res[pos_res] = A[pos_a]; 
        }
    }


    stop_CPU = cpuSecond();
    diferencia_CPU = stop_CPU - start_CPU;
    //Stop Cpu Part // 

    unsigned int grid_rows = (row + BLOCK_SIZE - 1) / BLOCK_SIZE;
    unsigned int grid_colm = (col + BLOCK_SIZE - 1) / BLOCK_SIZE;

    dim3 dimGrid(grid_colm, grid_rows);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);

    
    //Init GPU part//

    start_GPU = cpuSecond();

    gpuMatrixTranpose<<<dimGrid, dimBlock>>>(A_GPU, res_GPU, row, col);

    cudaDeviceSynchronize();
    cudaMemcpy(res_F, res_GPU, row * col * sizeof(float), cudaMemcpyDeviceToHost);

    stop_GPU = cpuSecond();

    diferencia_GPU = stop_GPU - start_GPU;

    //Stop GPU part//

    //Start Checking //

    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){
            if(fabs(res_F[i * col + j] - res[i*col + j]) >= error ){
                bien = false;
                printf("Error en: %f %f\n", res_F[i * col + j], res[i * col + j]);
            }
        }
    }

    if(bien){
        printf("Comparing the output for each implementation.. Correct!\n");
    }else {
        printf("Comparing the output for each implementation.. Incorrect!\n");
    }

    char d;
    printf("Do you want to print the differents matrix:\n");
    printf("YES: y  or NO: n\n");
    fflush(stdout);
    scanf(" %c", &d);
    if(d == 'y'){
        print_matrix(A,row,col);
        print_matrix(res,col,row);
        print_matrix(res_F,col,row);
        fflush(stdout);
    }

    printf("Duration of the CPU: %f\n", diferencia_CPU);
    printf("Duration of the GPU: %f\n", diferencia_GPU);

    cudaFreeHost(A);
    cudaFreeHost(res);
    cudaFreeHost(res_F);
    cudaFree(A_GPU);
    cudaFree(res_GPU);

}

/*
**********************************************************************
function name: conv_preparation
description:    compare the CPU and GPU implementation of the convultion operation
                1º obtaint the size of the matrix A and the square matrix B
                2º create the matrix A and B with random values 
                3º Do the operation
                4º compare the results
                Optional: print the results           
return: None
**********************************************************************
*/

void conv_preparation(){

    int col1, row1, col2, row2, col3, row3, val;
    bool bien = true;

    INTRO: printf("\n");
    printf("\n");
    CO1: printf("Introduce the rows of A:\n");
    fflush(stdout);
    val = scanf("%d", &row1);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto CO1;
    }
    CO2: printf("Introduce the colums of A:\n");
    fflush(stdout);
    val = scanf("%d", &col1);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto CO2;
    }
    CO3: printf("Introduce the rows and colums of B:\n");
    fflush(stdout);
    val = scanf("%d", &col2);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto CO3;
    }
    row2 = col2;

    if(row2 >= row1 || col2 >= col1 ) {
        printf("You must introduce again the numbers, the matrix (rows and colums) A have to be higher than B\n");
        goto INTRO;
    }

    col3 = col1 - col2 + 1;
    row3 = row1 - row2 + 1;

    double start_GPU, stop_GPU;
    double start_CPU, stop_CPU;
    double diferencia_CPU, diferencia_GPU;

    float *A = (float *)malloc(row1 * col1 * sizeof(float));
    float *B = (float *)malloc(row2 * col2 * sizeof(float));
    float *res = (float *)malloc(row3 * col3 * sizeof(float));
    float *res_F = (float *)malloc(row3 * col3 * sizeof(float));



    float *A_GPU;
    float *B_GPU;
    float *res_GPU;

    cudaMalloc(&A_GPU, row1 * col1 * sizeof(float));
    cudaMalloc(&B_GPU, row2 * col2 * sizeof(float));
    cudaMalloc(&res_GPU, row3  * col3 * sizeof(float));

    init_Array(A, row1, col1);
    init_Array(B, row2, col2);

    cudaMemcpy(A_GPU, A, row1 * col1 * sizeof(float), cudaMemcpyHostToDevice);
    cudaMemcpy(B_GPU, B, row2 * col2 * sizeof(float), cudaMemcpyHostToDevice);

    //Start CPU Part//

    start_CPU = cpuSecond();

    int i, j ,k, z;
    float sum = 0.0;

    for(i = 0; i < row3; i++){
        for(z = 0; z < col3; z++){

            sum = 0.0;

            for(j = 0; j < row2; j++){
                for(k = 0; k < col2; k++){

                    sum += A[(i + j) * col1 + z + k] * B[j * row2 + k];
                
                }
            }
            res[i * col3 + z] = sum;
        }
    }


    stop_CPU = cpuSecond();
    diferencia_CPU = stop_CPU - start_CPU;
    //Stop Cpu Part // 

    unsigned int grid_rows = (row3 + BLOCK_SIZE - 1) / BLOCK_SIZE;
    unsigned int grid_colm = (col3 + BLOCK_SIZE - 1) / BLOCK_SIZE;

    dim3 dimGrid(grid_colm, grid_rows);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);

    
    //Init GPU part//

    start_GPU = cpuSecond();

    gpuMatrixConv<<<dimGrid, dimBlock>>>(A_GPU, B_GPU, res_GPU, row1, col1, row2, col2, row3, col3);

    cudaDeviceSynchronize();
    cudaMemcpy(res_F, res_GPU, row3 * col3 * sizeof(float), cudaMemcpyDeviceToHost);

    stop_GPU = cpuSecond();

    diferencia_GPU = stop_GPU - start_GPU;

    //Stop GPU part//

    //Start Checking //

    for(int i = 0; i < row3; i++){
        for(int j = 0; j < col3; j++){
            if(fabs(res_F[i * col3 + j] - res[i*col3 + j]) >= error ){
                bien = false;
                printf("Error: %f %f\n", res_F[i * col3 + j], res[i * col3 + j]);
            }
        }
    }

    if(bien){
        printf("Comparing the output for each implementation.. Correct!\n");
    }else {
        printf("Comparing the output for each implementation.. Incorrect!\n");
    }

    char d;
    printf("Do you want to print the matrix:\n");
    printf("YES: y  or NO: n\n");
    fflush(stdout);
    scanf(" %c", &d);

    if(d == 'y'){
        print_matrix(A,row1,col1);
        print_matrix(B,row2, col2);
        print_matrix(res,row3,col3);
        print_matrix(res_F,row3,col3);
        fflush(stdout);
    }

    printf("Duration of the CPU: %f\n", diferencia_CPU);
    printf("Duration of the GPU: %f\n", diferencia_GPU);

    cudaFreeHost(A);
    cudaFreeHost(B);
    cudaFreeHost(res);
    cudaFreeHost(res_F);
    cudaFree(A_GPU);
    cudaFree(B_GPU);
    cudaFree(res_GPU);

}

/*
**********************************************************************
function name: matrix_preparation
description:    compare the CPU and GPU implementation of the matrix multiplication
                1º obtaint the size of the matrix A and the  matrix B
                2º create the matrix A and B with random values 
                3º Do the operation
                4º compare the results
                Optional: print the results           
return: None
**********************************************************************
*/

void matrix_preparation(){

    int m, n, k, val;

    printf("\n");
    printf("\n");
    MA1: printf("Introduce the rows of A:\n");
    fflush(stdout);
    val = scanf("%d", &m);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto MA1;
    }

    MA2: printf("Introduce the columns of A:\n");
    fflush(stdout);
    val = scanf("%d", &n);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto MA2;
    }
    MA3: printf("Introduce The columns of B:\n");
    fflush(stdout);
    val = scanf("%d", &k);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto MA3;
    }

    bool bien = true;


    double start_GPU, stop_GPU;
    double start_CPU, stop_CPU;
    double diferencia_CPU, diferencia_GPU;

    float *A = (float *)malloc(m * n * sizeof(float));
    float *B = (float *)malloc(n * k * sizeof(float));
    float *res = (float *)malloc(m * k * sizeof(float));
    float *res_F = (float *)malloc(m * k * sizeof(float));

    float *A_GPU;
    float *B_GPU;
    float *res_GPU;

    cudaMalloc(&A_GPU, m * n * sizeof(float));
    cudaMalloc(&B_GPU, n * k * sizeof(float));
    cudaMalloc(&res_GPU, m  * k * sizeof(float));
    init_Array(A, m, n);
    init_Array(B, n, k);
    cudaMemcpy(A_GPU, A, m * n * sizeof(float), cudaMemcpyHostToDevice);
    cudaMemcpy(B_GPU, B, n * k * sizeof(float), cudaMemcpyHostToDevice);

    unsigned int grid_rows = (m + BLOCK_SIZE - 1) / BLOCK_SIZE;
    unsigned int grid_colm = (k + BLOCK_SIZE - 1) / BLOCK_SIZE;
    dim3 dimGrid(grid_colm, grid_rows);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);

    //init CPU part//

    start_CPU = cpuSecond();

    for(int i = 0; i < m; i++){
        for(int j = 0; j < k; j++){
            float cont = 0.0;
            for(int z = 0; z < n; z++){
                cont += A[i * n + z] * B[z * k + j];
            }
            res[i * k + j] = cont;
        }
    }

    stop_CPU = cpuSecond();
    diferencia_CPU = stop_CPU - start_CPU;

    //init GPU Part//

    start_GPU = cpuSecond();

    mmatrix<<<dimGrid, dimBlock>>>(A_GPU, B_GPU, res_GPU, m, n, k);

    cudaDeviceSynchronize();
    cudaMemcpy(res_F, res_GPU, m * k * sizeof(float), cudaMemcpyDeviceToHost);
    
    stop_GPU = cpuSecond();
    diferencia_GPU = stop_GPU - start_GPU;


    //check if it is correct//
    for(int i = 0; i < m; i++){
        for(int j = 0; j < k; j++){
            if(fabs(res_F[i * k + j] - res[i*k + j]) >= error ){
                bien = false;
                break;
            }
        }
        if(!bien){break;}
    }

    if(bien){
        printf("Comparing the output for each implementation.. Correct!\n");
    }else {
        printf("Comparing the output for each implementation.. Incorrect!\n");
    }


    char d;
    printf("Do you want to print the matrix:\n");
    printf("YES: y  or NO: n\n");
    fflush(stdout);
    scanf(" %c", &d);

    if(d == 'y'){
        print_matrix(A,m,n);
        print_matrix(B,n, k);
        print_matrix(res,m,k);
        print_matrix(res_F,m,k);
        fflush(stdout);
    }

    printf("Duration of the CPU: %f\n", diferencia_CPU);
    printf("Duration of the GPU: %f\n", diferencia_GPU);

    cudaFreeHost(A);
    cudaFreeHost(B);
    cudaFreeHost(res);
    cudaFreeHost(res_F);
    cudaFree(A_GPU);
    cudaFree(B_GPU);
    cudaFree(res_GPU);

}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////











///////////////////////////////////////////////////////////// MAIN //////////////////////////////////////////////////////////////////////////////
int main( int argc, char *argv[]){
    
    int op, val;
    bool salir = false;

 
    START: printf("\n");
    printf("\n");
    printf("******************************************\n");
    printf("* Select the operation you want to do:   *\n");
    printf("*                                        *\n");
    printf("* 1. Matrix Multiplication               *\n");
    printf("* 2. Matrix Convection                   *\n");
    printf("* 3. Matrix Transpose                    *\n");
    printf("* 4. Matrix-Vector Sparse                *\n");
    printf("* 5. Exit                                *\n");
    printf("*                                        *\n");
    printf("******************************************\n");
    fflush(stdout);
    printf("Introduce the number of the operation:\n");
    fflush(stdout);
    val = scanf("%d", &op);

    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid option, please do it again.\n");
        goto START;

    }else{
        switch(op){
            case 1:

                matrix_preparation();
                fflush(stdout);
                break;

            case 2:
            
                conv_preparation();
                fflush(stdout);
                break;

            case 3:

                tranpose_preparation();
                fflush(stdout);
                break;
            
            case 4:

                sparse_preparation();
                fflush(stdout);
                break;

            case 5:

                salir = true;
                printf("Successful Exit\n");
                fflush(stdout);
                break;

            default:
                printf("You dont select any option, please do it again\n");
                fflush(stdout);
                break;
        }
        if(!salir){goto START;}
    }
    return 0;
}
	.file	"tmpxft_0025e368_00000000-6_projecte1.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2041:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2041:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0, @function
_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0:
.LFB2190:
	.cfi_startproc
	jmp	cudaMalloc@PLT
	.cfi_endproc
.LFE2190:
	.size	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0, .-_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	.globl	_Z10init_ArrayPfii
	.type	_Z10init_ArrayPfii, @function
_Z10init_ArrayPfii:
.LFB2027:
	.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
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	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
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L4:
	cmpl	%esi, %r14d
	jge	.L3
	movslq	%r13d, %rax
	xorl	%ebx, %ebx
	leaq	(%r12,%rax,4), %r15
.L7:
	cmpl	%ebx, %ebp
	jle	.L10
	movl	%esi, 12(%rsp)
	call	rand@PLT
	movl	$1000, %ecx
	movl	12(%rsp), %esi
	cltd
	idivl	%ecx
	cvtsi2ssl	%edx, %xmm0
	movss	%xmm0, (%r15,%rbx,4)
	incq	%rbx
	jmp	.L7
.L10:
	incl	%r14d
	addl	%ebp, %r13d
	jmp	.L4
.L3:
	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
.LFE2027:
	.size	_Z10init_ArrayPfii, .-_Z10init_ArrayPfii
	.globl	_Z12init_0_ArrayPfii
	.type	_Z12init_0_ArrayPfii, @function
_Z12init_0_ArrayPfii:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%esi, %r15d
	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
	xorl	%r13d, %r13d
	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
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L12:
	cmpl	%r15d, %r14d
	jge	.L11
	movslq	%r13d, %rax
	xorl	%ebx, %ebx
	leaq	(%r12,%rax,4), %rax
	movq	%rax, (%rsp)
.L18:
	movl	%ebx, %edx
	cmpl	%ebx, %ebp
	jle	.L24
	movl	%edx, 12(%rsp)
	call	rand@PLT
	movss	.LC2(%rip), %xmm1
	movl	12(%rsp), %edx
	cvtsi2ssl	%eax, %xmm0
	mulss	.LC1(%rip), %xmm0
	comiss	%xmm0, %xmm1
	jnb	.L23
	leal	-1(%rbp), %eax
	xorps	%xmm0, %xmm0
	cmpl	%edx, %eax
	jne	.L15
.L23:
	call	rand@PLT
	movl	$1000, %ecx
	cltd
	idivl	%ecx
	cvtsi2ssl	%edx, %xmm0
.L15:
	movq	(%rsp), %rax
	movss	%xmm0, (%rax,%rbx,4)
	incq	%rbx
	jmp	.L18
.L24:
	incl	%r14d
	addl	%ebp, %r13d
	jmp	.L12
.L11:
	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
.LFE2028:
	.size	_Z12init_0_ArrayPfii, .-_Z12init_0_ArrayPfii
	.globl	_Z9count_NumPfii
	.type	_Z9count_NumPfii, @function
_Z9count_NumPfii:
.LFB2029:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	xorps	%xmm0, %xmm0
	xorl	%ecx, %ecx
.L26:
	cmpl	%esi, %r9d
	jge	.L25
	movslq	%r8d, %rax
	leaq	(%rdi,%rax,4), %r10
	xorl	%eax, %eax
.L31:
	cmpl	%eax, %edx
	jle	.L33
	ucomiss	(%r10,%rax,4), %xmm0
	jp	.L32
	je	.L27
.L32:
	incl	%ecx
.L27:
	incq	%rax
	jmp	.L31
.L33:
	incl	%r9d
	addl	%edx, %r8d
	jmp	.L26
.L25:
	movl	%ecx, %eax
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z9count_NumPfii, .-_Z9count_NumPfii
	.globl	_Z13sparse_matrixPfPiS0_S_ii
	.type	_Z13sparse_matrixPfPiS0_S_ii, @function
_Z13sparse_matrixPfPiS0_S_ii:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rsi, %r11
	xorl	%r10d, %r10d
	xorl	%esi, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorps	%xmm1, %xmm1
	orl	$-1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rcx, %rbp
	xorl	%ecx, %ecx
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdx, %rbx
	xorl	%edx, %edx
.L35:
	cmpl	%r8d, %edx
	jge	.L34
	movslq	%esi, %rax
	leaq	(%rdi,%rax,4), %r13
	xorl	%eax, %eax
.L41:
	cmpl	%eax, %r9d
	jle	.L44
	movss	0(%r13,%rax,4), %xmm0
	ucomiss	%xmm1, %xmm0
	jp	.L42
	je	.L36
.L42:
	cmpl	%edx, %r12d
	je	.L38
	movslq	%r10d, %r12
	incl	%r10d
	movl	%ecx, (%r11,%r12,4)
.L38:
	movslq	%ecx, %r12
	incl	%ecx
	movl	%eax, (%rbx,%r12,4)
	movss	%xmm0, 0(%rbp,%r12,4)
	movl	%edx, %r12d
.L36:
	incq	%rax
	jmp	.L41
.L44:
	incl	%edx
	addl	%r9d, %esi
	jmp	.L35
.L34:
	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
.LFE2030:
	.size	_Z13sparse_matrixPfPiS0_S_ii, .-_Z13sparse_matrixPfPiS0_S_ii
	.globl	_Z9cpuSecondv
	.type	_Z9cpuSecondv, @function
_Z9cpuSecondv:
.LFB2031:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	gettimeofday@PLT
	cvtsi2sdq	16(%rsp), %xmm0
	mulsd	.LC3(%rip), %xmm0
	cvtsi2sdq	8(%rsp), %xmm1
	addsd	%xmm1, %xmm0
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z9cpuSecondv, .-_Z9cpuSecondv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC4:
	.string	"%f "
.LC5:
	.string	"\n"
	.text
	.globl	_Z12print_matrixPfii
	.type	_Z12print_matrixPfii, @function
_Z12print_matrixPfii:
.LFB2032:
	.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
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L49:
	cmpl	%r14d, %r13d
	jge	.L51
	movslq	%r12d, %rax
	xorl	%r15d, %r15d
	leaq	0(%rbp,%rax,4), %rcx
.L52:
	cmpl	%r15d, %ebx
	jle	.L54
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	(%rcx,%r15,4), %xmm0
	movq	%rcx, 8(%rsp)
	incq	%r15
	call	__printf_chk@PLT
	movq	8(%rsp), %rcx
	jmp	.L52
.L54:
	leaq	.LC5(%rip), %rsi
	xorl	%eax, %eax
	incl	%r13d
	addl	%ebx, %r12d
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L49
.L51:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	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
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2032:
	.size	_Z12print_matrixPfii, .-_Z12print_matrixPfii
	.section	.rodata.str1.1
.LC6:
	.string	"%d "
	.text
	.globl	_Z13print_imatrixPiii
	.type	_Z13print_imatrixPiii, @function
_Z13print_imatrixPiii:
.LFB2033:
	.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
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L56:
	cmpl	%r14d, %r13d
	jge	.L58
	movslq	%r12d, %rax
	xorl	%r15d, %r15d
	leaq	0(%rbp,%rax,4), %r8
.L59:
	cmpl	%r15d, %ebx
	jle	.L61
	movl	(%r8,%r15,4), %edx
	leaq	.LC6(%rip), %rsi
	xorl	%eax, %eax
	incq	%r15
	movl	$2, %edi
	movq	%r8, 8(%rsp)
	call	__printf_chk@PLT
	movq	8(%rsp), %r8
	jmp	.L59
.L61:
	leaq	.LC5(%rip), %rsi
	xorl	%eax, %eax
	incl	%r13d
	addl	%ebx, %r12d
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L56
.L58:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	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
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2033:
	.size	_Z13print_imatrixPiii, .-_Z13print_imatrixPiii
	.globl	_Z33__device_stub__Z7mmatrixPfS_S_iiiPfS_S_iii
	.type	_Z33__device_stub__Z7mmatrixPfS_S_iiiPfS_S_iii, @function
_Z33__device_stub__Z7mmatrixPfS_S_iiiPfS_S_iii:
.LFB2063:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 20(%rsp)
	leaq	64(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L62
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z7mmatrixPfS_S_iii(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L62:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L64
	call	__stack_chk_fail@PLT
.L64:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2063:
	.size	_Z33__device_stub__Z7mmatrixPfS_S_iiiPfS_S_iii, .-_Z33__device_stub__Z7mmatrixPfS_S_iiiPfS_S_iii
	.globl	_Z7mmatrixPfS_S_iii
	.type	_Z7mmatrixPfS_S_iii, @function
_Z7mmatrixPfS_S_iii:
.LFB2064:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z7mmatrixPfS_S_iiiPfS_S_iii
	.cfi_endproc
.LFE2064:
	.size	_Z7mmatrixPfS_S_iii, .-_Z7mmatrixPfS_S_iii
	.section	.rodata.str1.1
.LC7:
	.string	"Introduce the rows of A:\n"
.LC8:
	.string	"%d"
.LC9:
	.string	"You don't introduce a valid number, please do it again.\n"
.LC10:
	.string	"Introduce the columns of A:\n"
.LC11:
	.string	"Introduce The columns of B:\n"
.LC13:
	.string	"Do you want to print the matrix:\n"
.LC14:
	.string	"YES: y  or NO: n\n"
.LC15:
	.string	" %c"
.LC16:
	.string	"Duration of the CPU: %f\n"
.LC17:
	.string	"Duration of the GPU: %f\n"
.LC18:
	.string	"Comparing the output for each implementation.. Correct!\n"
.LC19:
	.string	"Comparing the output for each implementation.. Incorrect!\n"
	.text
	.globl	_Z18matrix_preparationv
	.type	_Z18matrix_preparationv, @function
_Z18matrix_preparationv:
.LFB2037:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$2, %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
	leaq	.LC7(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC5(%rip), %rbx
	movq	%rbx, %rsi
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L68:
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	leaq	.LC8(%rip), %rbp
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	movq	%rbp, %rdi
	call	__isoc23_scanf@PLT
	testl	%eax, %eax
	je	.L70
	leaq	.LC10(%rip), %r12
	jmp	.L69
.L113:
	cmpl	$10, %eax
	je	.L93
.L70:
	call	getchar@PLT
	cmpl	$-1, %eax
	jne	.L113
.L93:
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L68
.L114:
	incl	%eax
	je	.L94
.L73:
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L114
.L94:
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L69:
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	32(%rsp), %rsi
	movq	%rbp, %rdi
	call	__isoc23_scanf@PLT
	testl	%eax, %eax
	je	.L73
	leaq	.LC11(%rip), %r12
	jmp	.L72
.L115:
	cmpl	$10, %eax
	je	.L95
.L76:
	call	getchar@PLT
	cmpl	$-1, %eax
	jne	.L115
.L95:
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L72:
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	36(%rsp), %rsi
	movq	%rbp, %rdi
	call	__isoc23_scanf@PLT
	testl	%eax, %eax
	je	.L76
	movl	28(%rsp), %r13d
	movl	32(%rsp), %ebp
	movl	%r13d, %r14d
	imull	%ebp, %r14d
	movslq	%r14d, %r14
	salq	$2, %r14
	movq	%r14, %rdi
	call	malloc@PLT
	movl	36(%rsp), %r12d
	movq	%rax, %rbx
	imull	%r12d, %ebp
	imull	%r12d, %r13d
	movslq	%ebp, %rdi
	movslq	%r13d, %r13
	salq	$2, %rdi
	call	malloc@PLT
	salq	$2, %r13
	movq	%r13, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, %r12
	call	malloc@PLT
	leaq	40(%rsp), %rdi
	movq	%r14, %rsi
	movq	%rax, %r13
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movl	32(%rsp), %esi
	imull	36(%rsp), %esi
	leaq	48(%rsp), %rdi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movl	28(%rsp), %esi
	imull	36(%rsp), %esi
	leaq	56(%rsp), %rdi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movl	32(%rsp), %edx
	movl	28(%rsp), %esi
	movq	%rbx, %rdi
	call	_Z10init_ArrayPfii
	movl	36(%rsp), %edx
	movl	32(%rsp), %esi
	movq	%rbp, %rdi
	call	_Z10init_ArrayPfii
	movl	28(%rsp), %edx
	imull	32(%rsp), %edx
	movq	%rbx, %rsi
	movq	40(%rsp), %rdi
	movl	$1, %ecx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	32(%rsp), %edx
	imull	36(%rsp), %edx
	movq	%rbp, %rsi
	movq	48(%rsp), %rdi
	movl	$1, %ecx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	28(%rsp), %eax
	movl	$32, %esi
	movl	$1, 72(%rsp)
	movl	$1, 84(%rsp)
	addl	$31, %eax
	cltd
	idivl	%esi
	movl	%eax, %ecx
	movl	36(%rsp), %eax
	movl	%ecx, 68(%rsp)
	addl	$31, %eax
	cltd
	idivl	%esi
	movl	%eax, 64(%rsp)
	movabsq	$137438953504, %rax
	movq	%rax, 76(%rsp)
	call	_Z9cpuSecondv
	movl	28(%rsp), %eax
	movslq	36(%rsp), %r9
	movl	32(%rsp), %r11d
	movsd	%xmm0, 8(%rsp)
	movl	%eax, (%rsp)
	movq	%r9, %rdi
	salq	$2, %r9
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	xorl	%r8d, %r8d
.L78:
	cmpl	%r8d, (%rsp)
	jle	.L82
	movslq	%esi, %rax
	leaq	(%r12,%rax,4), %r15
	movslq	%ecx, %rax
	leaq	(%rbx,%rax,4), %r14
	xorl	%eax, %eax
.L83:
	cmpl	%eax, %edi
	jle	.L80
	leaq	0(%rbp,%rax,4), %r10
	xorl	%edx, %edx
	xorps	%xmm0, %xmm0
.L81:
	cmpl	%edx, %r11d
	jle	.L116
	movss	(%r14,%rdx,4), %xmm1
	mulss	(%r10), %xmm1
	incq	%rdx
	addq	%r9, %r10
	addss	%xmm1, %xmm0
	jmp	.L81
.L116:
	movss	%xmm0, (%r15,%rax,4)
	incq	%rax
	jmp	.L83
.L80:
	incl	%r8d
	addl	%edi, %esi
	addl	%r11d, %ecx
	jmp	.L78
.L82:
	call	_Z9cpuSecondv
	subsd	8(%rsp), %xmm0
	movq	%xmm0, %r14
	call	_Z9cpuSecondv
	movl	84(%rsp), %ecx
	movl	72(%rsp), %esi
	xorl	%r9d, %r9d
	movq	76(%rsp), %rdx
	movq	64(%rsp), %rdi
	xorl	%r8d, %r8d
	movsd	%xmm0, (%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L84
	movl	36(%rsp), %r9d
	movl	32(%rsp), %r8d
	movl	28(%rsp), %ecx
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rsi
	movq	40(%rsp), %rdi
	call	_Z33__device_stub__Z7mmatrixPfS_S_iiiPfS_S_iii
.L84:
	call	cudaDeviceSynchronize@PLT
	movl	28(%rsp), %edx
	imull	36(%rsp), %edx
	movq	%r13, %rdi
	movq	56(%rsp), %rsi
	movl	$2, %ecx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	call	_Z9cpuSecondv
	subsd	(%rsp), %xmm0
	movl	28(%rsp), %edi
	xorl	%edx, %edx
	movl	36(%rsp), %esi
	movsd	.LC3(%rip), %xmm2
	xorl	%ecx, %ecx
	movss	.LC12(%rip), %xmm1
	movq	%xmm0, %r15
.L85:
	cmpl	%ecx, %edi
	jle	.L88
	movslq	%edx, %rax
	xorl	%r8d, %r8d
	salq	$2, %rax
.L89:
	cmpl	%r8d, %esi
	jle	.L117
	movss	0(%r13,%rax), %xmm0
	subss	(%r12,%rax), %xmm0
	addq	$4, %rax
	andps	%xmm1, %xmm0
	cvtss2sd	%xmm0, %xmm0
	comisd	%xmm2, %xmm0
	jnb	.L86
	incl	%r8d
	jmp	.L89
.L117:
	incl	%ecx
	addl	%esi, %edx
	jmp	.L85
.L88:
	leaq	.LC18(%rip), %rsi
	jmp	.L112
.L86:
	leaq	.LC19(%rip), %rsi
.L112:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC13(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	27(%rsp), %rsi
	leaq	.LC15(%rip), %rdi
	call	__isoc23_scanf@PLT
	cmpb	$121, 27(%rsp)
	jne	.L90
	movl	32(%rsp), %edx
	movl	28(%rsp), %esi
	movq	%rbx, %rdi
	call	_Z12print_matrixPfii
	movl	36(%rsp), %edx
	movl	32(%rsp), %esi
	movq	%rbp, %rdi
	call	_Z12print_matrixPfii
	movl	36(%rsp), %edx
	movl	28(%rsp), %esi
	movq	%r12, %rdi
	call	_Z12print_matrixPfii
	movl	36(%rsp), %edx
	movl	28(%rsp), %esi
	movq	%r13, %rdi
	call	_Z12print_matrixPfii
	movq	stdout(%rip), %rdi
	call	fflush@PLT
.L90:
	movq	%r14, %xmm0
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	call	__printf_chk@PLT
	movq	%r15, %xmm0
	leaq	.LC17(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	%rbx, %rdi
	call	cudaFreeHost@PLT
	movq	%rbp, %rdi
	call	cudaFreeHost@PLT
	movq	%r12, %rdi
	call	cudaFreeHost@PLT
	movq	%r13, %rdi
	call	cudaFreeHost@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L92
	call	__stack_chk_fail@PLT
.L92:
	addq	$104, %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
.LFE2037:
	.size	_Z18matrix_preparationv, .-_Z18matrix_preparationv
	.globl	_Z43__device_stub__Z13gpuMatrixConvPfS_S_iiiiiiPfS_S_iiiiii
	.type	_Z43__device_stub__Z13gpuMatrixConvPfS_S_iiiiiiPfS_S_iiiiii, @function
_Z43__device_stub__Z13gpuMatrixConvPfS_S_iiiiiiPfS_S_iiiiii:
.LFB2065:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movl	%ecx, 20(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%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	20(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	208(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	216(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	224(%rsp), %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L118
	pushq	56(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z13gpuMatrixConvPfS_S_iiiiii(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 224
	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 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L118:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L120
	call	__stack_chk_fail@PLT
.L120:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2065:
	.size	_Z43__device_stub__Z13gpuMatrixConvPfS_S_iiiiiiPfS_S_iiiiii, .-_Z43__device_stub__Z13gpuMatrixConvPfS_S_iiiiiiPfS_S_iiiiii
	.globl	_Z13gpuMatrixConvPfS_S_iiiiii
	.type	_Z13gpuMatrixConvPfS_S_iiiiii, @function
_Z13gpuMatrixConvPfS_S_iiiiii:
.LFB2066:
	.cfi_startproc
	endbr64
	jmp	_Z43__device_stub__Z13gpuMatrixConvPfS_S_iiiiiiPfS_S_iiiiii
	.cfi_endproc
.LFE2066:
	.size	_Z13gpuMatrixConvPfS_S_iiiiii, .-_Z13gpuMatrixConvPfS_S_iiiiii
	.section	.rodata.str1.1
.LC20:
	.string	"Introduce the colums of A:\n"
.LC21:
	.string	"Introduce the rows and colums of B:\n"
.LC22:
	.string	"You must introduce again the numbers, the matrix (rows and colums) A have to be higher than B\n"
.LC23:
	.string	"Error: %f %f\n"
	.text
	.globl	_Z16conv_preparationv
	.type	_Z16conv_preparationv, @function
_Z16conv_preparationv:
.LFB2036:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC5(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
.L124:
	movq	%rbp, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC7(%rip), %r12
.L125:
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	leaq	.LC8(%rip), %rbx
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	96(%rsp), %rsi
	movq	%rbx, %rdi
	call	__isoc23_scanf@PLT
	testl	%eax, %eax
	je	.L127
	leaq	.LC20(%rip), %r12
	jmp	.L126
.L176:
	incl	%eax
	je	.L155
.L127:
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L176
.L155:
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L125
.L177:
	incl	%eax
	je	.L156
.L130:
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L177
.L156:
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L126:
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	92(%rsp), %rsi
	movq	%rbx, %rdi
	call	__isoc23_scanf@PLT
	testl	%eax, %eax
	je	.L130
	leaq	.LC21(%rip), %r12
	jmp	.L129
.L178:
	cmpl	$10, %eax
	je	.L157
.L133:
	call	getchar@PLT
	cmpl	$-1, %eax
	jne	.L178
.L157:
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L129:
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	100(%rsp), %rsi
	movq	%rbx, %rdi
	call	__isoc23_scanf@PLT
	testl	%eax, %eax
	je	.L133
	movl	100(%rsp), %ebx
	movl	96(%rsp), %eax
	cmpl	%ebx, %eax
	jle	.L135
	movl	92(%rsp), %edx
	cmpl	%ebx, %edx
	jg	.L136
.L135:
	leaq	.LC22(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L124
.L136:
	movl	%eax, %r13d
	imull	%edx, %eax
	movl	%edx, %r12d
	subl	%ebx, %r13d
	subl	%ebx, %r12d
	leal	1(%r13), %ecx
	leal	1(%r12), %ebp
	movslq	%eax, %r14
	movl	%ecx, 36(%rsp)
	salq	$2, %r14
	movq	%r14, %rdi
	call	malloc@PLT
	movl	%ebx, %edi
	imull	%ebx, %edi
	movq	%rax, 8(%rsp)
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, 16(%rsp)
	movl	36(%rsp), %eax
	imull	%ebp, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	malloc@PLT
	movq	24(%rsp), %rdi
	movq	%rax, 40(%rsp)
	call	malloc@PLT
	leaq	104(%rsp), %rdi
	movq	%r14, %rsi
	movq	%rax, 48(%rsp)
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movl	100(%rsp), %esi
	leaq	112(%rsp), %rdi
	imull	%ebx, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	24(%rsp), %rsi
	leaq	120(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movl	92(%rsp), %edx
	movl	96(%rsp), %esi
	movq	8(%rsp), %rdi
	call	_Z10init_ArrayPfii
	movl	100(%rsp), %edx
	movq	16(%rsp), %rdi
	movl	%ebx, %esi
	call	_Z10init_ArrayPfii
	movl	96(%rsp), %edx
	imull	92(%rsp), %edx
	movl	$1, %ecx
	movq	8(%rsp), %rsi
	movq	104(%rsp), %rdi
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	100(%rsp), %edx
	movq	16(%rsp), %rsi
	movl	$1, %ecx
	movq	112(%rsp), %rdi
	imull	%ebx, %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	call	_Z9cpuSecondv
	movl	100(%rsp), %eax
	movl	92(%rsp), %r11d
	xorl	%ecx, %ecx
	movq	40(%rsp), %rdi
	movsd	%xmm0, 72(%rsp)
	xorl	%esi, %esi
	movl	%eax, 64(%rsp)
	movslq	%ebp, %rax
	salq	$2, %rax
	movq	%rax, 56(%rsp)
.L137:
	xorl	%eax, %eax
.L144:
	leal	(%rcx,%rax), %r10d
	xorl	%r9d, %r9d
	xorps	%xmm0, %xmm0
	xorl	%r8d, %r8d
.L142:
	cmpl	%ebx, %r8d
	jge	.L139
	movq	8(%rsp), %r15
	movslq	%r10d, %rdx
	movq	16(%rsp), %r14
	leaq	(%r15,%rdx,4), %r15
	movslq	%r9d, %rdx
	leaq	(%r14,%rdx,4), %r14
	xorl	%edx, %edx
.L140:
	cmpl	%edx, 64(%rsp)
	jle	.L179
	movss	(%r15,%rdx,4), %xmm1
	mulss	(%r14,%rdx,4), %xmm1
	incq	%rdx
	addss	%xmm1, %xmm0
	jmp	.L140
.L179:
	incl	%r8d
	addl	%r11d, %r10d
	addl	%ebx, %r9d
	jmp	.L142
.L139:
	movss	%xmm0, (%rdi,%rax,4)
	incq	%rax
	leal	-1(%rax), %edx
	cmpl	%edx, %r12d
	jg	.L144
	movq	56(%rsp), %rdx
	leal	1(%rsi), %eax
	addl	%r11d, %ecx
	addq	%rdx, %rdi
	cmpl	%esi, %r13d
	jle	.L143
	movl	%eax, %esi
	jmp	.L137
.L143:
	call	_Z9cpuSecondv
	leal	32(%r12), %eax
	subsd	72(%rsp), %xmm0
	movl	$1, 136(%rsp)
	movl	$1, 148(%rsp)
	sarl	$5, %eax
	movl	%eax, 128(%rsp)
	leal	32(%r13), %eax
	sarl	$5, %eax
	movsd	%xmm0, 64(%rsp)
	movl	%eax, 132(%rsp)
	movabsq	$137438953504, %rax
	movq	%rax, 140(%rsp)
	call	_Z9cpuSecondv
	movl	148(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	140(%rsp), %rdx
	movl	136(%rsp), %esi
	xorl	%r8d, %r8d
	movq	128(%rsp), %rdi
	movsd	%xmm0, 72(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L145
	pushq	%rax
	.cfi_def_cfa_offset 232
	movl	%ebx, %r9d
	pushq	%rbp
	.cfi_def_cfa_offset 240
	movl	52(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 248
	movl	124(%rsp), %eax
	pushq	%rax
	.cfi_def_cfa_offset 256
	movl	124(%rsp), %r8d
	movl	128(%rsp), %ecx
	movq	152(%rsp), %rdx
	movq	144(%rsp), %rsi
	movq	136(%rsp), %rdi
	call	_Z43__device_stub__Z13gpuMatrixConvPfS_S_iiiiiiPfS_S_iiiiii
	addq	$32, %rsp
	.cfi_def_cfa_offset 224
.L145:
	call	cudaDeviceSynchronize@PLT
	movq	24(%rsp), %rdx
	movq	120(%rsp), %rsi
	xorl	%r15d, %r15d
	movq	48(%rsp), %rdi
	movl	$2, %ecx
	call	cudaMemcpy@PLT
	call	_Z9cpuSecondv
	subsd	72(%rsp), %xmm0
	xorl	%ecx, %ecx
	movb	$1, %al
	movsd	%xmm0, 24(%rsp)
.L146:
	xorl	%r14d, %r14d
.L149:
	movq	48(%rsp), %rdx
	leaq	(%rdx,%rcx), %rsi
	movq	40(%rsp), %rdx
	movss	(%rsi,%r14,4), %xmm0
	leaq	(%rdx,%rcx), %rsi
	movss	(%rsi,%r14,4), %xmm1
	movaps	%xmm0, %xmm2
	subss	%xmm1, %xmm2
	andps	.LC12(%rip), %xmm2
	cvtss2sd	%xmm2, %xmm2
	comisd	.LC3(%rip), %xmm2
	jb	.L147
	movl	$2, %edi
	movb	$2, %al
	leaq	.LC23(%rip), %rsi
	movq	%rcx, 72(%rsp)
	cvtss2sd	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm1
	call	__printf_chk@PLT
	xorl	%eax, %eax
	movq	72(%rsp), %rcx
.L147:
	incq	%r14
	leal	-1(%r14), %esi
	cmpl	%esi, %r12d
	jg	.L149
	movq	56(%rsp), %rdi
	leal	1(%r15), %edx
	addq	%rdi, %rcx
	cmpl	%r13d, %r15d
	je	.L150
	movl	%edx, %r15d
	jmp	.L146
.L150:
	leaq	.LC18(%rip), %rsi
	testb	%al, %al
	jne	.L175
	leaq	.LC19(%rip), %rsi
.L175:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC13(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	91(%rsp), %rsi
	leaq	.LC15(%rip), %rdi
	call	__isoc23_scanf@PLT
	cmpb	$121, 91(%rsp)
	jne	.L153
	movl	92(%rsp), %edx
	movl	96(%rsp), %esi
	movq	8(%rsp), %rdi
	call	_Z12print_matrixPfii
	movl	100(%rsp), %edx
	movq	16(%rsp), %rdi
	movl	%ebx, %esi
	call	_Z12print_matrixPfii
	movl	36(%rsp), %esi
	movq	40(%rsp), %rdi
	movl	%ebp, %edx
	call	_Z12print_matrixPfii
	movq	48(%rsp), %rdi
	movl	36(%rsp), %esi
	movl	%ebp, %edx
	call	_Z12print_matrixPfii
	movq	stdout(%rip), %rdi
	call	fflush@PLT
.L153:
	movsd	64(%rsp), %xmm0
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	call	__printf_chk@PLT
	movsd	24(%rsp), %xmm0
	leaq	.LC17(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rdi
	call	cudaFreeHost@PLT
	movq	16(%rsp), %rdi
	call	cudaFreeHost@PLT
	movq	40(%rsp), %rdi
	call	cudaFreeHost@PLT
	movq	48(%rsp), %rdi
	call	cudaFreeHost@PLT
	movq	104(%rsp), %rdi
	call	cudaFree@PLT
	movq	112(%rsp), %rdi
	call	cudaFree@PLT
	movq	120(%rsp), %rdi
	call	cudaFree@PLT
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L154
	call	__stack_chk_fail@PLT
.L154:
	addq	$168, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2036:
	.size	_Z16conv_preparationv, .-_Z16conv_preparationv
	.globl	_Z41__device_stub__Z17gpuMatrixTranposePfS_iiPfS_ii
	.type	_Z41__device_stub__Z17gpuMatrixTranposePfS_iiPfS_ii, @function
_Z41__device_stub__Z17gpuMatrixTranposePfS_iiPfS_ii:
.LFB2067:
	.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
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 8(%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	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%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	.L180
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z17gpuMatrixTranposePfS_ii(%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
.L180:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L182
	call	__stack_chk_fail@PLT
.L182:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2067:
	.size	_Z41__device_stub__Z17gpuMatrixTranposePfS_iiPfS_ii, .-_Z41__device_stub__Z17gpuMatrixTranposePfS_iiPfS_ii
	.globl	_Z17gpuMatrixTranposePfS_ii
	.type	_Z17gpuMatrixTranposePfS_ii, @function
_Z17gpuMatrixTranposePfS_ii:
.LFB2068:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z17gpuMatrixTranposePfS_iiPfS_ii
	.cfi_endproc
.LFE2068:
	.size	_Z17gpuMatrixTranposePfS_ii, .-_Z17gpuMatrixTranposePfS_ii
	.section	.rodata.str1.1
.LC24:
	.string	"Error en: %f %f\n"
.LC25:
	.string	"Do you want to print the differents matrix:\n"
	.text
	.globl	_Z20tranpose_preparationv
	.type	_Z20tranpose_preparationv, @function
_Z20tranpose_preparationv:
.LFB2035:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$2, %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
	leaq	.LC7(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC5(%rip), %rbx
	movq	%rbx, %rsi
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L186:
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	leaq	.LC8(%rip), %rbp
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	movq	%rbp, %rdi
	call	__isoc23_scanf@PLT
	testl	%eax, %eax
	je	.L188
	leaq	.LC10(%rip), %r12
	jmp	.L187
.L222:
	incl	%eax
	je	.L208
.L188:
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L222
.L208:
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L186
.L223:
	cmpl	$10, %eax
	je	.L209
.L191:
	call	getchar@PLT
	cmpl	$-1, %eax
	jne	.L223
.L209:
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L187:
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	movq	%rbp, %rdi
	call	__isoc23_scanf@PLT
	testl	%eax, %eax
	je	.L191
	movl	28(%rsp), %ebx
	imull	24(%rsp), %ebx
	movslq	%ebx, %rbx
	salq	$2, %rbx
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, %r13
	call	malloc@PLT
	leaq	32(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%rax, %r12
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movl	28(%rsp), %esi
	imull	24(%rsp), %esi
	leaq	40(%rsp), %rdi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movl	24(%rsp), %edx
	movl	28(%rsp), %esi
	movq	%rbp, %rdi
	call	_Z10init_ArrayPfii
	movl	28(%rsp), %edx
	imull	24(%rsp), %edx
	movq	%rbp, %rsi
	movq	32(%rsp), %rdi
	movl	$1, %ecx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	call	_Z9cpuSecondv
	movslq	28(%rsp), %r8
	movq	%r13, %rcx
	xorl	%esi, %esi
	movl	24(%rsp), %r9d
	movsd	%xmm0, (%rsp)
	xorl	%edi, %edi
	movq	%r8, %r10
	salq	$2, %r8
.L193:
	cmpl	%edi, %r10d
	jle	.L195
	movslq	%esi, %rax
	movq	%rcx, %rdx
	leaq	0(%rbp,%rax,4), %r11
	xorl	%eax, %eax
.L196:
	cmpl	%eax, %r9d
	jle	.L224
	movss	(%r11,%rax,4), %xmm0
	incq	%rax
	movss	%xmm0, (%rdx)
	addq	%r8, %rdx
	jmp	.L196
.L224:
	incl	%edi
	addq	$4, %rcx
	addl	%r9d, %esi
	jmp	.L193
.L195:
	call	_Z9cpuSecondv
	movl	28(%rsp), %eax
	movl	$32, %esi
	subsd	(%rsp), %xmm0
	movl	$1, 56(%rsp)
	addl	$31, %eax
	movl	$1, 68(%rsp)
	cltd
	movsd	%xmm0, (%rsp)
	idivl	%esi
	movl	%eax, %ecx
	movl	24(%rsp), %eax
	movl	%ecx, 52(%rsp)
	addl	$31, %eax
	cltd
	idivl	%esi
	movl	%eax, 48(%rsp)
	movabsq	$137438953504, %rax
	movq	%rax, 60(%rsp)
	call	_Z9cpuSecondv
	movl	68(%rsp), %ecx
	movl	56(%rsp), %esi
	xorl	%r9d, %r9d
	movq	60(%rsp), %rdx
	movq	48(%rsp), %rdi
	xorl	%r8d, %r8d
	movsd	%xmm0, 8(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L197
	movl	24(%rsp), %ecx
	movl	28(%rsp), %edx
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	call	_Z41__device_stub__Z17gpuMatrixTranposePfS_iiPfS_ii
.L197:
	call	cudaDeviceSynchronize@PLT
	movl	28(%rsp), %edx
	movq	%r12, %rdi
	xorl	%r14d, %r14d
	imull	24(%rsp), %edx
	movq	40(%rsp), %rsi
	movl	$2, %ecx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	call	_Z9cpuSecondv
	subsd	8(%rsp), %xmm0
	movb	$1, %dl
	movq	%xmm0, %rbx
.L198:
	cmpl	%r14d, 28(%rsp)
	jle	.L225
	xorl	%r15d, %r15d
.L202:
	movl	24(%rsp), %eax
	cmpl	%r15d, %eax
	jle	.L226
	imull	%r14d, %eax
	addl	%r15d, %eax
	cltq
	movss	(%r12,%rax,4), %xmm0
	movss	0(%r13,%rax,4), %xmm1
	movaps	%xmm0, %xmm2
	subss	%xmm1, %xmm2
	andps	.LC12(%rip), %xmm2
	cvtss2sd	%xmm2, %xmm2
	comisd	.LC3(%rip), %xmm2
	jb	.L199
	movl	$2, %edi
	movb	$2, %al
	cvtss2sd	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm1
	leaq	.LC24(%rip), %rsi
	call	__printf_chk@PLT
	xorl	%edx, %edx
.L199:
	incl	%r15d
	jmp	.L202
.L226:
	incl	%r14d
	jmp	.L198
.L225:
	leaq	.LC18(%rip), %rsi
	testb	%dl, %dl
	jne	.L221
	leaq	.LC19(%rip), %rsi
.L221:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC25(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	23(%rsp), %rsi
	leaq	.LC15(%rip), %rdi
	call	__isoc23_scanf@PLT
	cmpb	$121, 23(%rsp)
	jne	.L205
	movl	24(%rsp), %edx
	movl	28(%rsp), %esi
	movq	%rbp, %rdi
	call	_Z12print_matrixPfii
	movl	28(%rsp), %edx
	movl	24(%rsp), %esi
	movq	%r13, %rdi
	call	_Z12print_matrixPfii
	movl	28(%rsp), %edx
	movl	24(%rsp), %esi
	movq	%r12, %rdi
	call	_Z12print_matrixPfii
	movq	stdout(%rip), %rdi
	call	fflush@PLT
.L205:
	movsd	(%rsp), %xmm0
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	call	__printf_chk@PLT
	movq	%rbx, %xmm0
	leaq	.LC17(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	%rbp, %rdi
	call	cudaFreeHost@PLT
	movq	%r13, %rdi
	call	cudaFreeHost@PLT
	movq	%r12, %rdi
	call	cudaFreeHost@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L206
	call	__stack_chk_fail@PLT
.L206:
	addq	$88, %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
.LFE2035:
	.size	_Z20tranpose_preparationv, .-_Z20tranpose_preparationv
	.globl	_Z41__device_stub__Z11gpuMVSparsePfS_PiS0_S_iPfS_PiS0_S_i
	.type	_Z41__device_stub__Z11gpuMVSparsePfS_PiS0_S_iPfS_PiS0_S_i, @function
_Z41__device_stub__Z11gpuMVSparsePfS_PiS0_S_iPfS_PiS0_S_i:
.LFB2069:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movl	%r9d, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L227
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z11gpuMVSparsePfS_PiS0_S_i(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L227:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L229
	call	__stack_chk_fail@PLT
.L229:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2069:
	.size	_Z41__device_stub__Z11gpuMVSparsePfS_PiS0_S_iPfS_PiS0_S_i, .-_Z41__device_stub__Z11gpuMVSparsePfS_PiS0_S_iPfS_PiS0_S_i
	.globl	_Z11gpuMVSparsePfS_PiS0_S_i
	.type	_Z11gpuMVSparsePfS_PiS0_S_i, @function
_Z11gpuMVSparsePfS_PiS0_S_i:
.LFB2070:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z11gpuMVSparsePfS_PiS0_S_iPfS_PiS0_S_i
	.cfi_endproc
.LFE2070:
	.size	_Z11gpuMVSparsePfS_PiS0_S_i, .-_Z11gpuMVSparsePfS_PiS0_S_i
	.globl	_Z18sparse_preparationv
	.type	_Z18sparse_preparationv, @function
_Z18sparse_preparationv:
.LFB2034:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$2, %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
	leaq	.LC7(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC5(%rip), %rbx
	movq	%rbx, %rsi
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L233:
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	leaq	.LC8(%rip), %rbp
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	52(%rsp), %rsi
	movq	%rbp, %rdi
	call	__isoc23_scanf@PLT
	testl	%eax, %eax
	je	.L235
	leaq	.LC10(%rip), %r12
	jmp	.L234
.L297:
	incl	%eax
	je	.L262
.L235:
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L297
.L262:
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L233
.L298:
	cmpl	$10, %eax
	je	.L263
.L238:
	call	getchar@PLT
	cmpl	$-1, %eax
	jne	.L298
.L263:
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L234:
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	movq	%rbp, %rdi
	call	__isoc23_scanf@PLT
	testl	%eax, %eax
	je	.L238
	movl	48(%rsp), %ebx
	movl	52(%rsp), %edi
	imull	%ebx, %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movslq	%ebx, %rdi
	salq	$2, %rdi
	movq	%rax, 16(%rsp)
	call	malloc@PLT
	movl	%ebx, %edx
	movl	$1, %esi
	movq	%rax, %rdi
	movq	%rax, %r15
	call	_Z10init_ArrayPfii
	movl	48(%rsp), %edx
	movl	52(%rsp), %esi
	movq	16(%rsp), %rdi
	call	_Z12init_0_ArrayPfii
	movl	48(%rsp), %r9d
	movl	52(%rsp), %r8d
	movq	16(%rsp), %rdi
	movl	%r9d, %edx
	movl	%r8d, %esi
	movl	%r9d, 44(%rsp)
	movl	%r8d, 24(%rsp)
	call	_Z9count_NumPfii
	movl	%eax, 40(%rsp)
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movl	24(%rsp), %r8d
	movq	%rax, %r12
	leal	1(%r8), %eax
	movl	%r8d, 32(%rsp)
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	%rax, %r13
	movq	24(%rsp), %rax
	leaq	-4(%rax), %r14
	movq	%r14, %rdi
	call	malloc@PLT
	movq	%r14, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movl	44(%rsp), %r9d
	movq	%r13, %rdx
	movq	%r12, %rcx
	movl	32(%rsp), %r8d
	movq	16(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%rax, %r14
	call	_Z13sparse_matrixPfPiS0_S_ii
	movq	24(%rsp), %rax
	movl	40(%rsp), %ecx
	leaq	56(%rsp), %rdi
	movl	%ecx, -4(%rbx,%rax)
	movq	%rax, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rsi
	leaq	64(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rsi
	leaq	72(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movslq	52(%rsp), %rsi
	leaq	80(%rsp), %rdi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movslq	48(%rsp), %rsi
	leaq	88(%rsp), %rdi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movslq	52(%rsp), %rdx
	movq	80(%rsp), %rdi
	xorl	%esi, %esi
	salq	$2, %rdx
	call	cudaMemset@PLT
	movl	52(%rsp), %eax
	movq	56(%rsp), %rdi
	movq	%rbx, %rsi
	movl	$1, %ecx
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdx
	movq	64(%rsp), %rdi
	movq	%r13, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdx
	movq	72(%rsp), %rdi
	movq	%r12, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movslq	48(%rsp), %rdx
	movq	88(%rsp), %rdi
	movq	%r15, %rsi
	movl	$1, %ecx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	call	_Z9cpuSecondv
	movl	52(%rsp), %ecx
	xorl	%eax, %eax
	movsd	%xmm0, 8(%rsp)
.L240:
	cmpl	%eax, %ecx
	jle	.L299
	movl	$0x00000000, 0(%rbp,%rax,4)
	incq	%rax
	jmp	.L240
.L299:
	xorl	%eax, %eax
.L242:
	cmpl	%eax, %ecx
	jle	.L300
	movl	4(%rbx,%rax,4), %esi
	movslq	(%rbx,%rax,4), %rdx
.L243:
	cmpl	%edx, %esi
	jle	.L301
	movslq	0(%r13,%rdx,4), %rdi
	movss	(%r15,%rdi,4), %xmm0
	mulss	(%r12,%rdx,4), %xmm0
	incq	%rdx
	addss	0(%rbp,%rax,4), %xmm0
	movss	%xmm0, 0(%rbp,%rax,4)
	jmp	.L243
.L301:
	incq	%rax
	jmp	.L242
.L300:
	call	_Z9cpuSecondv
	movl	48(%rsp), %eax
	subsd	8(%rsp), %xmm0
	addl	$32, %eax
	movl	%eax, 32(%rsp)
	movsd	%xmm0, 8(%rsp)
	call	_Z9cpuSecondv
	movl	32(%rsp), %eax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$134217729, %edx
	movl	$1, %ecx
	movl	$1, 116(%rsp)
	movl	%eax, 96(%rsp)
	salq	$5, %rdx
	movabsq	$4294967297, %rax
	movq	%rax, 100(%rsp)
	movq	96(%rsp), %rdi
	movl	104(%rsp), %esi
	movq	%rdx, 108(%rsp)
	movsd	%xmm0, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L246
	movl	52(%rsp), %r9d
	movq	80(%rsp), %r8
	movq	64(%rsp), %rcx
	movq	56(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	72(%rsp), %rdi
	call	_Z41__device_stub__Z11gpuMVSparsePfS_PiS0_S_iPfS_PiS0_S_i
.L246:
	call	cudaDeviceSynchronize@PLT
	movslq	52(%rsp), %rdx
	movq	80(%rsp), %rsi
	movq	%r14, %rdi
	movl	$2, %ecx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	call	_Z9cpuSecondv
	subsd	24(%rsp), %xmm0
	xorl	%edx, %edx
	movb	$1, %al
	movsd	%xmm0, 24(%rsp)
.L247:
	cmpl	%edx, 52(%rsp)
	jle	.L302
	movss	(%r14,%rdx,4), %xmm0
	movss	0(%rbp,%rdx,4), %xmm1
	movaps	%xmm0, %xmm2
	subss	%xmm1, %xmm2
	andps	.LC12(%rip), %xmm2
	cvtss2sd	%xmm2, %xmm2
	comisd	.LC3(%rip), %xmm2
	jb	.L248
	movl	$2, %edi
	movb	$2, %al
	leaq	.LC24(%rip), %rsi
	movq	%rdx, 32(%rsp)
	cvtss2sd	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm1
	call	__printf_chk@PLT
	xorl	%eax, %eax
	movq	32(%rsp), %rdx
.L248:
	incq	%rdx
	jmp	.L247
.L302:
	leaq	.LC18(%rip), %rsi
	testb	%al, %al
	jne	.L296
	leaq	.LC19(%rip), %rsi
.L296:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC13(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	108(%rsp), %rsi
	leaq	.LC15(%rip), %rdi
	call	__isoc23_scanf@PLT
	cmpb	$121, 108(%rsp)
	jne	.L253
	movl	48(%rsp), %edx
	movl	52(%rsp), %esi
	movq	16(%rsp), %rdi
	call	_Z12print_matrixPfii
	movl	40(%rsp), %edx
	movl	$1, %esi
	movq	%r12, %rdi
	call	_Z12print_matrixPfii
	movl	48(%rsp), %eax
	movl	$1, %esi
	movq	%rbx, %rdi
	leal	1(%rax), %edx
	call	_Z13print_imatrixPiii
	movl	40(%rsp), %edx
	movl	$1, %esi
	movq	%r13, %rdi
	call	_Z13print_imatrixPiii
	movl	52(%rsp), %esi
	movl	$1, %edx
	movq	%rbp, %rdi
	call	_Z12print_matrixPfii
	movl	52(%rsp), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	call	_Z12print_matrixPfii
	movq	stdout(%rip), %rdi
	call	fflush@PLT
.L253:
	movsd	8(%rsp), %xmm0
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	call	__printf_chk@PLT
	movsd	24(%rsp), %xmm0
	leaq	.LC17(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	call	__printf_chk@PLT
	cmpq	$0, 16(%rsp)
	je	.L254
	movq	16(%rsp), %rdi
	call	_ZdaPv@PLT
.L254:
	testq	%r15, %r15
	je	.L255
	movq	%r15, %rdi
	call	_ZdaPv@PLT
.L255:
	testq	%r13, %r13
	je	.L256
	movq	%r13, %rdi
	call	_ZdaPv@PLT
.L256:
	testq	%rbx, %rbx
	je	.L257
	movq	%rbx, %rdi
	call	_ZdaPv@PLT
.L257:
	testq	%rbp, %rbp
	je	.L258
	movq	%rbp, %rdi
	call	_ZdaPv@PLT
.L258:
	testq	%r14, %r14
	je	.L259
	movq	%r14, %rdi
	call	_ZdaPv@PLT
.L259:
	testq	%r12, %r12
	je	.L260
	movq	%r12, %rdi
	call	_ZdaPv@PLT
.L260:
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L261
	call	__stack_chk_fail@PLT
.L261:
	addq	$136, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2034:
	.size	_Z18sparse_preparationv, .-_Z18sparse_preparationv
	.section	.rodata.str1.1
.LC26:
	.string	"******************************************\n"
.LC27:
	.string	"* Select the operation you want to do:   *\n"
.LC28:
	.string	"*                                        *\n"
.LC29:
	.string	"* 1. Matrix Multiplication               *\n"
.LC30:
	.string	"* 2. Matrix Convection                   *\n"
.LC31:
	.string	"* 3. Matrix Transpose                    *\n"
.LC32:
	.string	"* 4. Matrix-Vector Sparse                *\n"
.LC33:
	.string	"* 5. Exit                                *\n"
.LC34:
	.string	"Introduce the number of the operation:\n"
.LC35:
	.string	"You don't introduce a valid option, please do it again.\n"
.LC36:
	.string	"Successful Exit\n"
.LC37:
	.string	"You dont select any option, please do it again\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2038:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC5(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
.L304:
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC26(%rip), %rbp
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	leaq	.LC28(%rip), %r12
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC27(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC29(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC30(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC31(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC32(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC33(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	leaq	.LC34(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	leaq	.LC8(%rip), %rdi
	call	__isoc23_scanf@PLT
	testl	%eax, %eax
	jne	.L305
.L306:
	call	getchar@PLT
	cmpl	$-1, %eax
	je	.L317
	cmpl	$10, %eax
	jne	.L306
.L317:
	leaq	.LC35(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L304
.L305:
	movl	4(%rsp), %eax
	decl	%eax
	cmpl	$4, %eax
	ja	.L309
	leaq	.L311(%rip), %rdx
	movslq	(%rdx,%rax,4), %rax
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L311:
	.long	.L315-.L311
	.long	.L314-.L311
	.long	.L313-.L311
	.long	.L312-.L311
	.long	.L310-.L311
	.section	.text.startup
.L315:
	call	_Z18matrix_preparationv
	jmp	.L324
.L314:
	call	_Z16conv_preparationv
	jmp	.L324
.L313:
	call	_Z20tranpose_preparationv
	jmp	.L324
.L312:
	call	_Z18sparse_preparationv
	jmp	.L324
.L310:
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC36(%rip), %rsi
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L316
	call	__stack_chk_fail@PLT
.L309:
	leaq	.LC37(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L324:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	jmp	.L304
.L316:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2038:
	.size	main, .-main
	.section	.rodata.str1.1
.LC38:
	.string	"_Z11gpuMVSparsePfS_PiS0_S_i"
.LC39:
	.string	"_Z17gpuMatrixTranposePfS_ii"
.LC40:
	.string	"_Z13gpuMatrixConvPfS_S_iiiiii"
.LC41:
	.string	"_Z7mmatrixPfS_S_iii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2072:
	.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	.LC38(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z11gpuMVSparsePfS_PiS0_S_i(%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	.LC39(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z17gpuMatrixTranposePfS_ii(%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	.LC40(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z13gpuMatrixConvPfS_S_iiiiii(%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	.LC41(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z7mmatrixPfS_S_iii(%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
.LFE2072:
	.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.cst4,"aM",@progbits,4
	.align 4
.LC1:
	.long	805306368
	.align 4
.LC2:
	.long	1048576000
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	-1598689907
	.long	1051772663
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC12:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.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 <stdlib.h>
#include <math.h>
#include <sys/time.h>

#define error 1e-6
#define BLOCK_SIZE 32

///////////////////////////////////////// UTILITIES ////////////////////////////////////////////////////////////////////////////////////////////
/*
**********************************************************************
function name: init_Array
description: create a matrix with random values
parameters:
            &x pointer to a row x col Matrix
return: None
**********************************************************************
*/

void init_Array(float *x, int m, int n){
    for(int i = 0; i < m; i++){
        for(int j = 0; j < n; j++){
            x[i * n + j] = rand() % 1000;
        }
    } 
}

/*
**********************************************************************
function name: init_0_Array
description: create a matrix that cointains a high number of zero values, but every row have at least one non-zero values
parameters:
            &x pointer to a row x col Matrix
return: None
**********************************************************************
*/

void init_0_Array(float *x, int row, int col){
    bool ultimo =  false;

    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){

            if(j ==  col - 1 && !ultimo){
                ultimo = true;
            }
            float r = (float) rand() / RAND_MAX;
            if(r <= 0.25){

                x[i*col + j] = rand() % 1000;
                ultimo = false;

            } else{

                if (!ultimo){

                    x[i*col + j] = 0;

                } else {

                    x[i*col + j] = rand() % 1000;
                    ultimo = false;

                }
            }
        }
    }

}

/*
**********************************************************************
function name: count_NUM
description: count the non-zero elements of a matrix
parameters:
            &x pointer to a row x col Matrix
return: the total number of non-zero elements
**********************************************************************
*/

int count_Num(float *x, int row, int col){

    int count = 0;

    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){
            if(x[i*col + j] != 0){
                count++;
            }
        }
    }

    return count;
}

/*
**********************************************************************
function name: sparse_matrix
description: convert a matric in a sparse matrix format in CSR
parameters:
            &x pointer to a row x col matrix
            &rows pointer to a rows + 1 vector: points to the first element in each row and assigns it the value of its index in value
            &cols pointer to a size vector: the column to which each non-zero value belongs 
            &val pointer to a size vector: contains every non-zero value of the x matrix
return: None
**********************************************************************
*/

void sparse_matrix(float *x, int *rows, int *cols, float *val, int row, int col){

    int antes = -1;
    int count = 0;
    int count_row = 0;
    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){
            if(x[i*col + j] != 0){

                if(i != antes){
                    rows[count_row] = count;
                    antes = i;
                    count_row++;
                }
                cols[count] = j;
                val[count] = x[i*col + j];
                count++;
            }
        }
    }
}

/*
**********************************************************************
function name: cpuSecond()
description: when it is called you obtain the exact time in this moment
return: the time in microseonds
**********************************************************************
*/

double cpuSecond() {
    struct timeval tp;
    gettimeofday(&tp,NULL);
    return ((double)tp.tv_sec + (double)tp.tv_usec*1.e-6);
}

/*
**********************************************************************
function name: print_matrix
description: print a matrix compose by (float) elements
parameters:
            &a pointer to a row x col Matrix
return: None
**********************************************************************
*/

void print_matrix(float *a, int row, int col){

    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){
            printf("%f ",a[i * col + j]);
        }
        printf("\n");
    }
    printf("\n");
}

/*
**********************************************************************
function name: print_imatrix
description: print a matrix compose by (int) elements
parameters:
            &a pointer to a row x col Matrix
return: None
**********************************************************************
*/

void print_imatrix(int *a, int row, int col){

    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){
            printf("%d ",a[i * col + j]);
        }
        printf("\n");
    }
    printf("\n");
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////









//////////////////////////////////////// GPU KERNEL METHODS //////////////////////////////////////////////////////////////////
/*
*********************************************************************
function name: mmatrix
description: dot product of two matrix (not only square) in GPU
parameters: 
            &a GPU device pointer to a m X n matrix (A)
            &b GPU device pointer to a n X k matrix (B)
            &c GPU device output purpose pointer to a m X k matrix (C) 
            to store the result
Note:
    grid and block should be configured as:
        dim3 dimGrid((k + BLOCK_SIZE - 1) / BLOCK_SIZE,(m + BLOCK_SIZE - 1) / BLOCK_SIZE;
        dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);
    further sppedup can be obtained by using shared memory to decrease global memory access times
return: none
*********************************************************************
*/

__global__ void mmatrix(float *a, float *b, float *c, int m, int n, int k){

    unsigned int row = blockIdx.y * blockDim.y + threadIdx.y;
    unsigned int col = blockIdx.x * blockDim.x + threadIdx.x;
    float sum = 0.0;


    if(col < k && row < m){

        for(int i = 0; i < n; i++){
            sum += a[row * n + i] * b[i * k + col];
        }

        c[row * k + col] = sum;
    }
}

/*
*********************************************************************
function name: gpuMatrixConv
description: implementation of the convultion  operation
parameters: 
            &a GPU device pointer to a row1 X col1 matrix (A)
            &b GPU device pointer to a row2 X col2 matrix (B)
            &c GPU device output purpose pointer to a row3 X col3 matrix (C) 
            to store the result
Note:
    grid and block should be configured as:
        dim3 dimGrid((col3 + BLOCK_SIZE - 1) / BLOCK_SIZE,(row3 + BLOCK_SIZE - 1) / BLOCK_SIZE;
        dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);
    further sppedup can be obtained by using shared memory to decrease global memory access times
return: none
*********************************************************************
*/

__global__ void gpuMatrixConv(float *a, float *b, float *c, int row1, int col1, int row2, int col2, int row3, int col3)
{
	unsigned int row = blockIdx.y * blockDim.y + threadIdx.y;
	unsigned int col = blockIdx.x * blockDim.x + threadIdx.x;
    float sum = 0.0;

	if (row < row3 && col < col3) {
		for (int i = 0; i < row2; i++) {
			for (int j = 0; j < col2; j++) {
                sum += a[(row + i) * col1 + col + j] * b[i * row2 + j];
                
            }
        }
		c[row * col3 + col] = sum;
	}
}

/*
*********************************************************************
function name: gpu_matrix_transpose
description: matrix transpose
parameters: 
            &mat_in GPU device pointer to a rows X cols matrix
            &mat_out GPU device output purpose pointer to a cols X rows matrix 
            to store the result
Note:
    grid and block should be configured as:
        dim3 dim_grid((col + BLOCK_SIZE - 1) / BLOCK_SIZE, (row + BLOCK_SIZE - 1) / BLOCK_SIZE, 1);
        dim3 dim_block(BLOCK_SIZE, BLOCK_SIZE, 1);

return: none
*********************************************************************
*/

__global__ void gpuMatrixTranpose(float *a, float *b, int rows, int cols){

    unsigned int row = blockIdx.y * blockDim.y + threadIdx.y;
    unsigned int col = blockIdx.x * blockDim.x + threadIdx.x;

    if(row < rows && col < cols){

        int pos_a = row * cols + col;
        int pos_b = col * rows + row;
        b[pos_b] = a[pos_a];
        
    }
}

/*
*********************************************************************
function name: gpuMatrixConv
description: implementation the matrix * vector in sparse format CSR
parameters: 
            &values GPU device pointer to a size vector (values): the non-zero values for the original matrix
            &vector GPU device pointer to a col vector (x): to multiply the non-zero values
            &rows GPU device pointer to a rows + 1 vector (row): points to the first element in each row and assigns it the value of its index in value
            &cols GPU device pointer to a col size vector (col): the column to which each non-zero value belongs 
            &res GPU device output purpose pointer to a row vector (C) 
            to store the result
Note:
    grid and block should be configured as:
        dim3 dimGrid((col3 + BLOCK_SIZE - 1) / BLOCK_SIZE,(row3 + BLOCK_SIZE - 1) / BLOCK_SIZE;
        dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);
    further sppedup can be obtained by using shared memory to decrease global memory access times
return: none
*********************************************************************
*/
__global__ void gpuMVSparse(float *values, float *vector, int *rows, int *cols,float *res, int row){

    unsigned int Id = threadIdx.x + blockDim.x * blockIdx.x;

    if(Id < row){
        for(int k = rows[Id]; k < rows[Id+1]; k++){
            res[Id] += values[k]*vector[cols[k]];
        }
    }
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////










//////////////////////////////////////////////////// CPU METHODS AND GPU PREPARATION ///////////////////////////////////////////////////////////

/*
**********************************************************************
function name: sparse_preparation
description:    compare the CPU and GPU implementation of a matrix * vector multiplication in sparse format
                1º obtaint the size of the matrix 
                2º create the matrix 
                3º count the non-zero values
                4º tranfor into CSR format
                5º Do the operation
                6º compare the results
                Optional: print the results           
return: None
**********************************************************************
*/

void sparse_preparation(){

    int col, row, val;
    bool bien = true;

    printf("\n");
    printf("\n");
    SP1: printf("Introduce the rows of A:\n");
    fflush(stdout);
    val = scanf("%d", &row);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto SP1;
    }
    SP2: printf("Introduce the columns of A:\n");
    fflush(stdout);
    val = scanf("%d", &col);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto SP2;
    }


    double start_GPU, stop_GPU;
    double start_CPU, stop_CPU;
    double diferencia_CPU, diferencia_GPU;

    float *A = (float *)malloc(row * col * sizeof(float));
    float *vector = (float *)malloc(col * sizeof(float));

    init_Array(vector, 1, col);
    init_0_Array(A, row, col);
    int size = count_Num(A, row, col);

    float *values = (float *)malloc(size * sizeof(float));
    int *rows = (int *)malloc((row + 1) * sizeof(int));
    int *cols = (int *)malloc(size * sizeof(int));

    float *res = (float *)malloc(row * sizeof(float));
    float *res_F = (float *)malloc(row * sizeof(float));

    sparse_matrix(A, rows, cols, values, row, col);
    rows[row] = size;

    int *rows_GPU;
    int *cols_GPU;
    float *values_GPU;
    float *res_GPU;
    float *vector_GPU;

    hipMalloc(&rows_GPU, (row + 1) * sizeof(int));
    hipMalloc(&cols_GPU, size * sizeof(int));
    hipMalloc(&values_GPU, size * sizeof(float));
    hipMalloc(&res_GPU, row * sizeof(float));
    hipMalloc(&vector_GPU, col * sizeof(float));
    hipMemset(res_GPU, 0, row * sizeof(float));

    hipMemcpy(rows_GPU, rows, (row +1) * sizeof(int), hipMemcpyHostToDevice);
    hipMemcpy(cols_GPU, cols, size * sizeof(int), hipMemcpyHostToDevice);
    hipMemcpy(values_GPU, values, size * sizeof(float), hipMemcpyHostToDevice);
    hipMemcpy(vector_GPU, vector, col * sizeof(float), hipMemcpyHostToDevice);
    //Start CPU Part//

    start_CPU = cpuSecond();


    for(int k = 0; k < row; k++){
        res[k] = 0;
    }
    for(int i = 0; i < row; i++){
        for(int k = rows[i]; k < rows[i + 1]; k++){

            res[i] += values[k]*vector[cols[k]];
        }
    }

    stop_CPU = cpuSecond();
    diferencia_CPU = stop_CPU - start_CPU;
    

    //Stop Cpu Part // 

    unsigned int GRID = col + BLOCK_SIZE - 1 / BLOCK_SIZE;

    
    //Init GPU part//

    start_GPU = cpuSecond();

    gpuMVSparse<<<GRID, BLOCK_SIZE>>>(values_GPU, vector_GPU, rows_GPU, cols_GPU, res_GPU, row);

    hipDeviceSynchronize();
    hipMemcpy(res_F, res_GPU, row * sizeof(float), hipMemcpyDeviceToHost);

    stop_GPU = cpuSecond();

    diferencia_GPU = stop_GPU - start_GPU;

    //Stop GPU part//

    //Start Checking //
    
    for(int j = 0; j < row; j++){
        if(fabs(res_F[j] - res[j]) >= error ){
            bien = false;
            printf("Error en: %f %f\n", res_F[j], res[j]);
        }
    }


    if(bien){
        printf("Comparing the output for each implementation.. Correct!\n");
    }else {
        printf("Comparing the output for each implementation.. Incorrect!\n");
    }

    char d;
    printf("Do you want to print the matrix:\n");
    printf("YES: y  or NO: n\n");
    fflush(stdout);
    scanf(" %c", &d);
    if(d == 'y'){
        print_matrix(A,row,col);
        print_matrix(values, 1, size);
        print_imatrix(rows, 1, (col + 1));
        print_imatrix(cols, 1 ,size);
        print_matrix(res,row,1);
        print_matrix(res_F,row,1);
        fflush(stdout);
    }

    printf("Duration of the CPU: %f\n", diferencia_CPU);
    printf("Duration of the GPU: %f\n", diferencia_GPU);

    delete[] A;
    delete[] vector;
    delete[] cols;
    delete[] rows;
    delete[] res;
    delete[] res_F;
    delete[] values;
    hipFree(values_GPU);
    hipFree(cols_GPU);
    hipFree(rows_GPU);
    hipFree(res_GPU);
    hipFree(vector_GPU);
    
}

/*
**********************************************************************
function name: transpose_preparation
description:    compare the CPU and GPU implementation of the transpose operation
                1º obtaint the size of the matrix 
                2º create the matrix 
                3º Do the operation
                4º compare the results
                Optional: print the results           
return: None
**********************************************************************
*/

void tranpose_preparation(){

    int col, row, val;
    bool bien = true;

    printf("\n");
    printf("\n");
    TR1: printf("Introduce the rows of A:\n");
    fflush(stdout);
    val = scanf("%d", &row);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto TR1;
    }
    TR2: printf("Introduce the columns of A:\n");
    fflush(stdout);
    val = scanf("%d", &col);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto TR2;
    }


    double start_GPU, stop_GPU;
    double start_CPU, stop_CPU;
    double diferencia_CPU, diferencia_GPU;

    float *A = (float *)malloc(row * col * sizeof(float));
    float *res = (float *)malloc(row * col * sizeof(float));
    float *res_F = (float *)malloc(row * col * sizeof(float));



    float *A_GPU;
    float *res_GPU;

    hipMalloc(&A_GPU, row * col * sizeof(float));
    hipMalloc(&res_GPU, row  * col * sizeof(float));

    init_Array(A, row, col);

    hipMemcpy(A_GPU, A, row * col * sizeof(float), hipMemcpyHostToDevice);

    //Start CPU Part//

    start_CPU = cpuSecond();

    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){

            int pos_a = i * col + j;
            int pos_res = j * row + i;

            res[pos_res] = A[pos_a]; 
        }
    }


    stop_CPU = cpuSecond();
    diferencia_CPU = stop_CPU - start_CPU;
    //Stop Cpu Part // 

    unsigned int grid_rows = (row + BLOCK_SIZE - 1) / BLOCK_SIZE;
    unsigned int grid_colm = (col + BLOCK_SIZE - 1) / BLOCK_SIZE;

    dim3 dimGrid(grid_colm, grid_rows);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);

    
    //Init GPU part//

    start_GPU = cpuSecond();

    gpuMatrixTranpose<<<dimGrid, dimBlock>>>(A_GPU, res_GPU, row, col);

    hipDeviceSynchronize();
    hipMemcpy(res_F, res_GPU, row * col * sizeof(float), hipMemcpyDeviceToHost);

    stop_GPU = cpuSecond();

    diferencia_GPU = stop_GPU - start_GPU;

    //Stop GPU part//

    //Start Checking //

    for(int i = 0; i < row; i++){
        for(int j = 0; j < col; j++){
            if(fabs(res_F[i * col + j] - res[i*col + j]) >= error ){
                bien = false;
                printf("Error en: %f %f\n", res_F[i * col + j], res[i * col + j]);
            }
        }
    }

    if(bien){
        printf("Comparing the output for each implementation.. Correct!\n");
    }else {
        printf("Comparing the output for each implementation.. Incorrect!\n");
    }

    char d;
    printf("Do you want to print the differents matrix:\n");
    printf("YES: y  or NO: n\n");
    fflush(stdout);
    scanf(" %c", &d);
    if(d == 'y'){
        print_matrix(A,row,col);
        print_matrix(res,col,row);
        print_matrix(res_F,col,row);
        fflush(stdout);
    }

    printf("Duration of the CPU: %f\n", diferencia_CPU);
    printf("Duration of the GPU: %f\n", diferencia_GPU);

    hipHostFree(A);
    hipHostFree(res);
    hipHostFree(res_F);
    hipFree(A_GPU);
    hipFree(res_GPU);

}

/*
**********************************************************************
function name: conv_preparation
description:    compare the CPU and GPU implementation of the convultion operation
                1º obtaint the size of the matrix A and the square matrix B
                2º create the matrix A and B with random values 
                3º Do the operation
                4º compare the results
                Optional: print the results           
return: None
**********************************************************************
*/

void conv_preparation(){

    int col1, row1, col2, row2, col3, row3, val;
    bool bien = true;

    INTRO: printf("\n");
    printf("\n");
    CO1: printf("Introduce the rows of A:\n");
    fflush(stdout);
    val = scanf("%d", &row1);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto CO1;
    }
    CO2: printf("Introduce the colums of A:\n");
    fflush(stdout);
    val = scanf("%d", &col1);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto CO2;
    }
    CO3: printf("Introduce the rows and colums of B:\n");
    fflush(stdout);
    val = scanf("%d", &col2);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto CO3;
    }
    row2 = col2;

    if(row2 >= row1 || col2 >= col1 ) {
        printf("You must introduce again the numbers, the matrix (rows and colums) A have to be higher than B\n");
        goto INTRO;
    }

    col3 = col1 - col2 + 1;
    row3 = row1 - row2 + 1;

    double start_GPU, stop_GPU;
    double start_CPU, stop_CPU;
    double diferencia_CPU, diferencia_GPU;

    float *A = (float *)malloc(row1 * col1 * sizeof(float));
    float *B = (float *)malloc(row2 * col2 * sizeof(float));
    float *res = (float *)malloc(row3 * col3 * sizeof(float));
    float *res_F = (float *)malloc(row3 * col3 * sizeof(float));



    float *A_GPU;
    float *B_GPU;
    float *res_GPU;

    hipMalloc(&A_GPU, row1 * col1 * sizeof(float));
    hipMalloc(&B_GPU, row2 * col2 * sizeof(float));
    hipMalloc(&res_GPU, row3  * col3 * sizeof(float));

    init_Array(A, row1, col1);
    init_Array(B, row2, col2);

    hipMemcpy(A_GPU, A, row1 * col1 * sizeof(float), hipMemcpyHostToDevice);
    hipMemcpy(B_GPU, B, row2 * col2 * sizeof(float), hipMemcpyHostToDevice);

    //Start CPU Part//

    start_CPU = cpuSecond();

    int i, j ,k, z;
    float sum = 0.0;

    for(i = 0; i < row3; i++){
        for(z = 0; z < col3; z++){

            sum = 0.0;

            for(j = 0; j < row2; j++){
                for(k = 0; k < col2; k++){

                    sum += A[(i + j) * col1 + z + k] * B[j * row2 + k];
                
                }
            }
            res[i * col3 + z] = sum;
        }
    }


    stop_CPU = cpuSecond();
    diferencia_CPU = stop_CPU - start_CPU;
    //Stop Cpu Part // 

    unsigned int grid_rows = (row3 + BLOCK_SIZE - 1) / BLOCK_SIZE;
    unsigned int grid_colm = (col3 + BLOCK_SIZE - 1) / BLOCK_SIZE;

    dim3 dimGrid(grid_colm, grid_rows);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);

    
    //Init GPU part//

    start_GPU = cpuSecond();

    gpuMatrixConv<<<dimGrid, dimBlock>>>(A_GPU, B_GPU, res_GPU, row1, col1, row2, col2, row3, col3);

    hipDeviceSynchronize();
    hipMemcpy(res_F, res_GPU, row3 * col3 * sizeof(float), hipMemcpyDeviceToHost);

    stop_GPU = cpuSecond();

    diferencia_GPU = stop_GPU - start_GPU;

    //Stop GPU part//

    //Start Checking //

    for(int i = 0; i < row3; i++){
        for(int j = 0; j < col3; j++){
            if(fabs(res_F[i * col3 + j] - res[i*col3 + j]) >= error ){
                bien = false;
                printf("Error: %f %f\n", res_F[i * col3 + j], res[i * col3 + j]);
            }
        }
    }

    if(bien){
        printf("Comparing the output for each implementation.. Correct!\n");
    }else {
        printf("Comparing the output for each implementation.. Incorrect!\n");
    }

    char d;
    printf("Do you want to print the matrix:\n");
    printf("YES: y  or NO: n\n");
    fflush(stdout);
    scanf(" %c", &d);

    if(d == 'y'){
        print_matrix(A,row1,col1);
        print_matrix(B,row2, col2);
        print_matrix(res,row3,col3);
        print_matrix(res_F,row3,col3);
        fflush(stdout);
    }

    printf("Duration of the CPU: %f\n", diferencia_CPU);
    printf("Duration of the GPU: %f\n", diferencia_GPU);

    hipHostFree(A);
    hipHostFree(B);
    hipHostFree(res);
    hipHostFree(res_F);
    hipFree(A_GPU);
    hipFree(B_GPU);
    hipFree(res_GPU);

}

/*
**********************************************************************
function name: matrix_preparation
description:    compare the CPU and GPU implementation of the matrix multiplication
                1º obtaint the size of the matrix A and the  matrix B
                2º create the matrix A and B with random values 
                3º Do the operation
                4º compare the results
                Optional: print the results           
return: None
**********************************************************************
*/

void matrix_preparation(){

    int m, n, k, val;

    printf("\n");
    printf("\n");
    MA1: printf("Introduce the rows of A:\n");
    fflush(stdout);
    val = scanf("%d", &m);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto MA1;
    }

    MA2: printf("Introduce the columns of A:\n");
    fflush(stdout);
    val = scanf("%d", &n);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto MA2;
    }
    MA3: printf("Introduce The columns of B:\n");
    fflush(stdout);
    val = scanf("%d", &k);
    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid number, please do it again.\n");
        printf("\n");
        goto MA3;
    }

    bool bien = true;


    double start_GPU, stop_GPU;
    double start_CPU, stop_CPU;
    double diferencia_CPU, diferencia_GPU;

    float *A = (float *)malloc(m * n * sizeof(float));
    float *B = (float *)malloc(n * k * sizeof(float));
    float *res = (float *)malloc(m * k * sizeof(float));
    float *res_F = (float *)malloc(m * k * sizeof(float));

    float *A_GPU;
    float *B_GPU;
    float *res_GPU;

    hipMalloc(&A_GPU, m * n * sizeof(float));
    hipMalloc(&B_GPU, n * k * sizeof(float));
    hipMalloc(&res_GPU, m  * k * sizeof(float));
    init_Array(A, m, n);
    init_Array(B, n, k);
    hipMemcpy(A_GPU, A, m * n * sizeof(float), hipMemcpyHostToDevice);
    hipMemcpy(B_GPU, B, n * k * sizeof(float), hipMemcpyHostToDevice);

    unsigned int grid_rows = (m + BLOCK_SIZE - 1) / BLOCK_SIZE;
    unsigned int grid_colm = (k + BLOCK_SIZE - 1) / BLOCK_SIZE;
    dim3 dimGrid(grid_colm, grid_rows);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);

    //init CPU part//

    start_CPU = cpuSecond();

    for(int i = 0; i < m; i++){
        for(int j = 0; j < k; j++){
            float cont = 0.0;
            for(int z = 0; z < n; z++){
                cont += A[i * n + z] * B[z * k + j];
            }
            res[i * k + j] = cont;
        }
    }

    stop_CPU = cpuSecond();
    diferencia_CPU = stop_CPU - start_CPU;

    //init GPU Part//

    start_GPU = cpuSecond();

    mmatrix<<<dimGrid, dimBlock>>>(A_GPU, B_GPU, res_GPU, m, n, k);

    hipDeviceSynchronize();
    hipMemcpy(res_F, res_GPU, m * k * sizeof(float), hipMemcpyDeviceToHost);
    
    stop_GPU = cpuSecond();
    diferencia_GPU = stop_GPU - start_GPU;


    //check if it is correct//
    for(int i = 0; i < m; i++){
        for(int j = 0; j < k; j++){
            if(fabs(res_F[i * k + j] - res[i*k + j]) >= error ){
                bien = false;
                break;
            }
        }
        if(!bien){break;}
    }

    if(bien){
        printf("Comparing the output for each implementation.. Correct!\n");
    }else {
        printf("Comparing the output for each implementation.. Incorrect!\n");
    }


    char d;
    printf("Do you want to print the matrix:\n");
    printf("YES: y  or NO: n\n");
    fflush(stdout);
    scanf(" %c", &d);

    if(d == 'y'){
        print_matrix(A,m,n);
        print_matrix(B,n, k);
        print_matrix(res,m,k);
        print_matrix(res_F,m,k);
        fflush(stdout);
    }

    printf("Duration of the CPU: %f\n", diferencia_CPU);
    printf("Duration of the GPU: %f\n", diferencia_GPU);

    hipHostFree(A);
    hipHostFree(B);
    hipHostFree(res);
    hipHostFree(res_F);
    hipFree(A_GPU);
    hipFree(B_GPU);
    hipFree(res_GPU);

}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////











///////////////////////////////////////////////////////////// MAIN //////////////////////////////////////////////////////////////////////////////
int main( int argc, char *argv[]){
    
    int op, val;
    bool salir = false;

 
    START: printf("\n");
    printf("\n");
    printf("******************************************\n");
    printf("* Select the operation you want to do:   *\n");
    printf("*                                        *\n");
    printf("* 1. Matrix Multiplication               *\n");
    printf("* 2. Matrix Convection                   *\n");
    printf("* 3. Matrix Transpose                    *\n");
    printf("* 4. Matrix-Vector Sparse                *\n");
    printf("* 5. Exit                                *\n");
    printf("*                                        *\n");
    printf("******************************************\n");
    fflush(stdout);
    printf("Introduce the number of the operation:\n");
    fflush(stdout);
    val = scanf("%d", &op);

    if(val == 0) {

        while ( (val = getchar()) != EOF && val != '\n' );
        printf("You don't introduce a valid option, please do it again.\n");
        goto START;

    }else{
        switch(op){
            case 1:

                matrix_preparation();
                fflush(stdout);
                break;

            case 2:
            
                conv_preparation();
                fflush(stdout);
                break;

            case 3:

                tranpose_preparation();
                fflush(stdout);
                break;
            
            case 4:

                sparse_preparation();
                fflush(stdout);
                break;

            case 5:

                salir = true;
                printf("Successful Exit\n");
                fflush(stdout);
                break;

            default:
                printf("You dont select any option, please do it again\n");
                fflush(stdout);
                break;
        }
        if(!salir){goto START;}
    }
    return 0;
}
	.text
	.file	"projecte1.hip"
	.globl	_Z10init_ArrayPfii              # -- Begin function _Z10init_ArrayPfii
	.type	_Z10init_ArrayPfii,@function
_Z10init_ArrayPfii:                     # @_Z10init_ArrayPfii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB0_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %ebx
	movl	%esi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%edx, %r12d
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
.LBB0_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB0_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%r15d, %r15d
.LBB0_4:                                #   Parent Loop BB0_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	cltq
	imulq	$274877907, %rax, %rcx          # imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	imull	$1000, %ecx, %ecx               # imm = 0x3E8
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, (%r14,%r15,4)
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB0_4
.LBB0_5:                                # %._crit_edge
                                        #   in Loop: Header=BB0_2 Depth=1
	incq	%rbp
	addl	%ebx, %r13d
	cmpq	16(%rsp), %rbp                  # 8-byte Folded Reload
	jne	.LBB0_2
.LBB0_6:                                # %._crit_edge13
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z10init_ArrayPfii, .Lfunc_end0-_Z10init_ArrayPfii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z12init_0_ArrayPfii
.LCPI1_0:
	.long	0x30000000                      # float 4.65661287E-10
.LCPI1_1:
	.long	0x3e800000                      # float 0.25
	.text
	.globl	_Z12init_0_ArrayPfii
	.type	_Z12init_0_ArrayPfii,@function
_Z12init_0_ArrayPfii:                   # @_Z12init_0_ArrayPfii
	.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
                                        # kill: def $edx killed $edx def $rdx
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB1_9
# %bb.1:                                # %.preheader.lr.ph
	leal	-1(%rdx), %r15d
	movl	%esi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%edx, %r13d
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	movq	%rdx, 24(%rsp)                  # 8-byte Spill
.LBB1_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_4 Depth 2
	testl	%edx, %edx
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	jle	.LBB1_8
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB1_2 Depth=1
	movl	%eax, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%ebp, %ebp
.LBB1_4:                                #   Parent Loop BB1_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI1_0(%rip), %xmm0
	movss	.LCPI1_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	jae	.LBB1_6
# %bb.5:                                #   in Loop: Header=BB1_4 Depth=2
	testb	$1, %bl
	movzbl	%bl, %eax
	movl	%eax, %ebx
	movl	$1, %ecx
	cmovel	%ecx, %ebx
	cmpq	%rbp, %r15
	cmovnel	%eax, %ebx
	xorps	%xmm0, %xmm0
	testb	$1, %bl
	je	.LBB1_7
.LBB1_6:                                # %.sink.split
                                        #   in Loop: Header=BB1_4 Depth=2
	callq	rand
	cltq
	imulq	$274877907, %rax, %rcx          # imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	imull	$1000, %ecx, %ecx               # imm = 0x3E8
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	xorl	%ebx, %ebx
.LBB1_7:                                #   in Loop: Header=BB1_4 Depth=2
	movss	%xmm0, (%r14,%rbp,4)
	incq	%rbp
	cmpq	%rbp, %r13
	jne	.LBB1_4
.LBB1_8:                                # %._crit_edge
                                        #   in Loop: Header=BB1_2 Depth=1
	incq	%r12
	movq	24(%rsp), %rdx                  # 8-byte Reload
	movq	32(%rsp), %rax                  # 8-byte Reload
	addl	%edx, %eax
	cmpq	16(%rsp), %r12                  # 8-byte Folded Reload
	jne	.LBB1_2
.LBB1_9:                                # %._crit_edge30
	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
	retq
.Lfunc_end1:
	.size	_Z12init_0_ArrayPfii, .Lfunc_end1-_Z12init_0_ArrayPfii
	.cfi_endproc
                                        # -- End function
	.globl	_Z9count_NumPfii                # -- Begin function _Z9count_NumPfii
	.type	_Z9count_NumPfii,@function
_Z9count_NumPfii:                       # @_Z9count_NumPfii
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB2_1
# %bb.3:                                # %.preheader.lr.ph
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movl	%esi, %ecx
	movl	%edx, %esi
	xorl	%r8d, %r8d
	xorps	%xmm0, %xmm0
	xorl	%r9d, %r9d
	xorl	%eax, %eax
.LBB2_4:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_6 Depth 2
	testl	%edx, %edx
	jle	.LBB2_7
# %bb.5:                                # %.lr.ph
                                        #   in Loop: Header=BB2_4 Depth=1
	movl	%r8d, %r10d
	leaq	(%rdi,%r10,4), %r10
	xorl	%r11d, %r11d
.LBB2_6:                                #   Parent Loop BB2_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r10,%r11,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	cmpneqss	%xmm0, %xmm1
	movd	%xmm1, %ebx
	subl	%ebx, %eax
	incq	%r11
	cmpq	%r11, %rsi
	jne	.LBB2_6
.LBB2_7:                                # %._crit_edge
                                        #   in Loop: Header=BB2_4 Depth=1
	incq	%r9
	addl	%edx, %r8d
	cmpq	%rcx, %r9
	jne	.LBB2_4
# %bb.8:
	popq	%rbx
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	retq
.LBB2_1:
	xorl	%eax, %eax
	retq
.Lfunc_end2:
	.size	_Z9count_NumPfii, .Lfunc_end2-_Z9count_NumPfii
	.cfi_endproc
                                        # -- End function
	.globl	_Z13sparse_matrixPfPiS0_S_ii    # -- Begin function _Z13sparse_matrixPfPiS0_S_ii
	.type	_Z13sparse_matrixPfPiS0_S_ii,@function
_Z13sparse_matrixPfPiS0_S_ii:           # @_Z13sparse_matrixPfPiS0_S_ii
	.cfi_startproc
# %bb.0:
	testl	%r8d, %r8d
	jle	.LBB3_11
# %bb.1:                                # %.preheader.lr.ph
	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
	.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	%r8d, %eax
	movl	%r9d, %r8d
	movl	$-1, %ebp
	xorl	%r10d, %r10d
	xorps	%xmm0, %xmm0
	xorl	%r11d, %r11d
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
.LBB3_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_4 Depth 2
	testl	%r9d, %r9d
	jle	.LBB3_9
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	%r10d, %r15d
	leaq	(%rdi,%r15,4), %r15
	xorl	%r12d, %r12d
.LBB3_4:                                #   Parent Loop BB3_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r15,%r12,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	jne	.LBB3_5
	jnp	.LBB3_8
.LBB3_5:                                #   in Loop: Header=BB3_4 Depth=2
	movl	%ebp, %r13d
	cmpq	%r13, %r11
	je	.LBB3_7
# %bb.6:                                #   in Loop: Header=BB3_4 Depth=2
	movslq	%ebx, %rbx
	movl	%r14d, (%rsi,%rbx,4)
	incl	%ebx
	movl	%r11d, %ebp
.LBB3_7:                                #   in Loop: Header=BB3_4 Depth=2
	movslq	%r14d, %r13
	movl	%r12d, (%rdx,%r13,4)
	movss	%xmm1, (%rcx,%r13,4)
	incl	%r14d
.LBB3_8:                                #   in Loop: Header=BB3_4 Depth=2
	incq	%r12
	cmpq	%r12, %r8
	jne	.LBB3_4
.LBB3_9:                                # %._crit_edge
                                        #   in Loop: Header=BB3_2 Depth=1
	incq	%r11
	addl	%r9d, %r10d
	cmpq	%rax, %r11
	jne	.LBB3_2
# %bb.10:
	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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB3_11:                               # %._crit_edge46
	retq
.Lfunc_end3:
	.size	_Z13sparse_matrixPfPiS0_S_ii, .Lfunc_end3-_Z13sparse_matrixPfPiS0_S_ii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z9cpuSecondv
.LCPI4_0:
	.quad	0x3eb0c6f7a0b5ed8d              # double 9.9999999999999995E-7
	.text
	.globl	_Z9cpuSecondv
	.type	_Z9cpuSecondv,@function
_Z9cpuSecondv:                          # @_Z9cpuSecondv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -16
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	cvtsi2sdq	(%rbx), %xmm1
	cvtsi2sdq	8(%rbx), %xmm0
	mulsd	.LCPI4_0(%rip), %xmm0
	addsd	%xmm1, %xmm0
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z9cpuSecondv, .Lfunc_end4-_Z9cpuSecondv
	.cfi_endproc
                                        # -- End function
	.globl	_Z12print_matrixPfii            # -- Begin function _Z12print_matrixPfii
	.type	_Z12print_matrixPfii,@function
_Z12print_matrixPfii:                   # @_Z12print_matrixPfii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB5_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %ebx
	movl	%esi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%edx, %r12d
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
.LBB5_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB5_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB5_2 Depth=1
	movl	%r13d, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%r15d, %r15d
.LBB5_4:                                #   Parent Loop BB5_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%r15,4), %xmm0
	movl	$.L.str, %edi
	movb	$1, %al
	callq	printf
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB5_4
.LBB5_5:                                # %._crit_edge
                                        #   in Loop: Header=BB5_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%rbp
	addl	%ebx, %r13d
	cmpq	16(%rsp), %rbp                  # 8-byte Folded Reload
	jne	.LBB5_2
.LBB5_6:                                # %._crit_edge14
	movl	$10, %edi
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT                     # TAILCALL
.Lfunc_end5:
	.size	_Z12print_matrixPfii, .Lfunc_end5-_Z12print_matrixPfii
	.cfi_endproc
                                        # -- End function
	.globl	_Z13print_imatrixPiii           # -- Begin function _Z13print_imatrixPiii
	.type	_Z13print_imatrixPiii,@function
_Z13print_imatrixPiii:                  # @_Z13print_imatrixPiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB6_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %ebx
	movl	%esi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%edx, %r12d
	xorl	%ebp, %ebp
	xorl	%r13d, %r13d
.LBB6_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB6_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB6_2 Depth=1
	movl	%ebp, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%r15d, %r15d
.LBB6_4:                                #   Parent Loop BB6_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r14,%r15,4), %esi
	movl	$.L.str.2, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB6_4
.LBB6_5:                                # %._crit_edge
                                        #   in Loop: Header=BB6_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%r13
	addl	%ebx, %ebp
	cmpq	16(%rsp), %r13                  # 8-byte Folded Reload
	jne	.LBB6_2
.LBB6_6:                                # %._crit_edge14
	movl	$10, %edi
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT                     # TAILCALL
.Lfunc_end6:
	.size	_Z13print_imatrixPiii, .Lfunc_end6-_Z13print_imatrixPiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__mmatrixPfS_S_iii # -- Begin function _Z22__device_stub__mmatrixPfS_S_iii
	.type	_Z22__device_stub__mmatrixPfS_S_iii,@function
_Z22__device_stub__mmatrixPfS_S_iii:    # @_Z22__device_stub__mmatrixPfS_S_iii
	.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	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z7mmatrixPfS_S_iii, %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_end7:
	.size	_Z22__device_stub__mmatrixPfS_S_iii, .Lfunc_end7-_Z22__device_stub__mmatrixPfS_S_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z28__device_stub__gpuMatrixConvPfS_S_iiiiii # -- Begin function _Z28__device_stub__gpuMatrixConvPfS_S_iiiiii
	.type	_Z28__device_stub__gpuMatrixConvPfS_S_iiiiii,@function
_Z28__device_stub__gpuMatrixConvPfS_S_iiiiii: # @_Z28__device_stub__gpuMatrixConvPfS_S_iiiiii
	.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	$176, %rsp
	.cfi_def_cfa_offset 224
	.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	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	224(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	232(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	240(%rsp), %rax
	movq	%rax, 64(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z13gpuMatrixConvPfS_S_iiiiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$192, %rsp
	.cfi_adjust_cfa_offset -192
	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_end8:
	.size	_Z28__device_stub__gpuMatrixConvPfS_S_iiiiii, .Lfunc_end8-_Z28__device_stub__gpuMatrixConvPfS_S_iiiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z32__device_stub__gpuMatrixTranposePfS_ii # -- Begin function _Z32__device_stub__gpuMatrixTranposePfS_ii
	.type	_Z32__device_stub__gpuMatrixTranposePfS_ii,@function
_Z32__device_stub__gpuMatrixTranposePfS_ii: # @_Z32__device_stub__gpuMatrixTranposePfS_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	$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	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%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	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	$_Z17gpuMatrixTranposePfS_ii, %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_end9:
	.size	_Z32__device_stub__gpuMatrixTranposePfS_ii, .Lfunc_end9-_Z32__device_stub__gpuMatrixTranposePfS_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__gpuMVSparsePfS_PiS0_S_i # -- Begin function _Z26__device_stub__gpuMVSparsePfS_PiS0_S_i
	.type	_Z26__device_stub__gpuMVSparsePfS_PiS0_S_i,@function
_Z26__device_stub__gpuMVSparsePfS_PiS0_S_i: # @_Z26__device_stub__gpuMVSparsePfS_PiS0_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	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	4(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%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	$_Z11gpuMVSparsePfS_PiS0_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_end10:
	.size	_Z26__device_stub__gpuMVSparsePfS_PiS0_S_i, .Lfunc_end10-_Z26__device_stub__gpuMVSparsePfS_PiS0_S_i
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z18sparse_preparationv
.LCPI11_0:
	.quad	0x3eb0c6f7a0b5ed8d              # double 9.9999999999999995E-7
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI11_1:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.text
	.globl	_Z18sparse_preparationv
	.type	_Z18sparse_preparationv,@function
_Z18sparse_preparationv:                # @_Z18sparse_preparationv
	.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	$152, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$10, %edi
	callq	putchar@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.27, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	leaq	8(%rsp), %rsi
	movl	$.L.str.4, %edi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	jne	.LBB11_5
# %bb.1:
	leaq	8(%rsp), %rbx
.LBB11_2:                               # %.preheader113
                                        # =>This Inner Loop Header: Depth=1
	callq	getchar
	cmpl	$10, %eax
	je	.LBB11_4
# %bb.3:                                # %.preheader113
                                        #   in Loop: Header=BB11_2 Depth=1
	cmpl	$-1, %eax
	jne	.LBB11_2
.LBB11_4:                               #   in Loop: Header=BB11_2 Depth=1
	movl	$.Lstr.36, %edi
	callq	puts@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.27, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.4, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	je	.LBB11_2
.LBB11_5:                               # %.preheader112
	movl	$.Lstr.28, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	leaq	12(%rsp), %rsi
	movl	$.L.str.4, %edi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	jne	.LBB11_10
# %bb.6:
	leaq	12(%rsp), %rbx
.LBB11_7:                               # %.preheader111
                                        # =>This Inner Loop Header: Depth=1
	callq	getchar
	cmpl	$10, %eax
	je	.LBB11_9
# %bb.8:                                # %.preheader111
                                        #   in Loop: Header=BB11_7 Depth=1
	cmpl	$-1, %eax
	jne	.LBB11_7
.LBB11_9:                               #   in Loop: Header=BB11_7 Depth=1
	movl	$.Lstr.36, %edi
	callq	puts@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.28, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.4, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	je	.LBB11_7
.LBB11_10:                              # %._crit_edge
	movl	8(%rsp), %ebp
	movslq	12(%rsp), %r14
	movl	%r14d, %eax
	imull	%ebp, %eax
	movslq	%eax, %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, %r13
	leaq	(,%r14,4), %rdi
	callq	malloc
	movq	%rax, %rbx
	testq	%r14, %r14
	jle	.LBB11_14
# %bb.11:                               # %.lr.ph.i.preheader
	movl	%r14d, %r14d
	xorl	%r15d, %r15d
.LBB11_12:                              # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$274877907, %rax, %rcx          # imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	imull	$1000, %ecx, %ecx               # imm = 0x3E8
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, (%rbx,%r15,4)
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB11_12
# %bb.13:                               # %._crit_edge.i.loopexit
	movl	8(%rsp), %ebp
	movl	12(%rsp), %r14d
.LBB11_14:                              # %._crit_edge.i
	movq	%r13, %rdi
	movl	%ebp, %esi
	movl	%r14d, %edx
	callq	_Z12init_0_ArrayPfii
	movslq	8(%rsp), %rax
	movl	%eax, %r12d
	movl	12(%rsp), %r14d
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	testq	%rax, %rax
	jle	.LBB11_15
# %bb.16:                               # %.preheader.lr.ph.i
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
	xorl	%ecx, %ecx
	xorl	%ebp, %ebp
.LBB11_17:                              # %.preheader.i100
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB11_19 Depth 2
	testl	%r14d, %r14d
	jle	.LBB11_20
# %bb.18:                               # %.lr.ph.i102
                                        #   in Loop: Header=BB11_17 Depth=1
	movl	%eax, %edx
	leaq	(,%rdx,4), %rdx
	addq	%r13, %rdx
	xorl	%esi, %esi
.LBB11_19:                              #   Parent Loop BB11_17 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rdx,%rsi,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	cmpneqss	%xmm0, %xmm1
	movd	%xmm1, %edi
	subl	%edi, %ebp
	incq	%rsi
	cmpq	%rsi, %r14
	jne	.LBB11_19
.LBB11_20:                              # %._crit_edge.i101
                                        #   in Loop: Header=BB11_17 Depth=1
	incq	%rcx
	addl	%r14d, %eax
	cmpq	%r12, %rcx
	jne	.LBB11_17
	jmp	.LBB11_21
.LBB11_15:
	xorl	%ebp, %ebp
.LBB11_21:                              # %_Z9count_NumPfii.exit
	movslq	%ebp, %rax
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	leaq	(,%rax,4), %rdi
	movq	%rdi, 24(%rsp)                  # 8-byte Spill
	callq	malloc
	movq	%rax, %r15
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	4(,%rax,4), %rdi
	movq	%rdi, 32(%rsp)                  # 8-byte Spill
	callq	malloc
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movq	24(%rsp), %rdi                  # 8-byte Reload
	callq	malloc
	movq	%r13, 72(%rsp)                  # 8-byte Spill
	movq	%rax, %r13
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(,%rax,4), %rdi
	movq	%rdi, 64(%rsp)                  # 8-byte Spill
	callq	malloc
	movq	%rax, 56(%rsp)                  # 8-byte Spill
	movq	64(%rsp), %rdi                  # 8-byte Reload
	callq	malloc
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movq	48(%rsp), %rsi                  # 8-byte Reload
	movq	%r13, %rdx
	movq	%r15, %rcx
	movl	%r12d, %r8d
	movl	%r14d, %r9d
	callq	_Z13sparse_matrixPfPiS0_S_ii
	movq	48(%rsp), %rax                  # 8-byte Reload
	movq	40(%rsp), %rcx                  # 8-byte Reload
	movq	16(%rsp), %rdx                  # 8-byte Reload
	movl	%ecx, (%rax,%rdx,4)
	leaq	112(%rsp), %rdi
	movq	32(%rsp), %rsi                  # 8-byte Reload
	callq	hipMalloc
	leaq	104(%rsp), %rdi
	movq	24(%rsp), %r12                  # 8-byte Reload
	movq	%r12, %rsi
	callq	hipMalloc
	leaq	96(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movslq	8(%rsp), %rsi
	shlq	$2, %rsi
	leaq	88(%rsp), %r14
	movq	%r14, %rdi
	callq	hipMalloc
	movslq	12(%rsp), %rsi
	shlq	$2, %rsi
	leaq	80(%rsp), %rdi
	callq	hipMalloc
	movq	(%r14), %rdi
	movslq	8(%rsp), %rdx
	shlq	$2, %rdx
	xorl	%esi, %esi
	callq	hipMemset
	leaq	112(%rsp), %rax
	movq	(%rax), %rdi
	movslq	8(%rsp), %rax
	leaq	4(,%rax,4), %rdx
	movq	48(%rsp), %rsi                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	104(%rsp), %rax
	movq	(%rax), %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	96(%rsp), %rax
	movq	(%rax), %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	80(%rsp), %rax
	movq	(%rax), %rdi
	movslq	12(%rsp), %rdx
	shlq	$2, %rdx
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	120(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	cvtsi2sdq	(%r14), %xmm0
	movsd	%xmm0, 32(%rsp)                 # 8-byte Spill
	cvtsi2sdq	8(%r14), %xmm2
	movl	8(%rsp), %r14d
	testl	%r14d, %r14d
	jle	.LBB11_28
# %bb.22:                               # %.lr.ph124.preheader
	leaq	(,%r14,4), %rdx
	xorl	%r12d, %r12d
	movq	56(%rsp), %rdi                  # 8-byte Reload
	xorl	%esi, %esi
	movsd	%xmm2, 40(%rsp)                 # 8-byte Spill
	callq	memset@PLT
	movsd	40(%rsp), %xmm2                 # 8-byte Reload
                                        # xmm2 = mem[0],zero
	movq	48(%rsp), %rdi                  # 8-byte Reload
	movl	(%rdi), %eax
	movq	56(%rsp), %r8                   # 8-byte Reload
.LBB11_23:                              # %.lr.ph124
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB11_25 Depth 2
	movl	%eax, %edx
	movl	4(%rdi,%r12,4), %eax
	cmpl	%eax, %edx
	jge	.LBB11_27
# %bb.24:                               # %.lr.ph120
                                        #   in Loop: Header=BB11_23 Depth=1
	movslq	%eax, %rcx
	movss	(%r8,%r12,4), %xmm0             # xmm0 = mem[0],zero,zero,zero
	movslq	%edx, %rdx
.LBB11_25:                              #   Parent Loop BB11_23 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r15,%rdx,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	movslq	(%r13,%rdx,4), %rsi
	mulss	(%rbx,%rsi,4), %xmm1
	addss	%xmm1, %xmm0
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	.LBB11_25
# %bb.26:                               # %..loopexit_crit_edge
                                        #   in Loop: Header=BB11_23 Depth=1
	movss	%xmm0, (%r8,%r12,4)
.LBB11_27:                              # %.loopexit
                                        #   in Loop: Header=BB11_23 Depth=1
	incq	%r12
	cmpq	%r14, %r12
	jne	.LBB11_23
.LBB11_28:                              # %._crit_edge125
	mulsd	.LCPI11_0(%rip), %xmm2
	movsd	%xmm2, 40(%rsp)                 # 8-byte Spill
	leaq	120(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	xorps	%xmm0, %xmm0
	cvtsi2sdq	(%r14), %xmm0
	movsd	%xmm0, 144(%rsp)                # 8-byte Spill
	xorps	%xmm0, %xmm0
	cvtsi2sdq	8(%r14), %xmm0
	mulsd	.LCPI11_0(%rip), %xmm0
	movsd	%xmm0, 16(%rsp)                 # 8-byte Spill
	movl	12(%rsp), %r14d
	addl	$32, %r14d
	leaq	120(%rsp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	xorps	%xmm0, %xmm0
	cvtsi2sdq	(%r12), %xmm0
	movsd	%xmm0, 136(%rsp)                # 8-byte Spill
	xorps	%xmm0, %xmm0
	cvtsi2sdq	8(%r12), %xmm0
	mulsd	.LCPI11_0(%rip), %xmm0
	movsd	%xmm0, 24(%rsp)                 # 8-byte Spill
	btsq	$32, %r14
	movabsq	$4294967296, %rdx               # imm = 0x100000000
	orq	$32, %rdx
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB11_30
# %bb.29:
	movq	96(%rsp), %rdi
	movq	80(%rsp), %rsi
	movq	112(%rsp), %rdx
	movq	104(%rsp), %rcx
	movq	88(%rsp), %r8
	movl	8(%rsp), %r9d
	callq	_Z26__device_stub__gpuMVSparsePfS_PiS0_S_i
.LBB11_30:
	movsd	40(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	addsd	32(%rsp), %xmm0                 # 8-byte Folded Reload
	movsd	%xmm0, 40(%rsp)                 # 8-byte Spill
	movsd	16(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	addsd	144(%rsp), %xmm0                # 8-byte Folded Reload
	movsd	%xmm0, 16(%rsp)                 # 8-byte Spill
	movsd	24(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	addsd	136(%rsp), %xmm0                # 8-byte Folded Reload
	movsd	%xmm0, 24(%rsp)                 # 8-byte Spill
	callq	hipDeviceSynchronize
	movq	88(%rsp), %rsi
	movslq	8(%rsp), %rdx
	shlq	$2, %rdx
	movq	64(%rsp), %r12                  # 8-byte Reload
	movq	%r12, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	leaq	120(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	xorps	%xmm0, %xmm0
	cvtsi2sdq	(%r14), %xmm0
	cvtsi2sdq	8(%r14), %xmm1
	mulsd	.LCPI11_0(%rip), %xmm1
	addsd	%xmm0, %xmm1
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.LBB11_31
# %bb.32:                               # %.lr.ph129.preheader
	movsd	%xmm1, 32(%rsp)                 # 8-byte Spill
	movb	$1, %cl
	xorl	%r14d, %r14d
	movaps	.LCPI11_1(%rip), %xmm5          # xmm5 = [NaN,NaN,NaN,NaN]
	movq	56(%rsp), %rsi                  # 8-byte Reload
	movsd	16(%rsp), %xmm3                 # 8-byte Reload
                                        # xmm3 = mem[0],zero
	movsd	24(%rsp), %xmm4                 # 8-byte Reload
                                        # xmm4 = mem[0],zero
.LBB11_33:                              # %.lr.ph129
                                        # =>This Inner Loop Header: Depth=1
	movss	(%r12,%r14,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	(%rsi,%r14,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm2
	subss	%xmm1, %xmm2
	andps	%xmm5, %xmm2
	cvtss2sd	%xmm2, %xmm2
	ucomisd	.LCPI11_0(%rip), %xmm2
	jb	.LBB11_35
# %bb.34:                               #   in Loop: Header=BB11_33 Depth=1
	cvtss2sd	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm1
	movl	$.L.str.7, %edi
	movb	$2, %al
	callq	printf
	movaps	.LCPI11_1(%rip), %xmm5          # xmm5 = [NaN,NaN,NaN,NaN]
	movsd	24(%rsp), %xmm4                 # 8-byte Reload
                                        # xmm4 = mem[0],zero
	movsd	16(%rsp), %xmm3                 # 8-byte Reload
                                        # xmm3 = mem[0],zero
	movq	56(%rsp), %rsi                  # 8-byte Reload
	xorl	%ecx, %ecx
	movl	8(%rsp), %eax
.LBB11_35:                              #   in Loop: Header=BB11_33 Depth=1
	incq	%r14
	movslq	%eax, %rdx
	cmpq	%rdx, %r14
	jl	.LBB11_33
# %bb.36:                               # %._crit_edge130
	testb	$1, %cl
	movl	$.Lstr.30, %eax
	movl	$.Lstr.31, %edi
	cmoveq	%rax, %rdi
	movsd	32(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	jmp	.LBB11_37
.LBB11_31:
	movl	$.Lstr.31, %edi
	movsd	16(%rsp), %xmm3                 # 8-byte Reload
                                        # xmm3 = mem[0],zero
	movsd	24(%rsp), %xmm4                 # 8-byte Reload
                                        # xmm4 = mem[0],zero
.LBB11_37:                              # %._crit_edge130.thread
	subsd	40(%rsp), %xmm3                 # 8-byte Folded Reload
	movsd	%xmm3, 16(%rsp)                 # 8-byte Spill
	subsd	%xmm4, %xmm1
	movsd	%xmm1, 32(%rsp)                 # 8-byte Spill
	callq	puts@PLT
	movl	$.Lstr.32, %edi
	callq	puts@PLT
	movl	$.Lstr.33, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	leaq	120(%rsp), %r14
	movl	$.L.str.12, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	cmpb	$121, (%r14)
	jne	.LBB11_39
# %bb.38:
	movl	8(%rsp), %esi
	movl	12(%rsp), %edx
	movq	72(%rsp), %rdi                  # 8-byte Reload
	callq	_Z12print_matrixPfii
	movq	%r15, %rdi
	movl	$1, %esi
	movl	%ebp, %edx
	callq	_Z12print_matrixPfii
	movl	12(%rsp), %edx
	incl	%edx
	movq	48(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	callq	_Z13print_imatrixPiii
	movq	%r13, %rdi
	movl	$1, %esi
	movl	%ebp, %edx
	callq	_Z13print_imatrixPiii
	movl	8(%rsp), %esi
	movq	56(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %edx
	callq	_Z12print_matrixPfii
	movl	8(%rsp), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_Z12print_matrixPfii
	movq	stdout(%rip), %rdi
	callq	fflush
.LBB11_39:
	movl	$.L.str.13, %edi
	movsd	16(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	movl	$.L.str.14, %edi
	movsd	32(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	movq	72(%rsp), %rdi                  # 8-byte Reload
	testq	%rdi, %rdi
	je	.LBB11_41
# %bb.40:
	callq	_ZdaPv
.LBB11_41:
	testq	%rbx, %rbx
	je	.LBB11_43
# %bb.42:
	movq	%rbx, %rdi
	callq	_ZdaPv
.LBB11_43:
	testq	%r13, %r13
	je	.LBB11_45
# %bb.44:
	movq	%r13, %rdi
	callq	_ZdaPv
.LBB11_45:
	movq	48(%rsp), %rdi                  # 8-byte Reload
	testq	%rdi, %rdi
	je	.LBB11_47
# %bb.46:
	callq	_ZdaPv
.LBB11_47:
	movq	56(%rsp), %rdi                  # 8-byte Reload
	testq	%rdi, %rdi
	je	.LBB11_49
# %bb.48:
	callq	_ZdaPv
.LBB11_49:
	testq	%r12, %r12
	je	.LBB11_51
# %bb.50:
	movq	%r12, %rdi
	callq	_ZdaPv
.LBB11_51:
	testq	%r15, %r15
	je	.LBB11_53
# %bb.52:
	movq	%r15, %rdi
	callq	_ZdaPv
.LBB11_53:
	movq	96(%rsp), %rdi
	callq	hipFree
	movq	104(%rsp), %rdi
	callq	hipFree
	movq	112(%rsp), %rdi
	callq	hipFree
	movq	88(%rsp), %rdi
	callq	hipFree
	movq	80(%rsp), %rdi
	callq	hipFree
	addq	$152, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end11:
	.size	_Z18sparse_preparationv, .Lfunc_end11-_Z18sparse_preparationv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z20tranpose_preparationv
.LCPI12_0:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI12_1:
	.quad	0x3eb0c6f7a0b5ed8d              # double 9.9999999999999995E-7
	.text
	.globl	_Z20tranpose_preparationv
	.type	_Z20tranpose_preparationv,@function
_Z20tranpose_preparationv:              # @_Z20tranpose_preparationv
	.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	$104, %rsp
	.cfi_def_cfa_offset 160
	.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	$10, %edi
	callq	putchar@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.27, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	leaq	8(%rsp), %rsi
	movl	$.L.str.4, %edi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	jne	.LBB12_5
# %bb.1:
	leaq	8(%rsp), %rbx
.LBB12_2:                               # %.preheader77
                                        # =>This Inner Loop Header: Depth=1
	callq	getchar
	cmpl	$10, %eax
	je	.LBB12_4
# %bb.3:                                # %.preheader77
                                        #   in Loop: Header=BB12_2 Depth=1
	cmpl	$-1, %eax
	jne	.LBB12_2
.LBB12_4:                               #   in Loop: Header=BB12_2 Depth=1
	movl	$.Lstr.36, %edi
	callq	puts@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.27, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.4, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	je	.LBB12_2
.LBB12_5:                               # %.preheader76
	movl	$.Lstr.28, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	leaq	12(%rsp), %rsi
	movl	$.L.str.4, %edi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	jne	.LBB12_10
# %bb.6:
	leaq	12(%rsp), %rbx
.LBB12_7:                               # %.preheader75
                                        # =>This Inner Loop Header: Depth=1
	callq	getchar
	cmpl	$10, %eax
	je	.LBB12_9
# %bb.8:                                # %.preheader75
                                        #   in Loop: Header=BB12_7 Depth=1
	cmpl	$-1, %eax
	jne	.LBB12_7
.LBB12_9:                               #   in Loop: Header=BB12_7 Depth=1
	movl	$.Lstr.36, %edi
	callq	puts@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.28, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.4, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	je	.LBB12_7
.LBB12_10:                              # %._crit_edge
	movslq	8(%rsp), %rax
	movslq	12(%rsp), %r12
	imulq	%rax, %r12
	shlq	$2, %r12
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %r14
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %r15
	leaq	32(%rsp), %r13
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movslq	8(%rsp), %rax
	movslq	12(%rsp), %rsi
	imulq	%rax, %rsi
	shlq	$2, %rsi
	leaq	24(%rsp), %rdi
	callq	hipMalloc
	movl	8(%rsp), %esi
	movl	12(%rsp), %edx
	movq	%rbx, %rdi
	callq	_Z10init_ArrayPfii
	movq	(%r13), %rdi
	movslq	8(%rsp), %rax
	movslq	12(%rsp), %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	xorl	%r12d, %r12d
	leaq	40(%rsp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.LBB12_16
# %bb.11:                               # %.preheader74.lr.ph
	movl	12(%rsp), %ecx
	leaq	(,%rax,4), %rdx
	movq	%r14, %rsi
	xorl	%edi, %edi
.LBB12_12:                              # %.preheader74
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB12_14 Depth 2
	testl	%ecx, %ecx
	jle	.LBB12_15
# %bb.13:                               # %.lr.ph
                                        #   in Loop: Header=BB12_12 Depth=1
	movl	%r12d, %r8d
	leaq	(%rbx,%r8,4), %r8
	movq	%rsi, %r9
	xorl	%r10d, %r10d
.LBB12_14:                              #   Parent Loop BB12_12 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r8,%r10,4), %xmm0             # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%r9)
	incq	%r10
	addq	%rdx, %r9
	cmpq	%r10, %rcx
	jne	.LBB12_14
.LBB12_15:                              # %._crit_edge81
                                        #   in Loop: Header=BB12_12 Depth=1
	incq	%rdi
	addl	%ecx, %r12d
	addq	$4, %rsi
	cmpq	%rax, %rdi
	jne	.LBB12_12
.LBB12_16:                              # %._crit_edge83
	leaq	40(%rsp), %r13
	movq	(%r13), %rax
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	movq	8(%r13), %rax
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	8(%rsp), %r12d
	leal	31(%r12), %eax
	addl	$62, %r12d
	testl	%eax, %eax
	cmovnsl	%eax, %r12d
	movq	(%r13), %rax
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	sarl	$5, %r12d
	movl	12(%rsp), %eax
	leal	31(%rax), %ecx
	addl	$62, %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	movq	8(%r13), %rcx
	movq	%rcx, 16(%rsp)                  # 8-byte Spill
	sarl	$5, %eax
	shlq	$32, %r12
	orq	%rax, %r12
	leaq	40(%rsp), %r13
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r13), %rax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	movq	8(%r13), %rax
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB12_18
# %bb.17:
	movq	32(%rsp), %rdi
	movq	24(%rsp), %rsi
	movl	8(%rsp), %edx
	movl	12(%rsp), %ecx
	callq	_Z32__device_stub__gpuMatrixTranposePfS_ii
.LBB12_18:
	callq	hipDeviceSynchronize
	movq	24(%rsp), %rsi
	movslq	8(%rsp), %rax
	movslq	12(%rsp), %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
	movq	%r15, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	xorl	%ebp, %ebp
	leaq	40(%rsp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r12), %rax
	movq	%rax, 56(%rsp)                  # 8-byte Spill
	movq	8(%r12), %r13
	movl	8(%rsp), %esi
	testl	%esi, %esi
	jle	.LBB12_19
# %bb.20:                               # %.preheader.preheader
	movb	$1, %al
	movl	12(%rsp), %ecx
	movaps	.LCPI12_0(%rip), %xmm3          # xmm3 = [NaN,NaN,NaN,NaN]
	movsd	.LCPI12_1(%rip), %xmm4          # xmm4 = mem[0],zero
	movl	%ecx, %edx
.LBB12_21:                              # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB12_23 Depth 2
	testl	%edx, %edx
	jle	.LBB12_27
# %bb.22:                               # %.lr.ph86.preheader
                                        #   in Loop: Header=BB12_21 Depth=1
	xorl	%r12d, %r12d
.LBB12_23:                              # %.lr.ph86
                                        #   Parent Loop BB12_21 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	imull	%ebp, %edx
	movslq	%edx, %rdx
	addq	%r12, %rdx
	movss	(%r15,%rdx,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	(%r14,%rdx,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm2
	subss	%xmm1, %xmm2
	andps	%xmm3, %xmm2
	cvtss2sd	%xmm2, %xmm2
	ucomisd	%xmm4, %xmm2
	jb	.LBB12_25
# %bb.24:                               #   in Loop: Header=BB12_23 Depth=2
	cvtss2sd	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm1
	movl	$.L.str.7, %edi
	movb	$2, %al
	callq	printf
	movsd	.LCPI12_1(%rip), %xmm4          # xmm4 = mem[0],zero
	movaps	.LCPI12_0(%rip), %xmm3          # xmm3 = [NaN,NaN,NaN,NaN]
	xorl	%eax, %eax
	movl	12(%rsp), %ecx
.LBB12_25:                              #   in Loop: Header=BB12_23 Depth=2
	incq	%r12
	movl	%ecx, %edx
	cmpl	%ecx, %r12d
	jl	.LBB12_23
# %bb.26:                               # %._crit_edge87.loopexit
                                        #   in Loop: Header=BB12_21 Depth=1
	movl	8(%rsp), %esi
	movl	%ecx, %edx
.LBB12_27:                              # %._crit_edge87
                                        #   in Loop: Header=BB12_21 Depth=1
	incl	%ebp
	cmpl	%esi, %ebp
	jl	.LBB12_21
# %bb.28:                               # %._crit_edge90
	testb	$1, %al
	movl	$.Lstr.30, %eax
	movl	$.Lstr.31, %edi
	cmoveq	%rax, %rdi
	jmp	.LBB12_29
.LBB12_19:
	movl	$.Lstr.31, %edi
.LBB12_29:                              # %._crit_edge90.thread
	callq	puts@PLT
	movl	$.Lstr.12, %edi
	callq	puts@PLT
	movl	$.Lstr.33, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	leaq	40(%rsp), %r12
	movl	$.L.str.12, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	cmpb	$121, (%r12)
	jne	.LBB12_31
# %bb.30:
	movl	8(%rsp), %esi
	movl	12(%rsp), %edx
	movq	%rbx, %rdi
	callq	_Z12print_matrixPfii
	movl	12(%rsp), %esi
	movl	8(%rsp), %edx
	movq	%r14, %rdi
	callq	_Z12print_matrixPfii
	movl	12(%rsp), %esi
	movl	8(%rsp), %edx
	movq	%r15, %rdi
	callq	_Z12print_matrixPfii
	movq	stdout(%rip), %rdi
	callq	fflush
.LBB12_31:
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r13, %xmm0
	movsd	.LCPI12_1(%rip), %xmm1          # xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	xorps	%xmm2, %xmm2
	cvtsi2sdq	56(%rsp), %xmm2         # 8-byte Folded Reload
	addsd	%xmm0, %xmm2
	movapd	%xmm2, %xmm4
	xorps	%xmm0, %xmm0
	cvtsi2sdq	64(%rsp), %xmm0         # 8-byte Folded Reload
	xorps	%xmm2, %xmm2
	cvtsi2sdq	72(%rsp), %xmm2         # 8-byte Folded Reload
	mulsd	%xmm1, %xmm0
	addsd	%xmm0, %xmm2
	xorps	%xmm3, %xmm3
	cvtsi2sdq	16(%rsp), %xmm3         # 8-byte Folded Reload
	subsd	%xmm2, %xmm4
	movsd	%xmm4, 16(%rsp)                 # 8-byte Spill
	mulsd	%xmm1, %xmm3
	xorps	%xmm0, %xmm0
	cvtsi2sdq	80(%rsp), %xmm0         # 8-byte Folded Reload
	addsd	%xmm3, %xmm0
	xorps	%xmm2, %xmm2
	cvtsi2sdq	88(%rsp), %xmm2         # 8-byte Folded Reload
	mulsd	%xmm1, %xmm2
	xorps	%xmm1, %xmm1
	cvtsi2sdq	96(%rsp), %xmm1         # 8-byte Folded Reload
	addsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	movl	$.L.str.13, %edi
	movb	$1, %al
	callq	printf
	movl	$.L.str.14, %edi
	movsd	16(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	movq	%rbx, %rdi
	callq	hipHostFree
	movq	%r14, %rdi
	callq	hipHostFree
	movq	%r15, %rdi
	callq	hipHostFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	addq	$104, %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_end12:
	.size	_Z20tranpose_preparationv, .Lfunc_end12-_Z20tranpose_preparationv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z16conv_preparationv
.LCPI13_0:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI13_1:
	.quad	0x3eb0c6f7a0b5ed8d              # double 9.9999999999999995E-7
	.text
	.globl	_Z16conv_preparationv
	.type	_Z16conv_preparationv,@function
_Z16conv_preparationv:                  # @_Z16conv_preparationv
	.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
	leaq	20(%rsp), %rbx
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r15
.LBB13_1:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB13_2 Depth 2
                                        #       Child Loop BB13_8 Depth 3
                                        #     Child Loop BB13_3 Depth 2
                                        #       Child Loop BB13_11 Depth 3
                                        #     Child Loop BB13_4 Depth 2
                                        #       Child Loop BB13_5 Depth 3
	movl	$10, %edi
	callq	putchar@PLT
.LBB13_2:                               #   Parent Loop BB13_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB13_8 Depth 3
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.27, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.4, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	jne	.LBB13_3
.LBB13_8:                               # %.preheader147
                                        #   Parent Loop BB13_1 Depth=1
                                        #     Parent Loop BB13_2 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	callq	getchar
	cmpl	$10, %eax
	je	.LBB13_10
# %bb.9:                                # %.preheader147
                                        #   in Loop: Header=BB13_8 Depth=3
	cmpl	$-1, %eax
	jne	.LBB13_8
.LBB13_10:                              #   in Loop: Header=BB13_2 Depth=2
	movl	$.Lstr.36, %edi
	callq	puts@PLT
	jmp	.LBB13_2
.LBB13_11:                              # %.preheader146
                                        #   Parent Loop BB13_1 Depth=1
                                        #     Parent Loop BB13_3 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	callq	getchar
	cmpl	$10, %eax
	je	.LBB13_13
# %bb.12:                               # %.preheader146
                                        #   in Loop: Header=BB13_11 Depth=3
	cmpl	$-1, %eax
	jne	.LBB13_11
.LBB13_13:                              #   in Loop: Header=BB13_3 Depth=2
	movl	$.Lstr.36, %edi
	callq	puts@PLT
	movl	$10, %edi
	callq	putchar@PLT
.LBB13_3:                               # %.preheader149
                                        #   Parent Loop BB13_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB13_11 Depth 3
	movl	$.Lstr.17, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.4, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	je	.LBB13_11
	jmp	.LBB13_4
.LBB13_5:                               # %.preheader145
                                        #   Parent Loop BB13_1 Depth=1
                                        #     Parent Loop BB13_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	callq	getchar
	cmpl	$10, %eax
	je	.LBB13_7
# %bb.6:                                # %.preheader145
                                        #   in Loop: Header=BB13_5 Depth=3
	cmpl	$-1, %eax
	jne	.LBB13_5
.LBB13_7:                               #   in Loop: Header=BB13_4 Depth=2
	movl	$.Lstr.36, %edi
	callq	puts@PLT
	movl	$10, %edi
	callq	putchar@PLT
.LBB13_4:                               # %.preheader148
                                        #   Parent Loop BB13_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB13_5 Depth 3
	movl	$.Lstr.18, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.4, %edi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	je	.LBB13_5
# %bb.14:                               # %._crit_edge
                                        #   in Loop: Header=BB13_1 Depth=1
	movl	12(%rsp), %r13d
	movl	20(%rsp), %edx
	movl	%edx, %ecx
	subl	%r13d, %ecx
	jle	.LBB13_16
# %bb.15:                               # %._crit_edge
                                        #   in Loop: Header=BB13_1 Depth=1
	movl	16(%rsp), %eax
	cmpl	%r13d, %eax
	jg	.LBB13_17
.LBB13_16:                              #   in Loop: Header=BB13_1 Depth=1
	movl	$.Lstr.23, %edi
	callq	puts@PLT
	jmp	.LBB13_1
.LBB13_17:
	movq	%rcx, 104(%rsp)                 # 8-byte Spill
	movslq	%r13d, %r12
	movl	%eax, %ecx
	subl	%r13d, %ecx
	movq	%rcx, 32(%rsp)                  # 8-byte Spill
	leal	1(%rcx), %r14d
	movl	%edx, %ecx
	subl	%r13d, %ecx
	movq	%rcx, 40(%rsp)                  # 8-byte Spill
	leal	1(%rcx), %ebp
	imull	%edx, %eax
	movslq	%eax, %r15
	shlq	$2, %r15
	movq	%r15, %rdi
	movq	%rdx, 24(%rsp)                  # 8-byte Spill
	callq	malloc
	movq	%rax, %rbx
	movl	%r13d, %edi
	imull	%r13d, %edi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	movl	%r14d, %eax
	movq	%rbp, 136(%rsp)                 # 8-byte Spill
	imull	%ebp, %eax
	movslq	%eax, %rbp
	shlq	$2, %rbp
	movq	%rbp, %rdi
	callq	malloc
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movq	%rbp, %rdi
	callq	malloc
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	leaq	128(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	movslq	12(%rsp), %rsi
	imulq	%r12, %rsi
	shlq	$2, %rsi
	leaq	120(%rsp), %rdi
	callq	hipMalloc
	leaq	112(%rsp), %rdi
	movq	%rbp, 88(%rsp)                  # 8-byte Spill
	movq	%rbp, %rsi
	callq	hipMalloc
	movl	20(%rsp), %esi
	movl	16(%rsp), %edx
	movq	%rbx, %rdi
	callq	_Z10init_ArrayPfii
	movl	12(%rsp), %edx
	movq	80(%rsp), %r15                  # 8-byte Reload
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_Z10init_ArrayPfii
	leaq	128(%rsp), %rax
	movq	(%rax), %rdi
	movslq	20(%rsp), %rax
	movslq	16(%rsp), %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	120(%rsp), %rax
	movq	(%rax), %rdi
	movslq	12(%rsp), %rax
	movslq	%r13d, %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	144(%rsp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	24(%rsp), %rdx                  # 8-byte Reload
	movq	%r14, 56(%rsp)                  # 8-byte Spill
	movl	%r14d, %r15d
	cmpl	$0, 40(%rsp)                    # 4-byte Folded Reload
	js	.LBB13_29
# %bb.18:                               # %.preheader144.lr.ph
	movl	12(%rsp), %eax
	movl	16(%rsp), %ecx
	movslq	56(%rsp), %rsi                  # 4-byte Folded Reload
	movq	%rsi, 96(%rsp)                  # 8-byte Spill
	subl	%r13d, %edx
	incl	%edx
	shlq	$2, %r12
	xorl	%esi, %esi
	movq	%rsi, 72(%rsp)                  # 8-byte Spill
	xorl	%edi, %edi
	movq	%rdx, 24(%rsp)                  # 8-byte Spill
.LBB13_19:                              # %.preheader144
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB13_21 Depth 2
                                        #       Child Loop BB13_23 Depth 3
                                        #         Child Loop BB13_25 Depth 4
	cmpl	$0, 32(%rsp)                    # 4-byte Folded Reload
	js	.LBB13_28
# %bb.20:                               # %.preheader143.lr.ph
                                        #   in Loop: Header=BB13_19 Depth=1
	movq	%rdi, %rdx
	imulq	96(%rsp), %rdx                  # 8-byte Folded Reload
	movq	64(%rsp), %rsi                  # 8-byte Reload
	leaq	(%rsi,%rdx,4), %r8
	movq	72(%rsp), %r9                   # 8-byte Reload
	xorl	%r10d, %r10d
.LBB13_21:                              # %.preheader143
                                        #   Parent Loop BB13_19 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB13_23 Depth 3
                                        #         Child Loop BB13_25 Depth 4
	xorps	%xmm0, %xmm0
	testl	%r13d, %r13d
	jle	.LBB13_27
# %bb.22:                               # %.preheader142.preheader
                                        #   in Loop: Header=BB13_21 Depth=2
	movq	%r9, %r11
	movq	80(%rsp), %r14                  # 8-byte Reload
	xorl	%edx, %edx
.LBB13_23:                              # %.preheader142
                                        #   Parent Loop BB13_19 Depth=1
                                        #     Parent Loop BB13_21 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB13_25 Depth 4
	testl	%eax, %eax
	jle	.LBB13_26
# %bb.24:                               # %.lr.ph
                                        #   in Loop: Header=BB13_23 Depth=3
	xorl	%ebp, %ebp
.LBB13_25:                              #   Parent Loop BB13_19 Depth=1
                                        #     Parent Loop BB13_21 Depth=2
                                        #       Parent Loop BB13_23 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	leal	(%r11,%rbp), %esi
	movslq	%esi, %rsi
	movss	(%rbx,%rsi,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	mulss	(%r14,%rbp,4), %xmm1
	addss	%xmm1, %xmm0
	incq	%rbp
	cmpq	%rbp, %rax
	jne	.LBB13_25
.LBB13_26:                              # %._crit_edge157
                                        #   in Loop: Header=BB13_23 Depth=3
	incq	%rdx
	addq	%r12, %r14
	addq	%rcx, %r11
	cmpq	%r13, %rdx
	jne	.LBB13_23
.LBB13_27:                              # %._crit_edge160
                                        #   in Loop: Header=BB13_21 Depth=2
	movss	%xmm0, (%r8,%r10,4)
	incq	%r10
	incq	%r9
	cmpq	%r15, %r10
	jne	.LBB13_21
.LBB13_28:                              # %._crit_edge164
                                        #   in Loop: Header=BB13_19 Depth=1
	incq	%rdi
	addq	%rcx, 72(%rsp)                  # 8-byte Folded Spill
	movq	24(%rsp), %rdx                  # 8-byte Reload
	cmpq	%rdx, %rdi
	jne	.LBB13_19
.LBB13_29:                              # %._crit_edge167
	leaq	144(%rsp), %r12
	movq	(%r12), %rax
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	movq	8(%r12), %rax
	movq	%rax, 192(%rsp)                 # 8-byte Spill
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r12), %rax
	movq	%rax, 184(%rsp)                 # 8-byte Spill
	movq	40(%rsp), %r14                  # 8-byte Reload
	leal	32(%r14), %eax
	leal	63(%r14), %ebp
	testl	%eax, %eax
	cmovnsl	%eax, %ebp
	sarl	$5, %ebp
	movq	32(%rsp), %rcx                  # 8-byte Reload
	leal	32(%rcx), %eax
	addl	$63, %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	movq	8(%r12), %rax
	movq	%rax, 176(%rsp)                 # 8-byte Spill
	sarl	$5, %ecx
	shlq	$32, %rbp
	orq	%rcx, %rbp
	leaq	144(%rsp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r12), %rax
	movq	%rax, 168(%rsp)                 # 8-byte Spill
	movq	8(%r12), %rax
	movq	%rax, 160(%rsp)                 # 8-byte Spill
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movq	%rbp, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB13_31
# %bb.30:
	movq	128(%rsp), %rdi
	movq	120(%rsp), %rsi
	movq	112(%rsp), %rdx
	movl	20(%rsp), %ecx
	movl	16(%rsp), %r8d
	movl	12(%rsp), %eax
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	%r13d, %r9d
	pushq	64(%rsp)                        # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	152(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	callq	_Z28__device_stub__gpuMatrixConvPfS_S_iiiiii
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
.LBB13_31:
	callq	hipDeviceSynchronize
	movq	112(%rsp), %rsi
	movq	48(%rsp), %rdi                  # 8-byte Reload
	movq	88(%rsp), %rdx                  # 8-byte Reload
	movl	$2, %ecx
	callq	hipMemcpy
	xorl	%r12d, %r12d
	leaq	144(%rsp), %rbp
	movq	%rbp, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbp), %rax
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	movq	8(%rbp), %rbp
	testl	%r14d, %r14d
	js	.LBB13_32
# %bb.33:                               # %.preheader.lr.ph
	movq	%rbp, 40(%rsp)                  # 8-byte Spill
	movq	104(%rsp), %rcx                 # 8-byte Reload
	incl	%ecx
	movb	$1, %al
	movaps	.LCPI13_0(%rip), %xmm3          # xmm3 = [NaN,NaN,NaN,NaN]
	movsd	.LCPI13_1(%rip), %xmm4          # xmm4 = mem[0],zero
	xorl	%edx, %edx
	movq	%rcx, 104(%rsp)                 # 8-byte Spill
.LBB13_34:                              # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB13_36 Depth 2
	movq	%rdx, 24(%rsp)                  # 8-byte Spill
	cmpl	$0, 32(%rsp)                    # 4-byte Folded Reload
	movq	%r12, 72(%rsp)                  # 8-byte Spill
	js	.LBB13_39
# %bb.35:                               # %.lr.ph171
                                        #   in Loop: Header=BB13_34 Depth=1
	movl	%r12d, %ecx
	movq	64(%rsp), %rdx                  # 8-byte Reload
	leaq	(%rdx,%rcx,4), %r14
	movq	48(%rsp), %rdx                  # 8-byte Reload
	leaq	(%rdx,%rcx,4), %r12
	xorl	%ebp, %ebp
.LBB13_36:                              #   Parent Loop BB13_34 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r12,%rbp,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	(%r14,%rbp,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm2
	subss	%xmm1, %xmm2
	andps	%xmm3, %xmm2
	cvtss2sd	%xmm2, %xmm2
	ucomisd	%xmm4, %xmm2
	jb	.LBB13_38
# %bb.37:                               #   in Loop: Header=BB13_36 Depth=2
	cvtss2sd	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm1
	movl	$.L.str.19, %edi
	movb	$2, %al
	callq	printf
	movsd	.LCPI13_1(%rip), %xmm4          # xmm4 = mem[0],zero
	movaps	.LCPI13_0(%rip), %xmm3          # xmm3 = [NaN,NaN,NaN,NaN]
	xorl	%eax, %eax
.LBB13_38:                              #   in Loop: Header=BB13_36 Depth=2
	incq	%rbp
	cmpq	%rbp, %r15
	jne	.LBB13_36
.LBB13_39:                              # %._crit_edge172
                                        #   in Loop: Header=BB13_34 Depth=1
	movq	24(%rsp), %rdx                  # 8-byte Reload
	incq	%rdx
	movq	72(%rsp), %r12                  # 8-byte Reload
	addl	56(%rsp), %r12d                 # 4-byte Folded Reload
	movq	104(%rsp), %rcx                 # 8-byte Reload
	cmpq	%rcx, %rdx
	jne	.LBB13_34
# %bb.40:                               # %._crit_edge177
	testb	$1, %al
	movl	$.Lstr.30, %eax
	movl	$.Lstr.31, %edi
	cmoveq	%rax, %rdi
	movq	40(%rsp), %rbp                  # 8-byte Reload
	jmp	.LBB13_41
.LBB13_32:
	movl	$.Lstr.31, %edi
.LBB13_41:                              # %._crit_edge177.thread
	callq	puts@PLT
	movl	$.Lstr.32, %edi
	callq	puts@PLT
	movl	$.Lstr.33, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	leaq	144(%rsp), %r12
	movl	$.L.str.12, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	cmpb	$121, (%r12)
	jne	.LBB13_43
# %bb.42:
	movl	20(%rsp), %esi
	movl	16(%rsp), %edx
	movq	%rbx, %rdi
	callq	_Z12print_matrixPfii
	movl	12(%rsp), %edx
	movq	80(%rsp), %rdi                  # 8-byte Reload
	movl	%r13d, %esi
	callq	_Z12print_matrixPfii
	movq	64(%rsp), %rdi                  # 8-byte Reload
	movq	136(%rsp), %r15                 # 8-byte Reload
	movl	%r15d, %esi
	movq	56(%rsp), %r14                  # 8-byte Reload
	movl	%r14d, %edx
	callq	_Z12print_matrixPfii
	movq	48(%rsp), %rdi                  # 8-byte Reload
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_Z12print_matrixPfii
	movq	stdout(%rip), %rdi
	callq	fflush
.LBB13_43:
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rbp, %xmm0
	movsd	.LCPI13_1(%rip), %xmm1          # xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	xorps	%xmm2, %xmm2
	cvtsi2sdq	88(%rsp), %xmm2         # 8-byte Folded Reload
	addsd	%xmm0, %xmm2
	movapd	%xmm2, %xmm4
	xorps	%xmm0, %xmm0
	cvtsi2sdq	160(%rsp), %xmm0        # 8-byte Folded Reload
	xorps	%xmm2, %xmm2
	cvtsi2sdq	168(%rsp), %xmm2        # 8-byte Folded Reload
	mulsd	%xmm1, %xmm0
	addsd	%xmm0, %xmm2
	xorps	%xmm3, %xmm3
	cvtsi2sdq	176(%rsp), %xmm3        # 8-byte Folded Reload
	subsd	%xmm2, %xmm4
	movsd	%xmm4, 32(%rsp)                 # 8-byte Spill
	mulsd	%xmm1, %xmm3
	xorps	%xmm0, %xmm0
	cvtsi2sdq	184(%rsp), %xmm0        # 8-byte Folded Reload
	addsd	%xmm3, %xmm0
	xorps	%xmm2, %xmm2
	cvtsi2sdq	192(%rsp), %xmm2        # 8-byte Folded Reload
	mulsd	%xmm1, %xmm2
	xorps	%xmm1, %xmm1
	cvtsi2sdq	96(%rsp), %xmm1         # 8-byte Folded Reload
	addsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	movl	$.L.str.13, %edi
	movb	$1, %al
	callq	printf
	movl	$.L.str.14, %edi
	movsd	32(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	movq	%rbx, %rdi
	callq	hipHostFree
	movq	80(%rsp), %rdi                  # 8-byte Reload
	callq	hipHostFree
	movq	64(%rsp), %rdi                  # 8-byte Reload
	callq	hipHostFree
	movq	48(%rsp), %rdi                  # 8-byte Reload
	callq	hipHostFree
	movq	128(%rsp), %rdi
	callq	hipFree
	movq	120(%rsp), %rdi
	callq	hipFree
	movq	112(%rsp), %rdi
	callq	hipFree
	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_end13:
	.size	_Z16conv_preparationv, .Lfunc_end13-_Z16conv_preparationv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z18matrix_preparationv
.LCPI14_0:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI14_1:
	.quad	0x3eb0c6f7a0b5ed8d              # double 9.9999999999999995E-7
	.text
	.globl	_Z18matrix_preparationv
	.type	_Z18matrix_preparationv,@function
_Z18matrix_preparationv:                # @_Z18matrix_preparationv
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$10, %edi
	callq	putchar@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.27, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	leaq	8(%rsp), %rsi
	movl	$.L.str.4, %edi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	jne	.LBB14_5
# %bb.1:
	leaq	8(%rsp), %rbx
.LBB14_2:                               # %.preheader97
                                        # =>This Inner Loop Header: Depth=1
	callq	getchar
	cmpl	$10, %eax
	je	.LBB14_4
# %bb.3:                                # %.preheader97
                                        #   in Loop: Header=BB14_2 Depth=1
	cmpl	$-1, %eax
	jne	.LBB14_2
.LBB14_4:                               #   in Loop: Header=BB14_2 Depth=1
	movl	$.Lstr.36, %edi
	callq	puts@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.27, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.4, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	je	.LBB14_2
.LBB14_5:                               # %.preheader96
	movl	$.Lstr.28, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	leaq	12(%rsp), %rsi
	movl	$.L.str.4, %edi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	jne	.LBB14_10
# %bb.6:
	leaq	12(%rsp), %rbx
.LBB14_7:                               # %.preheader95
                                        # =>This Inner Loop Header: Depth=1
	callq	getchar
	cmpl	$10, %eax
	je	.LBB14_9
# %bb.8:                                # %.preheader95
                                        #   in Loop: Header=BB14_7 Depth=1
	cmpl	$-1, %eax
	jne	.LBB14_7
.LBB14_9:                               #   in Loop: Header=BB14_7 Depth=1
	movl	$.Lstr.36, %edi
	callq	puts@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.28, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.4, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	je	.LBB14_7
.LBB14_10:                              # %.preheader94
	movl	$.Lstr.29, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	leaq	4(%rsp), %rsi
	movl	$.L.str.4, %edi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	jne	.LBB14_15
# %bb.11:
	leaq	4(%rsp), %rbx
.LBB14_12:                              # %.preheader93
                                        # =>This Inner Loop Header: Depth=1
	callq	getchar
	cmpl	$10, %eax
	je	.LBB14_14
# %bb.13:                               # %.preheader93
                                        #   in Loop: Header=BB14_12 Depth=1
	cmpl	$-1, %eax
	jne	.LBB14_12
.LBB14_14:                              #   in Loop: Header=BB14_12 Depth=1
	movl	$.Lstr.36, %edi
	callq	puts@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.29, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.4, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	je	.LBB14_12
.LBB14_15:                              # %._crit_edge
	movl	8(%rsp), %ebx
	movl	12(%rsp), %ebp
	movl	%ebp, %eax
	imull	%ebx, %eax
	movslq	%eax, %r13
	shlq	$2, %r13
	movq	%r13, %rdi
	callq	malloc
	movq	%rax, %r15
	movl	4(%rsp), %r14d
	imull	%r14d, %ebp
	movslq	%ebp, %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, %rbp
	imull	%ebx, %r14d
	movslq	%r14d, %r12
	shlq	$2, %r12
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, 112(%rsp)                 # 8-byte Spill
	leaq	56(%rsp), %rbx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	movslq	12(%rsp), %rax
	movslq	4(%rsp), %rsi
	imulq	%rax, %rsi
	shlq	$2, %rsi
	leaq	48(%rsp), %r13
	movq	%r13, %rdi
	callq	hipMalloc
	movslq	8(%rsp), %rax
	movslq	4(%rsp), %rsi
	imulq	%rax, %rsi
	shlq	$2, %rsi
	leaq	40(%rsp), %rdi
	callq	hipMalloc
	movl	8(%rsp), %esi
	movl	12(%rsp), %edx
	movq	%r15, %rdi
	callq	_Z10init_ArrayPfii
	movl	12(%rsp), %esi
	movl	4(%rsp), %edx
	movq	%rbp, %rdi
	callq	_Z10init_ArrayPfii
	movq	(%rbx), %rdi
	movslq	8(%rsp), %rax
	movslq	12(%rsp), %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
	movq	%r15, 32(%rsp)                  # 8-byte Spill
	movq	%r15, %rsi
	movq	%rbp, %r15
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r13), %rdi
	movslq	12(%rsp), %rax
	movslq	4(%rsp), %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
	movq	%rbp, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movl	8(%rsp), %r13d
	leal	31(%r13), %eax
	addl	$62, %r13d
	testl	%eax, %eax
	cmovnsl	%eax, %r13d
	sarl	$5, %r13d
	movl	4(%rsp), %eax
	leal	31(%rax), %ecx
	addl	$62, %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$5, %eax
	shlq	$32, %r13
	orq	%rax, %r13
	xorl	%ebp, %ebp
	leaq	64(%rsp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.LBB14_24
# %bb.16:                               # %.preheader92.lr.ph
	movl	4(%rsp), %ecx
	movl	12(%rsp), %edx
	movslq	%ecx, %rsi
	leaq	(,%rsi,4), %rdi
	xorl	%r8d, %r8d
.LBB14_17:                              # %.preheader92
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB14_19 Depth 2
                                        #       Child Loop BB14_21 Depth 3
	testl	%ecx, %ecx
	jle	.LBB14_23
# %bb.18:                               # %.preheader91.lr.ph
                                        #   in Loop: Header=BB14_17 Depth=1
	movl	%ebp, %r9d
	movq	32(%rsp), %r10                  # 8-byte Reload
	leaq	(%r10,%r9,4), %r9
	movq	%r8, %r10
	imulq	%rsi, %r10
	movq	16(%rsp), %r11                  # 8-byte Reload
	leaq	(%r11,%r10,4), %r10
	movq	%r15, %r14
	xorl	%r12d, %r12d
.LBB14_19:                              # %.preheader91
                                        #   Parent Loop BB14_17 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB14_21 Depth 3
	xorps	%xmm0, %xmm0
	testl	%edx, %edx
	jle	.LBB14_22
# %bb.20:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB14_19 Depth=2
	movq	%r14, %r11
	xorl	%ebx, %ebx
.LBB14_21:                              # %.lr.ph
                                        #   Parent Loop BB14_17 Depth=1
                                        #     Parent Loop BB14_19 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%r9,%rbx,4), %xmm1             # xmm1 = mem[0],zero,zero,zero
	mulss	(%r11), %xmm1
	addss	%xmm1, %xmm0
	incq	%rbx
	addq	%rdi, %r11
	cmpq	%rbx, %rdx
	jne	.LBB14_21
.LBB14_22:                              # %._crit_edge103
                                        #   in Loop: Header=BB14_19 Depth=2
	movss	%xmm0, (%r10,%r12,4)
	incq	%r12
	addq	$4, %r14
	cmpq	%rcx, %r12
	jne	.LBB14_19
.LBB14_23:                              # %._crit_edge105
                                        #   in Loop: Header=BB14_17 Depth=1
	incq	%r8
	addl	%edx, %ebp
	cmpq	%rax, %r8
	jne	.LBB14_17
.LBB14_24:                              # %._crit_edge107
	leaq	64(%rsp), %rbp
	movq	(%rbp), %r14
	movq	8(%rbp), %rax
	movq	%rax, 104(%rsp)                 # 8-byte Spill
	movq	%rbp, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbp), %rax
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	movq	8(%rbp), %rax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	leaq	64(%rsp), %rbp
	movq	%rbp, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbp), %rax
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	movq	8(%rbp), %rbp
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB14_26
# %bb.25:
	movq	56(%rsp), %rdi
	movq	48(%rsp), %rsi
	movq	40(%rsp), %rdx
	movl	8(%rsp), %ecx
	movl	12(%rsp), %r8d
	movl	4(%rsp), %r9d
	callq	_Z22__device_stub__mmatrixPfS_S_iii
.LBB14_26:
	callq	hipDeviceSynchronize
	movq	40(%rsp), %rsi
	movslq	8(%rsp), %rax
	movslq	4(%rsp), %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
	movq	112(%rsp), %rbx                 # 8-byte Reload
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	xorl	%r12d, %r12d
	leaq	64(%rsp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	8(%rsp), %eax
	movl	$.Lstr.31, %edi
	testl	%eax, %eax
	movq	%r14, 80(%rsp)                  # 8-byte Spill
	jle	.LBB14_34
# %bb.27:                               # %.preheader.lr.ph
	movl	4(%rsp), %ecx
	movaps	.LCPI14_0(%rip), %xmm0          # xmm0 = [NaN,NaN,NaN,NaN]
	movsd	.LCPI14_1(%rip), %xmm1          # xmm1 = mem[0],zero
	xorl	%edx, %edx
.LBB14_28:                              # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB14_31 Depth 2
	testl	%ecx, %ecx
	jle	.LBB14_33
# %bb.29:                               # %.lr.ph109
                                        #   in Loop: Header=BB14_28 Depth=1
	movl	%r12d, %r8d
	movq	16(%rsp), %rsi                  # 8-byte Reload
	leaq	(%rsi,%r8,4), %rsi
	leaq	(%rbx,%r8,4), %r8
	xorl	%r9d, %r9d
.LBB14_31:                              #   Parent Loop BB14_28 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r8,%r9,4), %xmm2              # xmm2 = mem[0],zero,zero,zero
	subss	(%rsi,%r9,4), %xmm2
	andps	%xmm0, %xmm2
	cvtss2sd	%xmm2, %xmm2
	ucomisd	%xmm1, %xmm2
	jae	.LBB14_32
# %bb.30:                               #   in Loop: Header=BB14_31 Depth=2
	incq	%r9
	cmpq	%r9, %rcx
	jne	.LBB14_31
.LBB14_33:                              # %._crit_edge110
                                        #   in Loop: Header=BB14_28 Depth=1
	incq	%rdx
	addl	%ecx, %r12d
	cmpq	%rax, %rdx
	jne	.LBB14_28
.LBB14_34:
	movq	%rbp, %r14
	jmp	.LBB14_35
.LBB14_32:
	movq	%rbp, %r14
	movl	$.Lstr.30, %edi
.LBB14_35:                              # %._crit_edge112
	leaq	64(%rsp), %r13
	movq	(%r13), %rbp
	movq	8(%r13), %r12
	callq	puts@PLT
	movl	$.Lstr.32, %edi
	callq	puts@PLT
	movl	$.Lstr.33, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.12, %edi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	cmpb	$121, (%r13)
	jne	.LBB14_37
# %bb.36:
	movl	8(%rsp), %esi
	movl	12(%rsp), %edx
	movq	32(%rsp), %rdi                  # 8-byte Reload
	callq	_Z12print_matrixPfii
	movl	12(%rsp), %esi
	movl	4(%rsp), %edx
	movq	%r15, %rdi
	callq	_Z12print_matrixPfii
	movl	8(%rsp), %esi
	movl	4(%rsp), %edx
	movq	16(%rsp), %rdi                  # 8-byte Reload
	callq	_Z12print_matrixPfii
	movl	8(%rsp), %esi
	movl	4(%rsp), %edx
	movq	%rbx, %rdi
	callq	_Z12print_matrixPfii
	movq	stdout(%rip), %rdi
	callq	fflush
.LBB14_37:
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r12, %xmm0
	movsd	.LCPI14_1(%rip), %xmm1          # xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	xorps	%xmm2, %xmm2
	cvtsi2sd	%rbp, %xmm2
	addsd	%xmm0, %xmm2
	movapd	%xmm2, %xmm4
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r14, %xmm0
	xorps	%xmm2, %xmm2
	cvtsi2sdq	88(%rsp), %xmm2         # 8-byte Folded Reload
	mulsd	%xmm1, %xmm0
	addsd	%xmm0, %xmm2
	cvtsi2sdq	24(%rsp), %xmm3         # 8-byte Folded Reload
	subsd	%xmm2, %xmm4
	movsd	%xmm4, 24(%rsp)                 # 8-byte Spill
	mulsd	%xmm1, %xmm3
	xorps	%xmm0, %xmm0
	cvtsi2sdq	96(%rsp), %xmm0         # 8-byte Folded Reload
	addsd	%xmm3, %xmm0
	xorps	%xmm2, %xmm2
	cvtsi2sdq	104(%rsp), %xmm2        # 8-byte Folded Reload
	mulsd	%xmm1, %xmm2
	xorps	%xmm1, %xmm1
	cvtsi2sdq	80(%rsp), %xmm1         # 8-byte Folded Reload
	addsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	movl	$.L.str.13, %edi
	movb	$1, %al
	callq	printf
	movl	$.L.str.14, %edi
	movsd	24(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	movq	32(%rsp), %rdi                  # 8-byte Reload
	callq	hipHostFree
	movq	%r15, %rdi
	callq	hipHostFree
	movq	16(%rsp), %rdi                  # 8-byte Reload
	callq	hipHostFree
	movq	%rbx, %rdi
	callq	hipHostFree
	movq	56(%rsp), %rdi
	callq	hipFree
	movq	48(%rsp), %rdi
	callq	hipFree
	movq	40(%rsp), %rdi
	callq	hipFree
	addq	$120, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end14:
	.size	_Z18matrix_preparationv, .Lfunc_end14-_Z18matrix_preparationv
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -16
	leaq	12(%rsp), %rbx
.LBB15_1:                               # %.backedge
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB15_2 Depth 2
	movl	$10, %edi
	callq	putchar@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.46, %edi
	callq	puts@PLT
	movl	$.Lstr.38, %edi
	callq	puts@PLT
	movl	$.Lstr.45, %edi
	callq	puts@PLT
	movl	$.Lstr.40, %edi
	callq	puts@PLT
	movl	$.Lstr.41, %edi
	callq	puts@PLT
	movl	$.Lstr.42, %edi
	callq	puts@PLT
	movl	$.Lstr.43, %edi
	callq	puts@PLT
	movl	$.Lstr.44, %edi
	callq	puts@PLT
	movl	$.Lstr.45, %edi
	callq	puts@PLT
	movl	$.Lstr.46, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.Lstr.47, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	movl	$.L.str.4, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	testl	%eax, %eax
	je	.LBB15_2
# %bb.5:                                #   in Loop: Header=BB15_1 Depth=1
	movl	12(%rsp), %eax
	decl	%eax
	cmpl	$4, %eax
	ja	.LBB15_13
# %bb.6:                                #   in Loop: Header=BB15_1 Depth=1
	jmpq	*.LJTI15_0(,%rax,8)
.LBB15_7:                               #   in Loop: Header=BB15_1 Depth=1
	callq	_Z18matrix_preparationv
	jmp	.LBB15_8
.LBB15_2:                               # %.preheader
                                        #   Parent Loop BB15_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	getchar
	cmpl	$10, %eax
	je	.LBB15_4
# %bb.3:                                # %.preheader
                                        #   in Loop: Header=BB15_2 Depth=2
	cmpl	$-1, %eax
	jne	.LBB15_2
.LBB15_4:                               #   in Loop: Header=BB15_1 Depth=1
	movl	$.Lstr.50, %edi
	callq	puts@PLT
	jmp	.LBB15_1
.LBB15_10:                              #   in Loop: Header=BB15_1 Depth=1
	callq	_Z20tranpose_preparationv
	jmp	.LBB15_8
.LBB15_11:                              #   in Loop: Header=BB15_1 Depth=1
	callq	_Z18sparse_preparationv
	jmp	.LBB15_8
.LBB15_9:                               #   in Loop: Header=BB15_1 Depth=1
	callq	_Z16conv_preparationv
	jmp	.LBB15_8
.LBB15_13:                              #   in Loop: Header=BB15_1 Depth=1
	movl	$.Lstr.49, %edi
	callq	puts@PLT
.LBB15_8:                               # %.backedge
                                        #   in Loop: Header=BB15_1 Depth=1
	movq	stdout(%rip), %rdi
	callq	fflush
	jmp	.LBB15_1
.LBB15_12:                              # %.thread
	movl	$.Lstr.48, %edi
	callq	puts@PLT
	movq	stdout(%rip), %rdi
	callq	fflush
	xorl	%eax, %eax
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end15:
	.size	main, .Lfunc_end15-main
	.cfi_endproc
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
.LJTI15_0:
	.quad	.LBB15_7
	.quad	.LBB15_9
	.quad	.LBB15_10
	.quad	.LBB15_11
	.quad	.LBB15_12
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB16_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB16_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7mmatrixPfS_S_iii, %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	$_Z13gpuMatrixConvPfS_S_iiiiii, %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	$_Z17gpuMatrixTranposePfS_ii, %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	$_Z11gpuMVSparsePfS_PiS0_S_i, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %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_end16:
	.size	__hip_module_ctor, .Lfunc_end16-__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	.LBB17_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
.LBB17_2:
	retq
.Lfunc_end17:
	.size	__hip_module_dtor, .Lfunc_end17-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"%f "
	.size	.L.str, 4

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"%d "
	.size	.L.str.2, 4

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

	.type	_Z13gpuMatrixConvPfS_S_iiiiii,@object # @_Z13gpuMatrixConvPfS_S_iiiiii
	.globl	_Z13gpuMatrixConvPfS_S_iiiiii
	.p2align	3, 0x0
_Z13gpuMatrixConvPfS_S_iiiiii:
	.quad	_Z28__device_stub__gpuMatrixConvPfS_S_iiiiii
	.size	_Z13gpuMatrixConvPfS_S_iiiiii, 8

	.type	_Z17gpuMatrixTranposePfS_ii,@object # @_Z17gpuMatrixTranposePfS_ii
	.globl	_Z17gpuMatrixTranposePfS_ii
	.p2align	3, 0x0
_Z17gpuMatrixTranposePfS_ii:
	.quad	_Z32__device_stub__gpuMatrixTranposePfS_ii
	.size	_Z17gpuMatrixTranposePfS_ii, 8

	.type	_Z11gpuMVSparsePfS_PiS0_S_i,@object # @_Z11gpuMVSparsePfS_PiS0_S_i
	.globl	_Z11gpuMVSparsePfS_PiS0_S_i
	.p2align	3, 0x0
_Z11gpuMVSparsePfS_PiS0_S_i:
	.quad	_Z26__device_stub__gpuMVSparsePfS_PiS0_S_i
	.size	_Z11gpuMVSparsePfS_PiS0_S_i, 8

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

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Error en: %f %f\n"
	.size	.L.str.7, 17

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	" %c"
	.size	.L.str.12, 4

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"Duration of the CPU: %f\n"
	.size	.L.str.13, 25

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"Duration of the GPU: %f\n"
	.size	.L.str.14, 25

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"Error: %f %f\n"
	.size	.L.str.19, 14

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z7mmatrixPfS_S_iii"
	.size	.L__unnamed_1, 20

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z13gpuMatrixConvPfS_S_iiiiii"
	.size	.L__unnamed_2, 30

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

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z11gpuMVSparsePfS_PiS0_S_i"
	.size	.L__unnamed_4, 28

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

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

	.type	.Lstr.12,@object                # @str.12
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr.12:
	.asciz	"Do you want to print the differents matrix:"
	.size	.Lstr.12, 44

	.type	.Lstr.17,@object                # @str.17
.Lstr.17:
	.asciz	"Introduce the colums of A:"
	.size	.Lstr.17, 27

	.type	.Lstr.18,@object                # @str.18
.Lstr.18:
	.asciz	"Introduce the rows and colums of B:"
	.size	.Lstr.18, 36

	.type	.Lstr.23,@object                # @str.23
.Lstr.23:
	.asciz	"You must introduce again the numbers, the matrix (rows and colums) A have to be higher than B"
	.size	.Lstr.23, 94

	.type	.Lstr.27,@object                # @str.27
.Lstr.27:
	.asciz	"Introduce the rows of A:"
	.size	.Lstr.27, 25

	.type	.Lstr.28,@object                # @str.28
.Lstr.28:
	.asciz	"Introduce the columns of A:"
	.size	.Lstr.28, 28

	.type	.Lstr.29,@object                # @str.29
.Lstr.29:
	.asciz	"Introduce The columns of B:"
	.size	.Lstr.29, 28

	.type	.Lstr.30,@object                # @str.30
.Lstr.30:
	.asciz	"Comparing the output for each implementation.. Incorrect!"
	.size	.Lstr.30, 58

	.type	.Lstr.31,@object                # @str.31
.Lstr.31:
	.asciz	"Comparing the output for each implementation.. Correct!"
	.size	.Lstr.31, 56

	.type	.Lstr.32,@object                # @str.32
.Lstr.32:
	.asciz	"Do you want to print the matrix:"
	.size	.Lstr.32, 33

	.type	.Lstr.33,@object                # @str.33
.Lstr.33:
	.asciz	"YES: y  or NO: n"
	.size	.Lstr.33, 17

	.type	.Lstr.36,@object                # @str.36
.Lstr.36:
	.asciz	"You don't introduce a valid number, please do it again."
	.size	.Lstr.36, 56

	.type	.Lstr.38,@object                # @str.38
.Lstr.38:
	.asciz	"* Select the operation you want to do:   *"
	.size	.Lstr.38, 43

	.type	.Lstr.40,@object                # @str.40
.Lstr.40:
	.asciz	"* 1. Matrix Multiplication               *"
	.size	.Lstr.40, 43

	.type	.Lstr.41,@object                # @str.41
.Lstr.41:
	.asciz	"* 2. Matrix Convection                   *"
	.size	.Lstr.41, 43

	.type	.Lstr.42,@object                # @str.42
.Lstr.42:
	.asciz	"* 3. Matrix Transpose                    *"
	.size	.Lstr.42, 43

	.type	.Lstr.43,@object                # @str.43
.Lstr.43:
	.asciz	"* 4. Matrix-Vector Sparse                *"
	.size	.Lstr.43, 43

	.type	.Lstr.44,@object                # @str.44
.Lstr.44:
	.asciz	"* 5. Exit                                *"
	.size	.Lstr.44, 43

	.type	.Lstr.45,@object                # @str.45
.Lstr.45:
	.asciz	"*                                        *"
	.size	.Lstr.45, 43

	.type	.Lstr.46,@object                # @str.46
.Lstr.46:
	.asciz	"******************************************"
	.size	.Lstr.46, 43

	.type	.Lstr.47,@object                # @str.47
.Lstr.47:
	.asciz	"Introduce the number of the operation:"
	.size	.Lstr.47, 39

	.type	.Lstr.48,@object                # @str.48
.Lstr.48:
	.asciz	"Successful Exit"
	.size	.Lstr.48, 16

	.type	.Lstr.49,@object                # @str.49
.Lstr.49:
	.asciz	"You dont select any option, please do it again"
	.size	.Lstr.49, 47

	.type	.Lstr.50,@object                # @str.50
.Lstr.50:
	.asciz	"You don't introduce a valid option, please do it again."
	.size	.Lstr.50, 56

	.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 _Z22__device_stub__mmatrixPfS_S_iii
	.addrsig_sym _Z28__device_stub__gpuMatrixConvPfS_S_iiiiii
	.addrsig_sym _Z32__device_stub__gpuMatrixTranposePfS_ii
	.addrsig_sym _Z26__device_stub__gpuMVSparsePfS_PiS0_S_i
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z7mmatrixPfS_S_iii
	.addrsig_sym _Z13gpuMatrixConvPfS_S_iiiiii
	.addrsig_sym _Z17gpuMatrixTranposePfS_ii
	.addrsig_sym _Z11gpuMVSparsePfS_PiS0_S_i
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z7mmatrixPfS_S_iii     ; -- Begin function _Z7mmatrixPfS_S_iii
	.globl	_Z7mmatrixPfS_S_iii
	.p2align	8
	.type	_Z7mmatrixPfS_S_iii,@function
_Z7mmatrixPfS_S_iii:                    ; @_Z7mmatrixPfS_S_iii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b128 s[4:7], s[0:1], 0x18
	v_and_b32_e32 v2, 0x3ff, v0
	v_bfe_u32 v3, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[0:1], null, s14, s2, v[2:3]
	v_mad_u64_u32 v[1:2], null, s15, s3, v[3:4]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_u32_e32 vcc_lo, s6, v0
	v_cmp_gt_u32_e64 s2, s4, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s2, vcc_lo
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_6
; %bb.1:                                ; %.preheader
	s_clause 0x1
	s_load_b128 s[8:11], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
	s_cmp_lt_i32 s5, 1
	s_cbranch_scc1 .LBB0_4
; %bb.2:                                ; %.lr.ph
	v_dual_mov_b32 v3, 0 :: v_dual_mov_b32 v4, v0
	v_mul_lo_u32 v2, v1, s5
	s_delay_alu instid0(VALU_DEP_2)
	v_mov_b32_e32 v6, v3
.LBB0_3:                                ; =>This Inner Loop Header: Depth=1
	v_mov_b32_e32 v5, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_lshlrev_b64 v[7:8], 2, v[2:3]
	v_add_nc_u32_e32 v2, 1, v2
	s_add_i32 s5, s5, -1
	s_cmp_eq_u32 s5, 0
	v_lshlrev_b64 v[9:10], 2, v[4:5]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v7, vcc_lo, s8, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s9, v8, vcc_lo
	v_add_nc_u32_e32 v4, s6, v4
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_u32 v9, vcc_lo, s10, v9
	v_add_co_ci_u32_e32 v10, vcc_lo, s11, v10, vcc_lo
	global_load_b32 v5, v[7:8], off
	global_load_b32 v7, v[9:10], off
	s_waitcnt vmcnt(0)
	v_fmac_f32_e32 v6, v5, v7
	s_cbranch_scc0 .LBB0_3
	s_branch .LBB0_5
.LBB0_4:
	v_mov_b32_e32 v6, 0
.LBB0_5:                                ; %Flow54
	v_mad_u64_u32 v[2:3], null, v1, s6, v[0:1]
	v_mov_b32_e32 v3, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v6, off
.LBB0_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7mmatrixPfS_S_iii
		.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 11
		.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	_Z7mmatrixPfS_S_iii, .Lfunc_end0-_Z7mmatrixPfS_S_iii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 328
; NumSgprs: 18
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 11
; 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	_Z13gpuMatrixConvPfS_S_iiiiii ; -- Begin function _Z13gpuMatrixConvPfS_S_iiiiii
	.globl	_Z13gpuMatrixConvPfS_S_iiiiii
	.p2align	8
	.type	_Z13gpuMatrixConvPfS_S_iiiiii,@function
_Z13gpuMatrixConvPfS_S_iiiiii:          ; @_Z13gpuMatrixConvPfS_S_iiiiii
; %bb.0:
	s_clause 0x2
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b128 s[4:7], s[0:1], 0x1c
	s_load_b32 s16, s[0:1], 0x2c
	v_bfe_u32 v3, v0, 10, 10
	v_and_b32_e32 v2, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	v_mad_u64_u32 v[0:1], null, s15, s3, v[3:4]
	s_mul_i32 s14, s14, s2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v1, s14, v2
	v_cmp_gt_u32_e32 vcc_lo, s7, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_gt_u32_e64 s2, s16, v1
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB1_9
; %bb.1:                                ; %.preheader35
	s_clause 0x1
	s_load_b128 s[8:11], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
	s_cmp_lt_i32 s5, 1
	s_cbranch_scc1 .LBB1_7
; %bb.2:                                ; %.preheader.lr.ph
	v_mul_lo_u32 v4, s4, v0
	v_mov_b32_e32 v3, 0
	s_mov_b32 s3, 0
	s_cmp_gt_i32 s6, 0
	s_mov_b32 s2, s3
	s_cselect_b32 s7, -1, 0
	s_delay_alu instid0(VALU_DEP_2)
	v_add3_u32 v5, v2, v4, s14
	v_mov_b32_e32 v4, 0
	s_mov_b32 s14, s3
.LBB1_3:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_5 Depth 2
	s_and_not1_b32 vcc_lo, exec_lo, s7
	s_cbranch_vccnz .LBB1_6
; %bb.4:                                ; %.lr.ph
                                        ;   in Loop: Header=BB1_3 Depth=1
	s_lshl_b64 s[12:13], s[2:3], 2
	v_mov_b32_e32 v2, v5
	s_waitcnt lgkmcnt(0)
	s_add_u32 s12, s10, s12
	s_addc_u32 s13, s11, s13
	s_mov_b32 s15, s6
.LBB1_5:                                ;   Parent Loop BB1_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_lshlrev_b64 v[6:7], 2, v[2:3]
	s_load_b32 s17, s[12:13], 0x0
	s_add_i32 s15, s15, -1
	v_add_nc_u32_e32 v2, 1, v2
	s_add_u32 s12, s12, 4
	s_addc_u32 s13, s13, 0
	v_add_co_u32 v6, vcc_lo, s8, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, s9, v7, vcc_lo
	s_cmp_eq_u32 s15, 0
	global_load_b32 v6, v[6:7], off
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_fmac_f32_e32 v4, s17, v6
	s_cbranch_scc0 .LBB1_5
.LBB1_6:                                ; %._crit_edge
                                        ;   in Loop: Header=BB1_3 Depth=1
	v_add_nc_u32_e32 v5, s4, v5
	s_add_i32 s14, s14, 1
	s_add_i32 s2, s2, s5
	s_cmp_eq_u32 s14, s5
	s_cbranch_scc0 .LBB1_3
	s_branch .LBB1_8
.LBB1_7:
	v_mov_b32_e32 v4, 0
.LBB1_8:                                ; %._crit_edge40
	v_mad_u64_u32 v[2:3], null, v0, s16, v[1:2]
	v_mov_b32_e32 v3, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v4, off
.LBB1_9:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z13gpuMatrixConvPfS_S_iiiiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 8
		.amdhsa_next_free_sgpr 18
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z13gpuMatrixConvPfS_S_iiiiii, .Lfunc_end1-_Z13gpuMatrixConvPfS_S_iiiiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 380
; NumSgprs: 20
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 20
; NumVGPRsForWavesPerEU: 8
; 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	_Z17gpuMatrixTranposePfS_ii ; -- Begin function _Z17gpuMatrixTranposePfS_ii
	.globl	_Z17gpuMatrixTranposePfS_ii
	.p2align	8
	.type	_Z17gpuMatrixTranposePfS_ii,@function
_Z17gpuMatrixTranposePfS_ii:            ; @_Z17gpuMatrixTranposePfS_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b64 s[4:5], s[0:1], 0x10
	v_bfe_u32 v2, v0, 10, 10
	v_and_b32_e32 v3, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[0:1], null, s15, s3, v[2:3]
	v_mad_u64_u32 v[1:2], null, s14, s2, v[3:4]
	v_cmp_gt_u32_e32 vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_gt_u32_e64 s2, s5, v1
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB2_2
; %bb.1:
	s_load_b128 s[0:3], s[0:1], 0x0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, v0, s5, v[1:2]
	v_ashrrev_i32_e32 v3, 31, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s0, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
	global_load_b32 v4, v[2:3], off
	v_mad_u64_u32 v[2:3], null, v1, s4, v[0:1]
	v_ashrrev_i32_e32 v3, 31, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[2:3]
	v_add_co_u32 v0, vcc_lo, s2, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v1, vcc_lo
	s_waitcnt vmcnt(0)
	global_store_b32 v[0:1], v4, off
.LBB2_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17gpuMatrixTranposePfS_ii
		.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 5
		.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	_Z17gpuMatrixTranposePfS_ii, .Lfunc_end2-_Z17gpuMatrixTranposePfS_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 232
; NumSgprs: 18
; NumVgprs: 5
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 5
; 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	_Z11gpuMVSparsePfS_PiS0_S_i ; -- Begin function _Z11gpuMVSparsePfS_PiS0_S_i
	.globl	_Z11gpuMVSparsePfS_PiS0_S_i
	.p2align	8
	.type	_Z11gpuMVSparsePfS_PiS0_S_i,@function
_Z11gpuMVSparsePfS_PiS0_S_i:            ; @_Z11gpuMVSparsePfS_PiS0_S_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b32 s3, s[0:1], 0x28
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_u32_e64 s3, v1
	s_cbranch_execz .LBB3_4
; %bb.1:
	s_load_b256 s[4:11], s[0:1], 0x0
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s8, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s9, v3, vcc_lo
	global_load_b64 v[0:1], v[0:1], off
	s_waitcnt vmcnt(0)
	v_cmp_lt_i32_e32 vcc_lo, v0, v1
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB3_4
; %bb.2:                                ; %.lr.ph
	s_load_b64 s[0:1], s[0:1], 0x20
	v_ashrrev_i32_e32 v5, 31, v0
	v_mov_b32_e32 v4, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[6:7], 2, v[4:5]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s0, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
	v_add_co_u32 v4, vcc_lo, s4, v6
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v7, vcc_lo
	global_load_b32 v8, v[2:3], off
	v_add_co_u32 v6, vcc_lo, s10, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, s11, v7, vcc_lo
	s_mov_b32 s1, 0
.LBB3_3:                                ; =>This Inner Loop Header: Depth=1
	global_load_b32 v9, v[6:7], off
	v_add_nc_u32_e32 v0, 1, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_i32_e64 s0, v0, v1
	s_or_b32 s1, s0, s1
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v10, 31, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[9:10], 2, v[9:10]
	v_add_co_u32 v9, vcc_lo, s6, v9
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v10, vcc_lo, s7, v10, vcc_lo
	global_load_b32 v11, v[4:5], off
	global_load_b32 v9, v[9:10], off
	v_add_co_u32 v4, vcc_lo, v4, 4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	v_add_co_u32 v6, vcc_lo, v6, 4
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v7, vcc_lo
	s_waitcnt vmcnt(0)
	v_fmac_f32_e32 v8, v11, v9
	global_store_b32 v[2:3], v8, off
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB3_3
.LBB3_4:                                ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11gpuMVSparsePfS_PiS0_S_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 12
		.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	_Z11gpuMVSparsePfS_PiS0_S_i, .Lfunc_end3-_Z11gpuMVSparsePfS_PiS0_S_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 352
; NumSgprs: 18
; NumVgprs: 12
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 12
; Occupancy: 16
; WaveLimiterHint : 1
; 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:         28
        .size:           4
        .value_kind:     by_value
      - .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:           _Z7mmatrixPfS_S_iii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z7mmatrixPfS_S_iii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     11
    .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
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     by_value
      - .offset:         44
        .size:           4
        .value_kind:     by_value
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z13gpuMatrixConvPfS_S_iiiiii
    .private_segment_fixed_size: 0
    .sgpr_count:     20
    .sgpr_spill_count: 0
    .symbol:         _Z13gpuMatrixConvPfS_S_iiiiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .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:         20
        .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:           _Z17gpuMatrixTranposePfS_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z17gpuMatrixTranposePfS_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     5
    .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
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .offset:         40
        .size:           4
        .value_kind:     by_value
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11gpuMVSparsePfS_PiS0_S_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11gpuMVSparsePfS_PiS0_S_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     12
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
