#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <cuda_runtime.h>


#define NOISE 0.01
#define GET_RAND ((double)rand()/(10.0 * (double)RAND_MAX)) - 0.05
#define  SIZE 10000
typedef double VECTOR[SIZE];
__device__ int n;
__device__ int count;

int BLOCK_SIZE = 16;
__device__ struct node_coord {
    double x;
    double y;
}node_coord;

double** alloc_mem_matrix (int n)
{
    double **matrix = NULL;
    matrix = (double**) calloc (n, sizeof(double*));
    for(int i = 0; i < n; i++)
    {
        matrix[i] = (double*) calloc (n, sizeof(double));
    }
    return matrix;
}


void printK(double *K, int m){
    double *host_K = (double*) malloc(m * m * sizeof(double));
    cudaMemcpy(host_K, K, m * m * sizeof(double), cudaMemcpyDeviceToHost);
    printf("\n Device K ---------------------------------- \n");
    int id = 0;
    for(int i=0; i<m; i++){
        for(int j=0; j<m; j++){
            printf("(%5.5lf) ", host_K[id]);
            id++;
        }
        printf("\n");
    }
}

__global__ void gpu_matrix_mult(double *a,double *b, double *c, int m, int n, int k)
{ 
    int row = blockIdx.y * blockDim.y + threadIdx.y; 
    int col = blockIdx.x * blockDim.x + threadIdx.x;
    double sum = 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;
    }
} 

int _ConvertSMVer2Cores(int major, int minor) {

    typedef struct {
        int SM; 
        int Cores;
    } sSMtoCores;

    sSMtoCores nGpuArchCoresPerSM[] = {
        { 0x20, 32 }, // Fermi Generation (SM 2.0) GF100 class
        { 0x21, 48 }, // Fermi Generation (SM 2.1) GF10x class
        { 0x30, 192}, // Kepler Generation (SM 3.0) GK10x class
        { 0x32, 192}, // Kepler Generation (SM 3.2) GK10x class
        { 0x35, 192}, // Kepler Generation (SM 3.5) GK11x class
        { 0x37, 192}, // Kepler Generation (SM 3.7) GK21x class
        { 0x50, 128}, // Maxwell Generation (SM 5.0) GM10x class
        { 0x52, 128}, // Maxwell Generation (SM 5.2) GM20x class
        { 0x53, 128}, // Maxwell Generation (SM 5.3) GM20x class
        { 0x60, 64 }, // Pascal Generation (SM 6.0) GP100 class
        { 0x61, 128}, // Pascal Generation (SM 6.1) GP10x class
        { 0x62, 128}, // Pascal Generation (SM 6.2) GP10x class
        {   -1, -1 }
    };
    int index = 0;

    while (nGpuArchCoresPerSM[index].SM != -1) {
        if (nGpuArchCoresPerSM[index].SM == ((major << 4) + minor)) {
            return nGpuArchCoresPerSM[index].Cores;
        }
        index++;
    }
    return nGpuArchCoresPerSM[index-1].Cores;
}

int getNumThreads(){
    int num_threads = 0;
    int deviceCount;
    cudaGetDeviceCount(&deviceCount);
    for (int device = 0; device < deviceCount; device++) 
    {
        cudaDeviceProp deviceProp;
        cudaGetDeviceProperties(&deviceProp, device);
        int curr_t =  _ConvertSMVer2Cores(deviceProp.major, deviceProp.minor);
        if(curr_t > num_threads)
            num_threads = curr_t;
    }
    return(num_threads);
}

void print_matrix (char *msg, double** matrix, int n)
{
    printf("\n --------------------- %s --------------------- \n", msg);
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            printf("%4.9lf ", matrix[i][j]);
        }
        printf("\n");
    }
    printf("\n");
    printf("\n");
}


void print_1d_matrix (char *msg, double* matrix, int n)
{
    printf("\n --------------------- %s --------------------- \n", msg);
    int id = 0;
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            printf("%4.9lf ", matrix[id++]);
        }
        printf("\n");
    }
    printf("\n");
    printf("\n");
}

void print_points (struct node_coord *grid_points, int m)
{
    int id = 0;
    printf("\n --------------------- Printing grid coordinates --------------------- \n");
    for(int i = 0; i < m; i++)
    {
        for(int j = 0; j < m; j++)
        {
            printf("(%3.5lf %3.5lf) ", grid_points[id].x, grid_points[id].y);
            id++;
        }
        printf("\n");
    }

}

void print_data (double *data_points, int n)
{
    printf("\n --------------------- Printing data points --------------------- \n");
    for(int id = 0; id < n; id++)
    {
        printf ("%3.5lf  ", data_points[id]);
    }
    printf("\n");

}
void initialize_points (struct node_coord *grid_points, int m, double h)
{
    int id = 0;
    for(int i = 1; i <= m; i++)
    {
        for(int j = 1; j <= m; j++)
        {
            grid_points[id].x = i * h;
            grid_points[id].y = j * h;
            id++;
        }
    }
}

void calculate_observed_data (double **observed_data_points, struct node_coord *grid_points, int n)
{
    for(int id = 0; id < n; id++)
    {
        observed_data_points[0][id] = 1 - (((grid_points[id].x - 0.5) * (grid_points[id].x - 0.5)) +
                       ((grid_points[id].y - 0.5) * (grid_points[id].y - 0.5))) + GET_RAND;
    }

}


__global__ void compute_K_matrix_gpu (int num_threads, double *K, struct node_coord *grid_points, int m)
{
    n = m * m;
    double temp_x, temp_y;

    for(int i = threadIdx.x; i < n; i+= num_threads)
    {
        for (int j = 0; j < n; j++)
        {
            temp_x = (grid_points[i].x - grid_points[j].x) * (grid_points[i].x - grid_points[j].x);
            temp_y = (grid_points[i].y - grid_points[j].y) * (grid_points[i].y - grid_points[j].y);
            K[i*n + j] = exp(-1 * (temp_x + temp_y));
            if (i == j)
                K[i*n + j] += NOISE;
        }
    }
}


__device__ void get_total_sum(double *partial_sum, int dummy) {
    if(threadIdx.x == 0) {
        count = dummy;
        if(count % 2 != 0)
            count++;
        for(int i = 1; i < count; i++)
            partial_sum[0] += partial_sum[i];
    }
}

__global__ void device_run_chol(int num_threads, double *K, double *L, double *partial_sum, int n) {
    for(int k = 0; k < n; k++) {
        for(int i = 0; i < n; i++) {
            if(i == k) {
                partial_sum[threadIdx.x] = 0;
                for(int j = threadIdx.x; j < k; j += num_threads) {
                    partial_sum[threadIdx.x] = partial_sum[threadIdx.x] + pow((L[k * n + j]), 2);
                }
                __syncthreads();
                get_total_sum(partial_sum, (num_threads<k)?num_threads:k);
                if(threadIdx.x == 0) {
                    L[i * n + i] = sqrt(K[k * n + k] - partial_sum[0]);
                }
            } else if( i > k) {
                partial_sum[threadIdx.x] = 0;
                for(int j = threadIdx.x; j < k; j += num_threads) {
                    partial_sum[threadIdx.x] = partial_sum[threadIdx.x] + L[i * n + j] * L[k * n + j];
                }
                __syncthreads();
                get_total_sum(partial_sum, (num_threads<k)?num_threads:k);
                if(threadIdx.x == 0) {
                    L[i * n + k] = K[i * n + k] - partial_sum[0];
                    L[i * n + k] /= L[k * n + k];
                }
            } else {
                if(threadIdx.x == 0)
                    L[i * n + k] = 0;
            }
            __syncthreads();
        }
    }
}


void compute_matrix_part_1 (double** matrix, int row_beg, int col_beg, int row_end, int col_end, int mid, int n)
{
    double *res1 = (double*) malloc((mid + 1) * sizeof(double));
    for(int j = col_beg + mid + 1; j < col_end + 1; ++j)
    {
        for(int i = row_beg; i < row_beg + mid + 1; ++i)
        {
            res1[i - row_beg] = 0;
            for(int k = 0; k < mid + 1; ++k)
            {
                res1[i - row_beg] += -1 * matrix[i][col_beg + k] * matrix[row_beg + k][j];
            }
        }
        for(int l = 0; l < mid + 1; ++l)
        {
            matrix[row_beg + l][j] = res1[l];
        }
    }
}

void compute_matrix_part_2 (double** matrix, int row_beg, int col_beg, int row_end, int col_end, int mid, int n)
{
    double *res2 = (double*) malloc ((n - mid - 1) * sizeof(double));
    for(int i = row_beg; i < row_beg + mid + 1; ++i)
    {
        for(int j = col_beg + mid + 1; j < col_beg + n; ++j)
        {
            res2 [j - col_beg - mid - 1] = 0;
            for(int k = 0; k < n - mid - 1; ++k)
            {
                res2[j - col_beg - mid - 1] += matrix[i][col_beg + mid + 1 + k] * matrix[row_beg + mid + 1 + k][j];
            }
        }
        for(int l = 0; l < n - mid - 1; ++l)
        {
            matrix[i][col_beg + mid + 1 + l] = res2[l];
        }
    }
}

void compute_inverse (double** matrix, int row_beg, int col_beg, int row_end, int col_end)
{
    int n = row_end - row_beg + 1;

    if(n == 1)
    {
        matrix[row_beg][col_beg] = 1 / matrix[row_beg][col_beg];
        return;
    }

    int mid = (n - 1) / 2;

    compute_inverse(matrix, row_beg, col_beg, row_beg + mid, col_beg + mid);
    compute_inverse(matrix, row_beg + mid + 1, col_beg + mid + 1, row_end, col_end);
    compute_matrix_part_1 (matrix, row_beg, col_beg, row_end, col_end, mid, n);
    compute_matrix_part_2 (matrix, row_beg, col_beg, row_end, col_end, mid, n);
}


void compute_k (double **k, struct node_coord *rstar, struct node_coord *grid_points, int n)
{
    double temp_x, temp_y;

    for (int i = 0; i < n; i++)
    {
        temp_x = (grid_points[i].x - rstar[0].x) * (grid_points[i].x - rstar[0].x);
        temp_y = (grid_points[i].y - rstar[0].y) * (grid_points[i].y - rstar[0].y);
        k[0][i] = exp(-1 * (temp_x + temp_y));
    }
}

void convert_array (double ** host_K, double * matrix, int n, bool convert_2d)
{
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            if (convert_2d)
                host_K[i][j] = matrix[i*n + j];
            else
                matrix[i*n + j] = host_K[i][j];

        }
    }
}

void get_transpose (double ** host_L, double **host_U, int n)
{

    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            host_U[j][i] = host_L[i][j];
        }
    }
}

void duplicate_matrix (double** input_matrix, double** output_matrix, int n)
{
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            output_matrix[i][j] = input_matrix[i][j];
        }
    }
}

double run_solver (double *L, double *k_out, double *host_obs_data, int n, int num_threads)
{
    unsigned int grid_rows = (n + BLOCK_SIZE - 1) / BLOCK_SIZE;
    unsigned int grid_cols = (1 + BLOCK_SIZE - 1) / BLOCK_SIZE;
    dim3 dimGrid(grid_cols, grid_rows);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);
    double **host_L = alloc_mem_matrix (n);
    double **host_U = alloc_mem_matrix (n);
    double **host_U_trans = alloc_mem_matrix (n);
    double *L_host = (double*) malloc(n * n *sizeof(double));
    cudaMemcpy(L_host, L, n * n * sizeof(double), cudaMemcpyDeviceToHost);
    convert_array(host_L, L_host, n, true);
    get_transpose (host_L, host_U, n);

    compute_inverse(host_U, 0, 0, n - 1, n - 1);

    duplicate_matrix (host_U, host_U_trans, n);
    get_transpose (host_U, host_U_trans, n);
    double *host_inv = (double*) malloc(n * n *sizeof(double));
    convert_array(host_U, host_inv, n, false);
    double *host_inv_trans = (double*) malloc(n * n *sizeof(double));
    convert_array(host_U_trans, host_inv_trans, n, false);


    double *device_k_out, *device_host_inv, *device_host_inv_trans, *device_obs_data;
    cudaMalloc(&device_k_out, (n * n * sizeof(double)));
    cudaMalloc(&device_host_inv, (n * n * sizeof(double)));
    cudaMemcpy(device_k_out, k_out, n* n * sizeof(double), cudaMemcpyHostToDevice);
    cudaMemcpy(device_host_inv, host_inv, n* n * sizeof(double), cudaMemcpyHostToDevice);

    cudaMalloc(&device_host_inv_trans, (n * n * sizeof(double)));
    cudaMalloc(&device_obs_data, (n * n * sizeof(double)));
    cudaMemcpy(device_host_inv_trans, host_inv_trans, n* n * sizeof(double), cudaMemcpyHostToDevice);
    cudaMemcpy(device_obs_data, host_obs_data, n* n * sizeof(double), cudaMemcpyHostToDevice);

    double *product1;
    cudaMalloc(&product1, (n * n * sizeof(double)));
    gpu_matrix_mult<<<1, num_threads>>> (device_k_out, device_host_inv,product1, n, n , n);

    double *h_a, *h_b, *h_c;
    cudaMallocHost((void **) &h_a, sizeof(double)*n*n);
    cudaMallocHost((void **) &h_b, sizeof(double)*n*1);
    cudaMallocHost((void **) &h_c, sizeof(double)*n*1);

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            h_a[i * n + j] = host_inv_trans[i*n + j];
        }
    }

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < 1; ++j) {
            h_b[i * 1 + j] = host_obs_data[i*1 + j];
        }
    }

    double *d_a, *d_b, *d_c;
    cudaMalloc((void **) &d_a, sizeof(double)*n*n);
    cudaMalloc((void **) &d_b, sizeof(double)*n*1);
    cudaMalloc((void **) &d_c, sizeof(double)*n*1);

    cudaMemcpy(d_a, h_a, sizeof(double)*n*n, cudaMemcpyHostToDevice);
    cudaMemcpy(d_b, h_b, sizeof(double)*n*1, cudaMemcpyHostToDevice);


    gpu_matrix_mult<<<dimGrid, dimBlock>>>(d_a, d_b, d_c, n, n, 1);
    cudaMemcpy(h_c, d_c, sizeof(double)*n*1, cudaMemcpyDeviceToHost);

    double *final_product;
    cudaMalloc(&final_product, (n * n * sizeof(double)));
    
    gpu_matrix_mult<<<dimGrid, dimBlock>>> (product1, d_c, final_product, 1, n , 1);
    double *predicted_value = (double*) malloc(n * n * sizeof(double));
    cudaMemcpy(predicted_value, final_product, n * n * sizeof(double), cudaMemcpyDeviceToHost);
    return predicted_value[0];

}
int main(int argc, char* argv[])
{
    struct node_coord *rstar = (struct node_coord *) malloc (1 * sizeof (struct node_coord));
    int m;
    int n;
    double h;

    if(argc != 4)
    {
        printf("Invalid number of input arguements. Please execute the binary as ./a.out m x* y*\n");
        return 0;
    }
    else
    {
        m = atoi(argv[1]);
        rstar[0].x = atof(argv[2]);
        rstar[0].y = atof(argv[3]);
        printf("Size: %d \n", m);
        printf("Given coordinates (%f, %f)\n", rstar[0].x, rstar[0].y);
    }

    n = m * m;
    h = 1.0 / (double)(m + 1);
    int num_threads = getNumThreads();
    cudaEvent_t start_overall, end_overall, start_LU, end_LU, start_solver, end_solver;

    struct node_coord *grid_points = (struct node_coord *) malloc (n * sizeof (struct node_coord));
    initialize_points (grid_points, m, h);


    struct node_coord *device_grid_points;
    cudaMalloc(&device_grid_points, (n * sizeof(struct node_coord)));
    cudaMemcpy(device_grid_points, grid_points, n * sizeof(struct node_coord), cudaMemcpyHostToDevice);


    double **observed_data_points = alloc_mem_matrix (n);
    calculate_observed_data (observed_data_points, grid_points, n);
    double *host_obs_data;
    cudaMallocHost((void **) &host_obs_data, sizeof(double)*n*n);
    convert_array (observed_data_points, host_obs_data, n , false);

    double **k = alloc_mem_matrix (n);
    double *k_out = (double*) malloc(n * n *sizeof(double));
    compute_k (k, rstar, grid_points, n);
    convert_array(k, k_out, n, false);

    unsigned int grid_rows = (n + BLOCK_SIZE - 1) / BLOCK_SIZE;
    unsigned int grid_cols = (1 + BLOCK_SIZE - 1) / BLOCK_SIZE;
    dim3 dimGrid(grid_cols, grid_rows);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);

    cudaEventCreate(&start_overall);
    cudaEventCreate(&end_overall);
    double *K1;
    cudaMalloc(&K1, (n * n * sizeof(double)));
    compute_K_matrix_gpu<<<1, num_threads>>>(num_threads, K1, device_grid_points, m);

    double *L, *partial_sum;
    cudaMalloc(&L, (n * n * sizeof(double)));
    cudaMalloc(&partial_sum, num_threads * sizeof(double));
    cudaEventCreate(&start_LU);
    cudaEventCreate(&end_LU);
    cudaEventRecord(start_LU, 0);
    cudaEventRecord(start_overall, 0);

    device_run_chol<<<1,num_threads>>>(num_threads, K1, L, partial_sum, n);
    cudaEventRecord(end_LU, 0);
    cudaEventSynchronize(end_LU);


    cudaEventCreate(&start_solver);
    cudaEventCreate(&end_solver);
    cudaEventRecord(start_solver, 0);
    double predicted_value = run_solver (L, k_out, host_obs_data, n, num_threads);
    cudaEventRecord(end_solver, 0);
    cudaEventSynchronize(end_solver);
    cudaEventRecord(end_overall, 0);
    cudaEventSynchronize(end_overall);

    printf ("Predicted value is %lf\n", predicted_value);

    double actual_value = 1 - (((rstar[0].x - 0.5) * (rstar[0].x - 0.5)) +
            ((rstar[0].y - 0.5) * (rstar[0].y - 0.5))) + GET_RAND;

    printf ("Actual value is %lf\n", actual_value);
    float time_overall, time_LU, time_solver;
    cudaEventElapsedTime(&time_overall, start_overall, end_overall);
    cudaEventElapsedTime(&time_LU, start_LU, end_LU);
    cudaEventElapsedTime(&time_solver, start_solver, end_solver);


    printf("Time Taken by Cholesky = %f ms\n", time_LU);
    printf("Time Taken by Solver = %f ms\n", time_solver);
    printf("Overall Time Taken = %f ms\n", time_overall);
    return 0;
}


	.file	"tmpxft_0039967c_00000000-6_GPR.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2049:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2049:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0, @function
_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0:
.LFB2196:
	.cfi_startproc
	jmp	cudaMalloc@PLT
	.cfi_endproc
.LFE2196:
	.size	_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0, .-_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0
	.globl	_Z16alloc_mem_matrixi
	.type	_Z16alloc_mem_matrixi, @function
_Z16alloc_mem_matrixi:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%edi, %r13
	movl	$8, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	movq	%r13, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	pushq	%rcx
	.cfi_def_cfa_offset 48
	call	calloc@PLT
	movq	%rax, %rbx
.L4:
	cmpl	%ebp, %r12d
	jle	.L8
	movl	$8, %esi
	movq	%r13, %rdi
	call	calloc@PLT
	movq	%rax, (%rbx,%rbp,8)
	incq	%rbp
	jmp	.L4
.L8:
	popq	%rdx
	.cfi_def_cfa_offset 40
	movq	%rbx, %rax
	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
.LFE2027:
	.size	_Z16alloc_mem_matrixi, .-_Z16alloc_mem_matrixi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"\n Device K ---------------------------------- \n"
.LC2:
	.string	"(%5.5lf) "
.LC3:
	.string	"\n"
	.text
	.globl	_Z6printKPdi
	.type	_Z6printKPdi, @function
_Z6printKPdi:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%r15d, %ebp
	imull	%r15d, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r15, %rbx
	movslq	%ebp, %rbp
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	salq	$3, %rbp
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	%rbp, %rdx
	movq	%r13, %rsi
	movl	$2, %ecx
	movq	%rax, %rdi
	movq	%rax, %r12
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
	call	cudaMemcpy@PLT
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L10:
	cmpl	%ebx, %r13d
	jge	.L9
	movslq	%ebp, %rdx
	leaq	(%r15,%rdx), %r14
.L11:
	movsd	(%r12,%rdx,8), %xmm0
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	movq	%rdx, 8(%rsp)
	call	__printf_chk@PLT
	movq	8(%rsp), %rdx
	incq	%rdx
	cmpq	%r14, %rdx
	jne	.L11
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	addl	%ebx, %ebp
	call	__printf_chk@PLT
	incl	%r13d
	jmp	.L10
.L9:
	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	_Z6printKPdi, .-_Z6printKPdi
	.section	.rodata
	.align 32
.LC0:
	.long	32
	.long	32
	.long	33
	.long	48
	.long	48
	.long	192
	.long	50
	.long	192
	.long	53
	.long	192
	.long	55
	.long	192
	.long	80
	.long	128
	.long	82
	.long	128
	.long	83
	.long	128
	.long	96
	.long	64
	.long	97
	.long	128
	.long	98
	.long	128
	.long	-1
	.long	-1
	.text
	.globl	_Z19_ConvertSMVer2Coresii
	.type	_Z19_ConvertSMVer2Coresii, @function
_Z19_ConvertSMVer2Coresii:
.LFB2029:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movl	%esi, %edx
	movq	%fs:40, %rcx
	movq	%rcx, 104(%rsp)
	xorl	%ecx, %ecx
	sall	$4, %eax
	movq	%rsp, %rdi
	leaq	.LC0(%rip), %rsi
	movl	$26, %ecx
	addl	%eax, %edx
	xorl	%eax, %eax
	rep movsl
	movq	%rsp, %rdi
.L16:
	movl	(%rdi,%rax,8), %esi
	movslq	%eax, %rcx
	cmpl	$-1, %esi
	je	.L22
	incq	%rax
	cmpl	%esi, %edx
	jne	.L16
	movl	4(%rsp,%rcx,8), %eax
	jmp	.L15
.L22:
	decl	%eax
	cltq
	movl	4(%rsp,%rax,8), %eax
.L15:
	movq	104(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z19_ConvertSMVer2Coresii, .-_Z19_ConvertSMVer2Coresii
	.globl	_Z13getNumThreadsv
	.type	_Z13getNumThreadsv, @function
_Z13getNumThreadsv:
.LFB2030:
	.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
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
	subq	$1056, %rsp
	.cfi_def_cfa_offset 1088
	movq	%fs:40, %rax
	movq	%rax, 1048(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdi
	leaq	16(%rsp), %r12
	call	cudaGetDeviceCount@PLT
.L24:
	cmpl	%ebp, 12(%rsp)
	jle	.L28
	movl	%ebp, %esi
	movq	%r12, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	movl	380(%rsp), %esi
	movl	376(%rsp), %edi
	call	_Z19_ConvertSMVer2Coresii
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
	incl	%ebp
	jmp	.L24
.L28:
	movq	1048(%rsp), %rax
	subq	%fs:40, %rax
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	addq	$1056, %rsp
	.cfi_def_cfa_offset 32
	movl	%ebx, %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
.LFE2030:
	.size	_Z13getNumThreadsv, .-_Z13getNumThreadsv
	.section	.rodata.str1.1
.LC4:
	.string	"\n --------------------- %s --------------------- \n"
.LC5:
	.string	"%4.9lf "
	.text
	.globl	_Z12print_matrixPcPPdi
	.type	_Z12print_matrixPcPPdi, @function
_Z12print_matrixPcPPdi:
.LFB2031:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movslq	%edx, %r14
	movq	%rdi, %rdx
	movl	$2, %edi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	leaq	.LC4(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r14, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 64
	call	__printf_chk@PLT
.L30:
	cmpl	%ebx, %ebp
	jle	.L35
	xorl	%r12d, %r12d
	leaq	.LC5(%rip), %r15
.L31:
	movq	0(%r13,%rbx,8), %rax
	movq	%r15, %rsi
	movl	$2, %edi
	movsd	(%rax,%r12,8), %xmm0
	movb	$1, %al
	incq	%r12
	call	__printf_chk@PLT
	cmpq	%r14, %r12
	jne	.L31
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%rbx
	call	__printf_chk@PLT
	jmp	.L30
.L35:
	leaq	.LC3(%rip), %rbx
	movl	$2, %edi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__printf_chk@PLT
	popq	%rdx
	.cfi_def_cfa_offset 56
	movq	%rbx, %rsi
	movl	$2, %edi
	popq	%rbx
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
.LFE2031:
	.size	_Z12print_matrixPcPPdi, .-_Z12print_matrixPcPPdi
	.globl	_Z15print_1d_matrixPcPdi
	.type	_Z15print_1d_matrixPcPdi, @function
_Z15print_1d_matrixPcPdi:
.LFB2032:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	movslq	%edx, %r15
	movq	%rdi, %rdx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	$2, %edi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	leaq	.LC4(%rip), %rsi
	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
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r15, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__printf_chk@PLT
.L37:
	cmpl	%ebx, %r12d
	jge	.L39
	movslq	%ebp, %rdx
	leaq	(%r15,%rdx), %r14
.L38:
	movsd	0(%r13,%rdx,8), %xmm0
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	movq	%rdx, 8(%rsp)
	call	__printf_chk@PLT
	movq	8(%rsp), %rdx
	incq	%rdx
	cmpq	%r14, %rdx
	jne	.L38
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	addl	%ebx, %ebp
	call	__printf_chk@PLT
	incl	%r12d
	jmp	.L37
.L39:
	leaq	.LC3(%rip), %rbx
	movl	$2, %edi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__printf_chk@PLT
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	movq	%rbx, %rsi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	movl	$2, %edi
	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	_Z15print_1d_matrixPcPdi, .-_Z15print_1d_matrixPcPdi
	.section	.rodata.str1.1
.LC6:
	.string	"\n --------------------- Printing grid coordinates --------------------- \n"
.LC7:
	.string	"(%3.5lf %3.5lf) "
	.text
	.globl	_Z12print_pointsP10node_coordi
	.type	_Z12print_pointsP10node_coordi, @function
_Z12print_pointsP10node_coordi:
.LFB2033:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	movslq	%esi, %r15
	leaq	.LC6(%rip), %rsi
	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
	movl	$2, %edi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r15, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__printf_chk@PLT
.L43:
	cmpl	%ebp, %r14d
	jge	.L42
	movslq	%r13d, %rbx
	movq	%rbx, %rdx
	addq	%r15, %rbx
	salq	$4, %rdx
	salq	$4, %rbx
	addq	%r12, %rdx
	addq	%r12, %rbx
.L44:
	movsd	8(%rdx), %xmm1
	movsd	(%rdx), %xmm0
	movl	$2, %edi
	movb	$2, %al
	leaq	.LC7(%rip), %rsi
	movq	%rdx, 8(%rsp)
	call	__printf_chk@PLT
	movq	8(%rsp), %rdx
	addq	$16, %rdx
	cmpq	%rbx, %rdx
	jne	.L44
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	addl	%ebp, %r13d
	incl	%r14d
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L43
.L42:
	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
.LFE2033:
	.size	_Z12print_pointsP10node_coordi, .-_Z12print_pointsP10node_coordi
	.section	.rodata.str1.1
.LC8:
	.string	"\n --------------------- Printing data points --------------------- \n"
.LC9:
	.string	"%3.5lf  "
	.text
	.globl	_Z10print_dataPdi
	.type	_Z10print_dataPdi, @function
_Z10print_dataPdi:
.LFB2034:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xorl	%eax, %eax
	leaq	.LC9(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	movl	$2, %edi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	leaq	.LC8(%rip), %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 48
	call	__printf_chk@PLT
.L49:
	cmpl	%ebx, %ebp
	jle	.L52
	movsd	(%r12,%rbx,8), %xmm0
	movq	%r13, %rsi
	movl	$2, %edi
	movb	$1, %al
	incq	%rbx
	call	__printf_chk@PLT
	jmp	.L49
.L52:
	popq	%rdx
	.cfi_def_cfa_offset 40
	leaq	.LC3(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 32
	movl	$2, %edi
	popq	%rbp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2034:
	.size	_Z10print_dataPdi, .-_Z10print_dataPdi
	.globl	_Z17initialize_pointsP10node_coordid
	.type	_Z17initialize_pointsP10node_coordid, @function
_Z17initialize_pointsP10node_coordid:
.LFB2035:
	.cfi_startproc
	endbr64
	movl	$1, %ecx
	xorl	%r8d, %r8d
.L54:
	cmpl	%esi, %ecx
	jg	.L53
	cvtsi2sdl	%ecx, %xmm1
	movslq	%r8d, %rax
	movl	$1, %edx
	salq	$4, %rax
	mulsd	%xmm0, %xmm1
.L55:
	cvtsi2sdl	%edx, %xmm2
	incl	%edx
	movsd	%xmm1, (%rdi,%rax)
	mulsd	%xmm0, %xmm2
	movsd	%xmm2, 8(%rdi,%rax)
	addq	$16, %rax
	cmpl	%edx, %esi
	jge	.L55
	addl	%esi, %r8d
	incl	%ecx
	jmp	.L54
.L53:
	ret
	.cfi_endproc
.LFE2035:
	.size	_Z17initialize_pointsP10node_coordid, .-_Z17initialize_pointsP10node_coordid
	.globl	_Z23calculate_observed_dataPPdP10node_coordi
	.type	_Z23calculate_observed_dataPPdP10node_coordi, @function
_Z23calculate_observed_dataPPdP10node_coordi:
.LFB2036:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
.L59:
	cmpl	%r12d, %r13d
	jge	.L62
	movsd	0(%rbp,%rbx,2), %xmm0
	movsd	8(%rbp,%rbx,2), %xmm1
	incl	%r13d
	subsd	.LC10(%rip), %xmm0
	subsd	.LC10(%rip), %xmm1
	mulsd	%xmm0, %xmm0
	mulsd	%xmm1, %xmm1
	addsd	%xmm1, %xmm0
	movsd	.LC11(%rip), %xmm1
	subsd	%xmm0, %xmm1
	movsd	%xmm1, 8(%rsp)
	call	rand@PLT
	movq	(%r14), %rdx
	cvtsi2sdl	%eax, %xmm0
	divsd	.LC12(%rip), %xmm0
	addsd	8(%rsp), %xmm0
	subsd	.LC13(%rip), %xmm0
	movsd	%xmm0, (%rdx,%rbx)
	addq	$8, %rbx
	jmp	.L59
.L62:
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2036:
	.size	_Z23calculate_observed_dataPPdP10node_coordi, .-_Z23calculate_observed_dataPPdP10node_coordi
	.globl	_Z13get_total_sumPdi
	.type	_Z13get_total_sumPdi, @function
_Z13get_total_sumPdi:
.LFB2037:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2037:
	.size	_Z13get_total_sumPdi, .-_Z13get_total_sumPdi
	.globl	_Z21compute_matrix_part_1PPdiiiiii
	.type	_Z21compute_matrix_part_1PPdiiiiii, @function
_Z21compute_matrix_part_1PPdiiiiii:
.LFB2038:
	.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
	movl	%r8d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%r9d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	leal	1(%r9), %edi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	%edi, %rdi
	movslq	%edx, %rbx
	pushq	%rcx
	.cfi_def_cfa_offset 64
	salq	$3, %rdi
	call	malloc@PLT
	leal	1(%rbx,%r12), %edi
	movslq	%r14d, %r8
	salq	$3, %rbx
	movslq	%edi, %rcx
	movq	%rax, %rsi
	leaq	0(%rbp,%r8,8), %r9
	addl	%r12d, %r14d
	salq	$3, %rcx
.L66:
	cmpl	%r13d, %edi
	jg	.L65
	movq	%rsi, %r10
	movq	%r8, %rax
.L72:
	cmpl	%eax, %r14d
	jl	.L75
	movq	%rbx, %r11
	xorl	%edx, %edx
	xorps	%xmm0, %xmm0
.L68:
	movsd	%xmm0, (%r10)
	cmpl	%edx, %r12d
	jl	.L76
	movq	0(%rbp,%rax,8), %r15
	movsd	(%r15,%r11), %xmm1
	movq	(%r9,%rdx,8), %r15
	addq	$8, %r11
	incq	%rdx
	mulsd	(%r15,%rcx), %xmm1
	subsd	%xmm1, %xmm0
	jmp	.L68
.L76:
	incq	%rax
	addq	$8, %r10
	jmp	.L72
.L75:
	xorl	%eax, %eax
.L69:
	cmpl	%eax, %r12d
	jl	.L77
	movq	(%r9,%rax,8), %rdx
	movsd	(%rsi,%rax,8), %xmm0
	incq	%rax
	movsd	%xmm0, (%rdx,%rcx)
	jmp	.L69
.L77:
	incl	%edi
	addq	$8, %rcx
	jmp	.L66
.L65:
	popq	%rax
	.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
.LFE2038:
	.size	_Z21compute_matrix_part_1PPdiiiiii, .-_Z21compute_matrix_part_1PPdiiiiii
	.globl	_Z21compute_matrix_part_2PPdiiiiii
	.type	_Z21compute_matrix_part_2PPdiiiiii, @function
_Z21compute_matrix_part_2PPdiiiiii:
.LFB2039:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movslq	%r9d, %r12
	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
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	80(%rsp), %ebx
	subl	%r12d, %ebx
	decl	%ebx
	movslq	%ebx, %rdi
	salq	$3, %rdi
	call	malloc@PLT
	leal	1(%r13,%r12), %r10d
	movslq	%r13d, %rsi
	addl	80(%rsp), %r13d
	movslq	%r10d, %rdi
	addq	%r12, %rsi
	movq	%rax, %rdx
	movslq	%r15d, %rax
	movq	%rdi, %r8
	addl	%r12d, %r15d
	movl	%r13d, 12(%rsp)
	leaq	0(,%rdi,8), %r14
	subq	%rsi, %r8
	movslq	%r15d, %rsi
	leaq	0(%rbp,%rsi,8), %rcx
	leaq	(%rdx,%r8,8), %r12
	movq	%rcx, (%rsp)
.L79:
	cmpl	%eax, %r15d
	jl	.L88
	movslq	%r10d, %rcx
	movq	%r12, %rsi
.L80:
	cmpl	%ecx, 12(%rsp)
	jle	.L89
	movq	(%rsp), %r8
	movq	%r14, %r9
	xorps	%xmm0, %xmm0
	xorl	%edi, %edi
	leaq	0(,%rcx,8), %r13
.L81:
	movsd	%xmm0, -8(%rsi)
	addq	$8, %r8
	cmpl	%edi, %ebx
	jle	.L90
	movq	0(%rbp,%rax,8), %r11
	incl	%edi
	movsd	(%r11,%r9), %xmm1
	movq	(%r8), %r11
	addq	$8, %r9
	mulsd	(%r11,%r13), %xmm1
	addsd	%xmm1, %xmm0
	jmp	.L81
.L90:
	incq	%rcx
	addq	$8, %rsi
	jmp	.L80
.L89:
	movq	%r14, %rsi
	xorl	%ecx, %ecx
.L84:
	cmpl	%ecx, %ebx
	jle	.L91
	movsd	(%rdx,%rcx,8), %xmm0
	movq	0(%rbp,%rax,8), %rdi
	incq	%rcx
	movsd	%xmm0, (%rdi,%rsi)
	addq	$8, %rsi
	jmp	.L84
.L91:
	incq	%rax
	jmp	.L79
.L88:
	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
.LFE2039:
	.size	_Z21compute_matrix_part_2PPdiiiiii, .-_Z21compute_matrix_part_2PPdiiiiii
	.globl	_Z15compute_inversePPdiiii
	.type	_Z15compute_inversePPdiiii, @function
_Z15compute_inversePPdiiii:
.LFB2040:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%ecx, %eax
	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
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%edx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	%esi, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%r8d, 4(%rsp)
	subl	%ebx, %eax
	jne	.L93
	movq	(%rdi,%rbx,8), %rax
	movsd	.LC11(%rip), %xmm0
	leaq	(%rax,%rbp,8), %rax
	divsd	(%rax), %xmm0
	movsd	%xmm0, (%rax)
	jmp	.L92
.L93:
	movl	%ecx, %r13d
	cltd
	movl	$2, %ecx
	movl	%ebx, %esi
	leal	1(%rax), %r15d
	idivl	%ecx
	movl	%ebp, %edx
	leal	(%rbx,%rax), %r14d
	leal	(%rax,%rbp), %r8d
	movl	%eax, 12(%rsp)
	movl	%r14d, %ecx
	movl	%r8d, 8(%rsp)
	call	_Z15compute_inversePPdiiii
	movl	8(%rsp), %r8d
	movl	%r13d, %ecx
	movq	%r12, %rdi
	leal	1(%r14), %esi
	leal	1(%r8), %edx
	movl	4(%rsp), %r8d
	call	_Z15compute_inversePPdiiii
	movl	%r13d, %ecx
	movl	%ebp, %edx
	movl	%ebx, %esi
	pushq	%rax
	.cfi_def_cfa_offset 88
	movq	%r12, %rdi
	pushq	%r15
	.cfi_def_cfa_offset 96
	movl	28(%rsp), %r9d
	movl	20(%rsp), %r8d
	movl	%r9d, 24(%rsp)
	call	_Z21compute_matrix_part_1PPdiiiiii
	movl	24(%rsp), %r9d
	movl	%r13d, %ecx
	movl	%ebp, %edx
	movl	20(%rsp), %r8d
	movl	%ebx, %esi
	movq	%r12, %rdi
	movl	%r15d, (%rsp)
	call	_Z21compute_matrix_part_2PPdiiiiii
	popq	%rdx
	.cfi_def_cfa_offset 88
	popq	%rcx
	.cfi_def_cfa_offset 80
.L92:
	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
.LFE2040:
	.size	_Z15compute_inversePPdiiii, .-_Z15compute_inversePPdiiii
	.globl	_Z9compute_kPPdP10node_coordS2_i
	.type	_Z9compute_kPPdP10node_coordS2_i, @function
_Z9compute_kPPdP10node_coordS2_i:
.LFB2041:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%ecx, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L97:
	cmpl	%r14d, %r15d
	jge	.L100
	movsd	(%r12,%rbx,2), %xmm0
	movq	(%rdi), %r13
	movq	%rdi, 8(%rsp)
	incl	%r15d
	movsd	8(%r12,%rbx,2), %xmm1
	subsd	0(%rbp), %xmm0
	subsd	8(%rbp), %xmm1
	addq	%rbx, %r13
	addq	$8, %rbx
	mulsd	%xmm0, %xmm0
	mulsd	%xmm1, %xmm1
	addsd	%xmm1, %xmm0
	xorps	.LC15(%rip), %xmm0
	call	exp@PLT
	movq	8(%rsp), %rdi
	movsd	%xmm0, 0(%r13)
	jmp	.L97
.L100:
	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
.LFE2041:
	.size	_Z9compute_kPPdP10node_coordS2_i, .-_Z9compute_kPPdP10node_coordS2_i
	.globl	_Z13convert_arrayPPdS_ib
	.type	_Z13convert_arrayPPdS_ib, @function
_Z13convert_arrayPPdS_ib:
.LFB2042:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	movq	%rdi, %r10
	xorl	%r9d, %r9d
	cmpl	%eax, %edx
	jg	.L110
	ret
.L110:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
.L106:
	movslq	%r9d, %rdi
	movq	(%r10,%rax,8), %rbx
	leaq	(%rsi,%rdi,8), %r8
	xorl	%edi, %edi
.L105:
	leaq	(%rbx,%rdi,8), %r11
	testb	%cl, %cl
	je	.L103
	movsd	(%r8), %xmm0
	movsd	%xmm0, (%r11)
	jmp	.L104
.L103:
	movsd	(%r11), %xmm0
	movsd	%xmm0, (%r8)
.L104:
	incq	%rdi
	addq	$8, %r8
	cmpl	%edi, %edx
	jg	.L105
	incq	%rax
	addl	%edx, %r9d
	cmpl	%eax, %edx
	jg	.L106
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2042:
	.size	_Z13convert_arrayPPdS_ib, .-_Z13convert_arrayPPdS_ib
	.globl	_Z13get_transposePPdS0_i
	.type	_Z13get_transposePPdS0_i, @function
_Z13get_transposePPdS0_i:
.LFB2043:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
.L112:
	cmpl	%eax, %edx
	jle	.L116
	movq	(%rdi,%rax,8), %r10
	leaq	0(,%rax,8), %r8
	xorl	%ecx, %ecx
.L113:
	movsd	(%r10,%rcx,8), %xmm0
	movq	(%rsi,%rcx,8), %r9
	incq	%rcx
	movsd	%xmm0, (%r9,%r8)
	cmpl	%ecx, %edx
	jg	.L113
	incq	%rax
	jmp	.L112
.L116:
	ret
	.cfi_endproc
.LFE2043:
	.size	_Z13get_transposePPdS0_i, .-_Z13get_transposePPdS0_i
	.globl	_Z16duplicate_matrixPPdS0_i
	.type	_Z16duplicate_matrixPPdS0_i, @function
_Z16duplicate_matrixPPdS0_i:
.LFB2044:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
.L118:
	cmpl	%eax, %edx
	jle	.L122
	movq	(%rdi,%rax,8), %r9
	movq	(%rsi,%rax,8), %r8
	xorl	%ecx, %ecx
.L119:
	movsd	(%r9,%rcx,8), %xmm0
	movsd	%xmm0, (%r8,%rcx,8)
	incq	%rcx
	cmpl	%ecx, %edx
	jg	.L119
	incq	%rax
	jmp	.L118
.L122:
	ret
	.cfi_endproc
.LFE2044:
	.size	_Z16duplicate_matrixPPdS0_i, .-_Z16duplicate_matrixPPdS0_i
	.globl	_Z42__device_stub__Z15gpu_matrix_multPdS_S_iiiPdS_S_iii
	.type	_Z42__device_stub__Z15gpu_matrix_multPdS_S_iiiPdS_S_iii, @function
_Z42__device_stub__Z15gpu_matrix_multPdS_S_iiiPdS_S_iii:
.LFB2071:
	.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	.L123
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z15gpu_matrix_multPdS_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
.L123:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L125
	call	__stack_chk_fail@PLT
.L125:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2071:
	.size	_Z42__device_stub__Z15gpu_matrix_multPdS_S_iiiPdS_S_iii, .-_Z42__device_stub__Z15gpu_matrix_multPdS_S_iiiPdS_S_iii
	.globl	_Z15gpu_matrix_multPdS_S_iii
	.type	_Z15gpu_matrix_multPdS_S_iii, @function
_Z15gpu_matrix_multPdS_S_iii:
.LFB2072:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z15gpu_matrix_multPdS_S_iiiPdS_S_iii
	.cfi_endproc
.LFE2072:
	.size	_Z15gpu_matrix_multPdS_S_iii, .-_Z15gpu_matrix_multPdS_S_iii
	.globl	_Z10run_solverPdS_S_ii
	.type	_Z10run_solverPdS_S_ii, @function
_Z10run_solverPdS_S_ii:
.LFB2045:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%r8d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%ecx, %ebx
	movl	%ebx, %edi
	subq	$184, %rsp
	.cfi_def_cfa_offset 240
	movl	BLOCK_SIZE(%rip), %ecx
	movq	%rsi, 24(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leal	-1(%rcx,%rbx), %eax
	movl	%ecx, 124(%rsp)
	cltd
	movl	%ecx, 128(%rsp)
	idivl	%ecx
	movl	$1, 112(%rsp)
	movl	$1, 120(%rsp)
	movl	$1, 132(%rsp)
	movl	%eax, 116(%rsp)
	call	_Z16alloc_mem_matrixi
	movl	%ebx, %edi
	movq	%rax, %r13
	call	_Z16alloc_mem_matrixi
	movl	%ebx, %edi
	movq	%rax, %rbp
	call	_Z16alloc_mem_matrixi
	movq	%rax, 8(%rsp)
	movl	%ebx, %eax
	imull	%ebx, %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	call	malloc@PLT
	movq	(%rsp), %rdx
	movl	$2, %ecx
	movq	%r15, %rsi
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rsi
	movl	%ebx, %edx
	movq	%r13, %rdi
	movl	$1, %ecx
	call	_Z13convert_arrayPPdS_ib
	movq	%rbp, %rsi
	movq	%r13, %rdi
	call	_Z13get_transposePPdS0_i
	leal	-1(%rbx), %ecx
	xorl	%edx, %edx
	xorl	%esi, %esi
	movl	%ecx, %r8d
	movq	%rbp, %rdi
	call	_Z15compute_inversePPdiiii
	movq	8(%rsp), %rsi
	movl	%ebx, %edx
	movq	%rbp, %rdi
	call	_Z16duplicate_matrixPPdS0_i
	movq	8(%rsp), %rsi
	call	_Z13get_transposePPdS0_i
	movq	(%rsp), %rdi
	call	malloc@PLT
	xorl	%ecx, %ecx
	movl	%ebx, %edx
	movq	%rbp, %rdi
	movq	%rax, %rsi
	movq	%rax, %r13
	call	_Z13convert_arrayPPdS_ib
	movq	(%rsp), %rdi
	call	malloc@PLT
	movq	8(%rsp), %rdi
	xorl	%ecx, %ecx
	movl	%ebx, %edx
	movq	%rax, %rsi
	movq	%rax, %rbp
	call	_Z13convert_arrayPPdS_ib
	movq	(%rsp), %rsi
	leaq	32(%rsp), %rdi
	call	_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0
	movq	(%rsp), %rsi
	leaq	40(%rsp), %rdi
	call	_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0
	movq	(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	$1, %ecx
	movq	32(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdx
	movq	40(%rsp), %rdi
	movq	%r13, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	(%rsp), %rsi
	leaq	48(%rsp), %rdi
	call	_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0
	movq	(%rsp), %rsi
	leaq	56(%rsp), %rdi
	call	_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0
	movq	(%rsp), %rdx
	movq	48(%rsp), %rdi
	movq	%rbp, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdx
	movq	56(%rsp), %rdi
	movq	%r12, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	(%rsp), %rsi
	leaq	64(%rsp), %rdi
	call	_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	%r14d, 152(%rsp)
	movq	%rdi, 156(%rsp)
	movl	160(%rsp), %ecx
	movq	152(%rsp), %rdx
	movq	%rdi, 136(%rsp)
	movl	$1, 144(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L129
	movq	64(%rsp), %rdx
	movq	40(%rsp), %rsi
	movl	%ebx, %r9d
	movl	%ebx, %r8d
	movq	32(%rsp), %rdi
	movl	%ebx, %ecx
	call	_Z42__device_stub__Z15gpu_matrix_multPdS_S_iiiPdS_S_iii
.L129:
	movslq	%ebx, %r13
	leaq	72(%rsp), %rdi
	movq	%r13, %r14
	imulq	%r13, %r14
	salq	$3, %r13
	salq	$3, %r14
	movq	%r14, %rsi
	call	cudaMallocHost@PLT
	leaq	80(%rsp), %rdi
	movq	%r13, %rsi
	call	cudaMallocHost@PLT
	leaq	88(%rsp), %rdi
	movq	%r13, %rsi
	call	cudaMallocHost@PLT
	movq	72(%rsp), %rdi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
.L130:
	cmpl	%ebx, %edx
	jge	.L140
	movq	%rcx, %rax
	xorl	%esi, %esi
.L131:
	movsd	0(%rbp,%rax), %xmm0
	incl	%esi
	movsd	%xmm0, (%rdi,%rax)
	addq	$8, %rax
	cmpl	%esi, %ebx
	jne	.L131
	incl	%edx
	addq	%r13, %rcx
	jmp	.L130
.L140:
	movq	80(%rsp), %rdx
	xorl	%eax, %eax
.L133:
	cmpl	%eax, %ebx
	jle	.L132
	movsd	(%r12,%rax,8), %xmm0
	movsd	%xmm0, (%rdx,%rax,8)
	incq	%rax
	jmp	.L133
.L132:
	leaq	96(%rsp), %rdi
	movq	%r14, %rsi
	call	cudaMalloc@PLT
	leaq	104(%rsp), %rdi
	movq	%r13, %rsi
	call	cudaMalloc@PLT
	leaq	136(%rsp), %rdi
	movq	%r13, %rsi
	call	cudaMalloc@PLT
	movq	72(%rsp), %rsi
	movq	96(%rsp), %rdi
	movq	%r14, %rdx
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	80(%rsp), %rsi
	movq	104(%rsp), %rdi
	movq	%r13, %rdx
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	124(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	132(%rsp), %ecx
	movq	112(%rsp), %rdi
	movl	120(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L134
	movq	104(%rsp), %rsi
	movq	96(%rsp), %rdi
	movl	%ebx, %r8d
	movl	%ebx, %ecx
	movq	136(%rsp), %rdx
	movl	$1, %r9d
	call	_Z42__device_stub__Z15gpu_matrix_multPdS_S_iiiPdS_S_iii
.L134:
	movq	136(%rsp), %rsi
	movq	88(%rsp), %rdi
	movl	$2, %ecx
	movq	%r13, %rdx
	call	cudaMemcpy@PLT
	movq	(%rsp), %rsi
	leaq	152(%rsp), %rdi
	call	_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0
	movq	124(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	132(%rsp), %ecx
	movq	112(%rsp), %rdi
	movl	120(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L135
	movq	152(%rsp), %rdx
	movq	64(%rsp), %rdi
	movl	$1, %r9d
	movl	%ebx, %r8d
	movq	136(%rsp), %rsi
	movl	$1, %ecx
	call	_Z42__device_stub__Z15gpu_matrix_multPdS_S_iiiPdS_S_iii
.L135:
	movq	(%rsp), %rdi
	call	malloc@PLT
	movq	(%rsp), %rdx
	movl	$2, %ecx
	movq	152(%rsp), %rsi
	movq	%rax, %rbx
	movq	%rax, %rdi
	call	cudaMemcpy@PLT
	movsd	(%rbx), %xmm0
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L136
	call	__stack_chk_fail@PLT
.L136:
	addq	$184, %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
.LFE2045:
	.size	_Z10run_solverPdS_S_ii, .-_Z10run_solverPdS_S_ii
	.globl	_Z55__device_stub__Z20compute_K_matrix_gpuiPdP10node_coordiiPdP10node_coordi
	.type	_Z55__device_stub__Z20compute_K_matrix_gpuiPdP10node_coordiiPdP10node_coordi, @function
_Z55__device_stub__Z20compute_K_matrix_gpuiPdP10node_coordiiPdP10node_coordi:
.LFB2073:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 28(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 24(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%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	.L141
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z20compute_K_matrix_gpuiPdP10node_coordi(%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
.L141:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L143
	call	__stack_chk_fail@PLT
.L143:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2073:
	.size	_Z55__device_stub__Z20compute_K_matrix_gpuiPdP10node_coordiiPdP10node_coordi, .-_Z55__device_stub__Z20compute_K_matrix_gpuiPdP10node_coordiiPdP10node_coordi
	.globl	_Z20compute_K_matrix_gpuiPdP10node_coordi
	.type	_Z20compute_K_matrix_gpuiPdP10node_coordi, @function
_Z20compute_K_matrix_gpuiPdP10node_coordi:
.LFB2074:
	.cfi_startproc
	endbr64
	jmp	_Z55__device_stub__Z20compute_K_matrix_gpuiPdP10node_coordiiPdP10node_coordi
	.cfi_endproc
.LFE2074:
	.size	_Z20compute_K_matrix_gpuiPdP10node_coordi, .-_Z20compute_K_matrix_gpuiPdP10node_coordi
	.globl	_Z41__device_stub__Z15device_run_choliPdS_S_iiPdS_S_i
	.type	_Z41__device_stub__Z15device_run_choliPdS_S_iiPdS_S_i, @function
_Z41__device_stub__Z15device_run_choliPdS_S_iiPdS_S_i:
.LFB2075:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 28(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, 24(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movq	%rsp, %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L146
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z15device_run_choliPdS_S_i(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L146:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L148
	call	__stack_chk_fail@PLT
.L148:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2075:
	.size	_Z41__device_stub__Z15device_run_choliPdS_S_iiPdS_S_i, .-_Z41__device_stub__Z15device_run_choliPdS_S_iiPdS_S_i
	.globl	_Z15device_run_choliPdS_S_i
	.type	_Z15device_run_choliPdS_S_i, @function
_Z15device_run_choliPdS_S_i:
.LFB2076:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z15device_run_choliPdS_S_iiPdS_S_i
	.cfi_endproc
.LFE2076:
	.size	_Z15device_run_choliPdS_S_i, .-_Z15device_run_choliPdS_S_i
	.section	.rodata.str1.1
.LC16:
	.string	"Invalid number of input arguements. Please execute the binary as ./a.out m x* y*\n"
.LC17:
	.string	"Size: %d \n"
.LC18:
	.string	"Given coordinates (%f, %f)\n"
.LC19:
	.string	"Predicted value is %lf\n"
.LC20:
	.string	"Actual value is %lf\n"
.LC21:
	.string	"Time Taken by Cholesky = %f ms\n"
.LC22:
	.string	"Time Taken by Solver = %f ms\n"
.LC23:
	.string	"Overall Time Taken = %f ms\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2046:
	.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
	movl	%edi, %ebp
	movl	$16, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	call	malloc@PLT
	cmpl	$4, %ebp
	je	.L152
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L153
.L152:
	movq	8(%rbx), %rdi
	movq	%rax, %r14
	call	atoi@PLT
	movq	16(%rbx), %rdi
	movl	%eax, %r12d
	call	atof@PLT
	movq	24(%rbx), %rdi
	movl	%r12d, %ebx
	movsd	%xmm0, (%r14)
	imull	%r12d, %ebx
	movsd	%xmm0, 8(%rsp)
	call	atof@PLT
	movl	%r12d, %edx
	movl	$2, %edi
	xorl	%eax, %eax
	movsd	%xmm0, 8(%r14)
	leaq	.LC17(%rip), %rsi
	movsd	%xmm0, 16(%rsp)
	call	__printf_chk@PLT
	movsd	16(%rsp), %xmm1
	movsd	8(%rsp), %xmm0
	movb	$2, %al
	leaq	.LC18(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	leal	1(%r12), %eax
	movsd	.LC11(%rip), %xmm0
	cvtsi2sdl	%eax, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, 24(%rsp)
	call	_Z13getNumThreadsv
	movslq	%ebx, %r8
	movq	%r8, %r15
	movq	%r8, (%rsp)
	movl	%eax, %ebp
	salq	$4, %r15
	movq	%r15, %rdi
	call	malloc@PLT
	movsd	24(%rsp), %xmm0
	movl	%r12d, %esi
	movq	%rax, %rdi
	movq	%rax, %r13
	call	_Z17initialize_pointsP10node_coordid
	movq	%r15, %rsi
	leaq	80(%rsp), %rdi
	call	_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0
	movq	80(%rsp), %rdi
	movq	%r15, %rdx
	movq	%r13, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	%ebx, %edi
	call	_Z16alloc_mem_matrixi
	movl	%ebx, %edx
	movq	%r13, %rsi
	movq	%rax, %rdi
	movq	%rax, %r15
	call	_Z23calculate_observed_dataPPdP10node_coordi
	movq	(%rsp), %r8
	leaq	88(%rsp), %rdi
	imulq	%r8, %r8
	leaq	0(,%r8,8), %rax
	movq	%rax, %rsi
	movq	%rax, (%rsp)
	call	cudaMallocHost@PLT
	movq	88(%rsp), %rsi
	xorl	%ecx, %ecx
	movl	%ebx, %edx
	movq	%r15, %rdi
	call	_Z13convert_arrayPPdS_ib
	movl	%ebx, %edi
	call	_Z16alloc_mem_matrixi
	movq	(%rsp), %rdi
	movq	%rax, %r15
	call	malloc@PLT
	movl	%ebx, %ecx
	movq	%r13, %rdx
	movq	%r14, %rsi
	movq	%r15, %rdi
	movq	%rax, 24(%rsp)
	call	_Z9compute_kPPdP10node_coordS2_i
	movq	24(%rsp), %rsi
	xorl	%ecx, %ecx
	movl	%ebx, %edx
	movq	%r15, %rdi
	call	_Z13convert_arrayPPdS_ib
	leaq	48(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	56(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	(%rsp), %rsi
	leaq	96(%rsp), %rdi
	call	_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	%ebp, 136(%rsp)
	movq	%rdi, 140(%rsp)
	movl	144(%rsp), %ecx
	movq	136(%rsp), %rdx
	movq	%rdi, 120(%rsp)
	movl	$1, 128(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L154
	movq	80(%rsp), %rdx
	movq	96(%rsp), %rsi
	movl	%r12d, %ecx
	movl	%ebp, %edi
	call	_Z55__device_stub__Z20compute_K_matrix_gpuiPdP10node_coordiiPdP10node_coordi
.L154:
	movq	(%rsp), %rsi
	leaq	104(%rsp), %rdi
	call	_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0
	movslq	%ebp, %rsi
	leaq	112(%rsp), %rdi
	salq	$3, %rsi
	call	_Z10cudaMallocIdE9cudaErrorPPT_m.isra.0
	leaq	64(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	72(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	64(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	48(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	%ebp, 136(%rsp)
	movq	%rdi, 140(%rsp)
	movl	144(%rsp), %ecx
	movq	136(%rsp), %rdx
	movq	%rdi, 120(%rsp)
	movl	$1, 128(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L155
	movq	112(%rsp), %rcx
	movq	104(%rsp), %rdx
	movl	%ebx, %r8d
	movl	%ebp, %edi
	movq	96(%rsp), %rsi
	call	_Z41__device_stub__Z15device_run_choliPdS_S_iiPdS_S_i
.L155:
	movq	72(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	72(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	leaq	120(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	136(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	120(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	88(%rsp), %rdx
	movl	%ebp, %r8d
	movl	%ebx, %ecx
	movq	24(%rsp), %rsi
	movq	104(%rsp), %rdi
	call	_Z10run_solverPdS_S_ii
	movq	136(%rsp), %rdi
	xorl	%esi, %esi
	movsd	%xmm0, (%rsp)
	call	cudaEventRecord@PLT
	movq	136(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	56(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	56(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movsd	(%rsp), %xmm0
	leaq	.LC19(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	call	__printf_chk@PLT
	movsd	.LC10(%rip), %xmm2
	movsd	8(%rsp), %xmm0
	movsd	16(%rsp), %xmm1
	movsd	.LC11(%rip), %xmm3
	subsd	%xmm2, %xmm0
	subsd	%xmm2, %xmm1
	mulsd	%xmm0, %xmm0
	mulsd	%xmm1, %xmm1
	addsd	%xmm1, %xmm0
	subsd	%xmm0, %xmm3
	movsd	%xmm3, (%rsp)
	call	rand@PLT
	leaq	.LC20(%rip), %rsi
	movl	$2, %edi
	cvtsi2sdl	%eax, %xmm0
	divsd	.LC12(%rip), %xmm0
	movb	$1, %al
	addsd	(%rsp), %xmm0
	subsd	.LC13(%rip), %xmm0
	call	__printf_chk@PLT
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rsi
	leaq	36(%rsp), %rdi
	call	cudaEventElapsedTime@PLT
	movq	72(%rsp), %rdx
	movq	64(%rsp), %rsi
	leaq	40(%rsp), %rdi
	call	cudaEventElapsedTime@PLT
	movq	120(%rsp), %rsi
	leaq	44(%rsp), %rdi
	movq	136(%rsp), %rdx
	call	cudaEventElapsedTime@PLT
	leaq	.LC21(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	40(%rsp), %xmm0
	call	__printf_chk@PLT
	movl	$2, %edi
	movb	$1, %al
	leaq	.LC22(%rip), %rsi
	cvtss2sd	44(%rsp), %xmm0
	call	__printf_chk@PLT
	leaq	.LC23(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	36(%rsp), %xmm0
	call	__printf_chk@PLT
.L153:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L156
	call	__stack_chk_fail@PLT
.L156:
	addq	$168, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2046:
	.size	main, .-main
	.section	.rodata.str1.1
.LC24:
	.string	"_Z15device_run_choliPdS_S_i"
.LC25:
	.string	"_Z20compute_K_matrix_gpuiPdP10node_coordi"
.LC26:
	.string	"_Z15gpu_matrix_multPdS_S_iii"
.LC27:
	.string	"n"
.LC28:
	.string	"count"
.LC29:
	.string	"node_coord"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2078:
	.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	.LC24(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z15device_run_choliPdS_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	.LC25(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z20compute_K_matrix_gpuiPdP10node_coordi(%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	.LC26(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z15gpu_matrix_multPdS_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
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC27(%rip), %rdx
	movl	$4, %r9d
	leaq	_ZL1n(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC28(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL5count(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC29(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movl	$16, %r9d
	movq	%rdx, %rcx
	leaq	_ZL10node_coord(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%r8
	.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
.LFE2078:
	.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
	.local	_ZL10node_coord
	.comm	_ZL10node_coord,16,16
	.globl	BLOCK_SIZE
	.data
	.align 4
	.type	BLOCK_SIZE, @object
	.size	BLOCK_SIZE, 4
BLOCK_SIZE:
	.long	16
	.local	_ZL5count
	.comm	_ZL5count,4,4
	.local	_ZL1n
	.comm	_ZL1n,4,4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC10:
	.long	0
	.long	1071644672
	.align 8
.LC11:
	.long	0
	.long	1072693248
	.align 8
.LC12:
	.long	-2621440
	.long	1108606975
	.align 8
.LC13:
	.long	-1717986918
	.long	1068079513
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC15:
	.long	0
	.long	-2147483648
	.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 <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <hip/hip_runtime.h>


#define NOISE 0.01
#define GET_RAND ((double)rand()/(10.0 * (double)RAND_MAX)) - 0.05
#define  SIZE 10000
typedef double VECTOR[SIZE];
__device__ int n;
__device__ int count;

int BLOCK_SIZE = 16;
__device__ struct node_coord {
    double x;
    double y;
}node_coord;

double** alloc_mem_matrix (int n)
{
    double **matrix = NULL;
    matrix = (double**) calloc (n, sizeof(double*));
    for(int i = 0; i < n; i++)
    {
        matrix[i] = (double*) calloc (n, sizeof(double));
    }
    return matrix;
}


void printK(double *K, int m){
    double *host_K = (double*) malloc(m * m * sizeof(double));
    hipMemcpy(host_K, K, m * m * sizeof(double), hipMemcpyDeviceToHost);
    printf("\n Device K ---------------------------------- \n");
    int id = 0;
    for(int i=0; i<m; i++){
        for(int j=0; j<m; j++){
            printf("(%5.5lf) ", host_K[id]);
            id++;
        }
        printf("\n");
    }
}

__global__ void gpu_matrix_mult(double *a,double *b, double *c, int m, int n, int k)
{ 
    int row = blockIdx.y * blockDim.y + threadIdx.y; 
    int col = blockIdx.x * blockDim.x + threadIdx.x;
    double sum = 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;
    }
} 

int _ConvertSMVer2Cores(int major, int minor) {

    typedef struct {
        int SM; 
        int Cores;
    } sSMtoCores;

    sSMtoCores nGpuArchCoresPerSM[] = {
        { 0x20, 32 }, // Fermi Generation (SM 2.0) GF100 class
        { 0x21, 48 }, // Fermi Generation (SM 2.1) GF10x class
        { 0x30, 192}, // Kepler Generation (SM 3.0) GK10x class
        { 0x32, 192}, // Kepler Generation (SM 3.2) GK10x class
        { 0x35, 192}, // Kepler Generation (SM 3.5) GK11x class
        { 0x37, 192}, // Kepler Generation (SM 3.7) GK21x class
        { 0x50, 128}, // Maxwell Generation (SM 5.0) GM10x class
        { 0x52, 128}, // Maxwell Generation (SM 5.2) GM20x class
        { 0x53, 128}, // Maxwell Generation (SM 5.3) GM20x class
        { 0x60, 64 }, // Pascal Generation (SM 6.0) GP100 class
        { 0x61, 128}, // Pascal Generation (SM 6.1) GP10x class
        { 0x62, 128}, // Pascal Generation (SM 6.2) GP10x class
        {   -1, -1 }
    };
    int index = 0;

    while (nGpuArchCoresPerSM[index].SM != -1) {
        if (nGpuArchCoresPerSM[index].SM == ((major << 4) + minor)) {
            return nGpuArchCoresPerSM[index].Cores;
        }
        index++;
    }
    return nGpuArchCoresPerSM[index-1].Cores;
}

int getNumThreads(){
    int num_threads = 0;
    int deviceCount;
    hipGetDeviceCount(&deviceCount);
    for (int device = 0; device < deviceCount; device++) 
    {
        hipDeviceProp_t deviceProp;
        hipGetDeviceProperties(&deviceProp, device);
        int curr_t =  _ConvertSMVer2Cores(deviceProp.major, deviceProp.minor);
        if(curr_t > num_threads)
            num_threads = curr_t;
    }
    return(num_threads);
}

void print_matrix (char *msg, double** matrix, int n)
{
    printf("\n --------------------- %s --------------------- \n", msg);
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            printf("%4.9lf ", matrix[i][j]);
        }
        printf("\n");
    }
    printf("\n");
    printf("\n");
}


void print_1d_matrix (char *msg, double* matrix, int n)
{
    printf("\n --------------------- %s --------------------- \n", msg);
    int id = 0;
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            printf("%4.9lf ", matrix[id++]);
        }
        printf("\n");
    }
    printf("\n");
    printf("\n");
}

void print_points (struct node_coord *grid_points, int m)
{
    int id = 0;
    printf("\n --------------------- Printing grid coordinates --------------------- \n");
    for(int i = 0; i < m; i++)
    {
        for(int j = 0; j < m; j++)
        {
            printf("(%3.5lf %3.5lf) ", grid_points[id].x, grid_points[id].y);
            id++;
        }
        printf("\n");
    }

}

void print_data (double *data_points, int n)
{
    printf("\n --------------------- Printing data points --------------------- \n");
    for(int id = 0; id < n; id++)
    {
        printf ("%3.5lf  ", data_points[id]);
    }
    printf("\n");

}
void initialize_points (struct node_coord *grid_points, int m, double h)
{
    int id = 0;
    for(int i = 1; i <= m; i++)
    {
        for(int j = 1; j <= m; j++)
        {
            grid_points[id].x = i * h;
            grid_points[id].y = j * h;
            id++;
        }
    }
}

void calculate_observed_data (double **observed_data_points, struct node_coord *grid_points, int n)
{
    for(int id = 0; id < n; id++)
    {
        observed_data_points[0][id] = 1 - (((grid_points[id].x - 0.5) * (grid_points[id].x - 0.5)) +
                       ((grid_points[id].y - 0.5) * (grid_points[id].y - 0.5))) + GET_RAND;
    }

}


__global__ void compute_K_matrix_gpu (int num_threads, double *K, struct node_coord *grid_points, int m)
{
    n = m * m;
    double temp_x, temp_y;

    for(int i = threadIdx.x; i < n; i+= num_threads)
    {
        for (int j = 0; j < n; j++)
        {
            temp_x = (grid_points[i].x - grid_points[j].x) * (grid_points[i].x - grid_points[j].x);
            temp_y = (grid_points[i].y - grid_points[j].y) * (grid_points[i].y - grid_points[j].y);
            K[i*n + j] = exp(-1 * (temp_x + temp_y));
            if (i == j)
                K[i*n + j] += NOISE;
        }
    }
}


__device__ void get_total_sum(double *partial_sum, int dummy) {
    if(threadIdx.x == 0) {
        count = dummy;
        if(count % 2 != 0)
            count++;
        for(int i = 1; i < count; i++)
            partial_sum[0] += partial_sum[i];
    }
}

__global__ void device_run_chol(int num_threads, double *K, double *L, double *partial_sum, int n) {
    for(int k = 0; k < n; k++) {
        for(int i = 0; i < n; i++) {
            if(i == k) {
                partial_sum[threadIdx.x] = 0;
                for(int j = threadIdx.x; j < k; j += num_threads) {
                    partial_sum[threadIdx.x] = partial_sum[threadIdx.x] + pow((L[k * n + j]), 2);
                }
                __syncthreads();
                get_total_sum(partial_sum, (num_threads<k)?num_threads:k);
                if(threadIdx.x == 0) {
                    L[i * n + i] = sqrt(K[k * n + k] - partial_sum[0]);
                }
            } else if( i > k) {
                partial_sum[threadIdx.x] = 0;
                for(int j = threadIdx.x; j < k; j += num_threads) {
                    partial_sum[threadIdx.x] = partial_sum[threadIdx.x] + L[i * n + j] * L[k * n + j];
                }
                __syncthreads();
                get_total_sum(partial_sum, (num_threads<k)?num_threads:k);
                if(threadIdx.x == 0) {
                    L[i * n + k] = K[i * n + k] - partial_sum[0];
                    L[i * n + k] /= L[k * n + k];
                }
            } else {
                if(threadIdx.x == 0)
                    L[i * n + k] = 0;
            }
            __syncthreads();
        }
    }
}


void compute_matrix_part_1 (double** matrix, int row_beg, int col_beg, int row_end, int col_end, int mid, int n)
{
    double *res1 = (double*) malloc((mid + 1) * sizeof(double));
    for(int j = col_beg + mid + 1; j < col_end + 1; ++j)
    {
        for(int i = row_beg; i < row_beg + mid + 1; ++i)
        {
            res1[i - row_beg] = 0;
            for(int k = 0; k < mid + 1; ++k)
            {
                res1[i - row_beg] += -1 * matrix[i][col_beg + k] * matrix[row_beg + k][j];
            }
        }
        for(int l = 0; l < mid + 1; ++l)
        {
            matrix[row_beg + l][j] = res1[l];
        }
    }
}

void compute_matrix_part_2 (double** matrix, int row_beg, int col_beg, int row_end, int col_end, int mid, int n)
{
    double *res2 = (double*) malloc ((n - mid - 1) * sizeof(double));
    for(int i = row_beg; i < row_beg + mid + 1; ++i)
    {
        for(int j = col_beg + mid + 1; j < col_beg + n; ++j)
        {
            res2 [j - col_beg - mid - 1] = 0;
            for(int k = 0; k < n - mid - 1; ++k)
            {
                res2[j - col_beg - mid - 1] += matrix[i][col_beg + mid + 1 + k] * matrix[row_beg + mid + 1 + k][j];
            }
        }
        for(int l = 0; l < n - mid - 1; ++l)
        {
            matrix[i][col_beg + mid + 1 + l] = res2[l];
        }
    }
}

void compute_inverse (double** matrix, int row_beg, int col_beg, int row_end, int col_end)
{
    int n = row_end - row_beg + 1;

    if(n == 1)
    {
        matrix[row_beg][col_beg] = 1 / matrix[row_beg][col_beg];
        return;
    }

    int mid = (n - 1) / 2;

    compute_inverse(matrix, row_beg, col_beg, row_beg + mid, col_beg + mid);
    compute_inverse(matrix, row_beg + mid + 1, col_beg + mid + 1, row_end, col_end);
    compute_matrix_part_1 (matrix, row_beg, col_beg, row_end, col_end, mid, n);
    compute_matrix_part_2 (matrix, row_beg, col_beg, row_end, col_end, mid, n);
}


void compute_k (double **k, struct node_coord *rstar, struct node_coord *grid_points, int n)
{
    double temp_x, temp_y;

    for (int i = 0; i < n; i++)
    {
        temp_x = (grid_points[i].x - rstar[0].x) * (grid_points[i].x - rstar[0].x);
        temp_y = (grid_points[i].y - rstar[0].y) * (grid_points[i].y - rstar[0].y);
        k[0][i] = exp(-1 * (temp_x + temp_y));
    }
}

void convert_array (double ** host_K, double * matrix, int n, bool convert_2d)
{
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            if (convert_2d)
                host_K[i][j] = matrix[i*n + j];
            else
                matrix[i*n + j] = host_K[i][j];

        }
    }
}

void get_transpose (double ** host_L, double **host_U, int n)
{

    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            host_U[j][i] = host_L[i][j];
        }
    }
}

void duplicate_matrix (double** input_matrix, double** output_matrix, int n)
{
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            output_matrix[i][j] = input_matrix[i][j];
        }
    }
}

double run_solver (double *L, double *k_out, double *host_obs_data, int n, int num_threads)
{
    unsigned int grid_rows = (n + BLOCK_SIZE - 1) / BLOCK_SIZE;
    unsigned int grid_cols = (1 + BLOCK_SIZE - 1) / BLOCK_SIZE;
    dim3 dimGrid(grid_cols, grid_rows);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);
    double **host_L = alloc_mem_matrix (n);
    double **host_U = alloc_mem_matrix (n);
    double **host_U_trans = alloc_mem_matrix (n);
    double *L_host = (double*) malloc(n * n *sizeof(double));
    hipMemcpy(L_host, L, n * n * sizeof(double), hipMemcpyDeviceToHost);
    convert_array(host_L, L_host, n, true);
    get_transpose (host_L, host_U, n);

    compute_inverse(host_U, 0, 0, n - 1, n - 1);

    duplicate_matrix (host_U, host_U_trans, n);
    get_transpose (host_U, host_U_trans, n);
    double *host_inv = (double*) malloc(n * n *sizeof(double));
    convert_array(host_U, host_inv, n, false);
    double *host_inv_trans = (double*) malloc(n * n *sizeof(double));
    convert_array(host_U_trans, host_inv_trans, n, false);


    double *device_k_out, *device_host_inv, *device_host_inv_trans, *device_obs_data;
    hipMalloc(&device_k_out, (n * n * sizeof(double)));
    hipMalloc(&device_host_inv, (n * n * sizeof(double)));
    hipMemcpy(device_k_out, k_out, n* n * sizeof(double), hipMemcpyHostToDevice);
    hipMemcpy(device_host_inv, host_inv, n* n * sizeof(double), hipMemcpyHostToDevice);

    hipMalloc(&device_host_inv_trans, (n * n * sizeof(double)));
    hipMalloc(&device_obs_data, (n * n * sizeof(double)));
    hipMemcpy(device_host_inv_trans, host_inv_trans, n* n * sizeof(double), hipMemcpyHostToDevice);
    hipMemcpy(device_obs_data, host_obs_data, n* n * sizeof(double), hipMemcpyHostToDevice);

    double *product1;
    hipMalloc(&product1, (n * n * sizeof(double)));
    gpu_matrix_mult<<<1, num_threads>>> (device_k_out, device_host_inv,product1, n, n , n);

    double *h_a, *h_b, *h_c;
    hipHostMalloc((void **) &h_a, sizeof(double)*n*n, hipHostMallocDefault);
    hipHostMalloc((void **) &h_b, sizeof(double)*n*1, hipHostMallocDefault);
    hipHostMalloc((void **) &h_c, sizeof(double)*n*1, hipHostMallocDefault);

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            h_a[i * n + j] = host_inv_trans[i*n + j];
        }
    }

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < 1; ++j) {
            h_b[i * 1 + j] = host_obs_data[i*1 + j];
        }
    }

    double *d_a, *d_b, *d_c;
    hipMalloc((void **) &d_a, sizeof(double)*n*n);
    hipMalloc((void **) &d_b, sizeof(double)*n*1);
    hipMalloc((void **) &d_c, sizeof(double)*n*1);

    hipMemcpy(d_a, h_a, sizeof(double)*n*n, hipMemcpyHostToDevice);
    hipMemcpy(d_b, h_b, sizeof(double)*n*1, hipMemcpyHostToDevice);


    gpu_matrix_mult<<<dimGrid, dimBlock>>>(d_a, d_b, d_c, n, n, 1);
    hipMemcpy(h_c, d_c, sizeof(double)*n*1, hipMemcpyDeviceToHost);

    double *final_product;
    hipMalloc(&final_product, (n * n * sizeof(double)));
    
    gpu_matrix_mult<<<dimGrid, dimBlock>>> (product1, d_c, final_product, 1, n , 1);
    double *predicted_value = (double*) malloc(n * n * sizeof(double));
    hipMemcpy(predicted_value, final_product, n * n * sizeof(double), hipMemcpyDeviceToHost);
    return predicted_value[0];

}
int main(int argc, char* argv[])
{
    struct node_coord *rstar = (struct node_coord *) malloc (1 * sizeof (struct node_coord));
    int m;
    int n;
    double h;

    if(argc != 4)
    {
        printf("Invalid number of input arguements. Please execute the binary as ./a.out m x* y*\n");
        return 0;
    }
    else
    {
        m = atoi(argv[1]);
        rstar[0].x = atof(argv[2]);
        rstar[0].y = atof(argv[3]);
        printf("Size: %d \n", m);
        printf("Given coordinates (%f, %f)\n", rstar[0].x, rstar[0].y);
    }

    n = m * m;
    h = 1.0 / (double)(m + 1);
    int num_threads = getNumThreads();
    hipEvent_t start_overall, end_overall, start_LU, end_LU, start_solver, end_solver;

    struct node_coord *grid_points = (struct node_coord *) malloc (n * sizeof (struct node_coord));
    initialize_points (grid_points, m, h);


    struct node_coord *device_grid_points;
    hipMalloc(&device_grid_points, (n * sizeof(struct node_coord)));
    hipMemcpy(device_grid_points, grid_points, n * sizeof(struct node_coord), hipMemcpyHostToDevice);


    double **observed_data_points = alloc_mem_matrix (n);
    calculate_observed_data (observed_data_points, grid_points, n);
    double *host_obs_data;
    hipHostMalloc((void **) &host_obs_data, sizeof(double)*n*n, hipHostMallocDefault);
    convert_array (observed_data_points, host_obs_data, n , false);

    double **k = alloc_mem_matrix (n);
    double *k_out = (double*) malloc(n * n *sizeof(double));
    compute_k (k, rstar, grid_points, n);
    convert_array(k, k_out, n, false);

    unsigned int grid_rows = (n + BLOCK_SIZE - 1) / BLOCK_SIZE;
    unsigned int grid_cols = (1 + BLOCK_SIZE - 1) / BLOCK_SIZE;
    dim3 dimGrid(grid_cols, grid_rows);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);

    hipEventCreate(&start_overall);
    hipEventCreate(&end_overall);
    double *K1;
    hipMalloc(&K1, (n * n * sizeof(double)));
    compute_K_matrix_gpu<<<1, num_threads>>>(num_threads, K1, device_grid_points, m);

    double *L, *partial_sum;
    hipMalloc(&L, (n * n * sizeof(double)));
    hipMalloc(&partial_sum, num_threads * sizeof(double));
    hipEventCreate(&start_LU);
    hipEventCreate(&end_LU);
    hipEventRecord(start_LU, 0);
    hipEventRecord(start_overall, 0);

    device_run_chol<<<1,num_threads>>>(num_threads, K1, L, partial_sum, n);
    hipEventRecord(end_LU, 0);
    hipEventSynchronize(end_LU);


    hipEventCreate(&start_solver);
    hipEventCreate(&end_solver);
    hipEventRecord(start_solver, 0);
    double predicted_value = run_solver (L, k_out, host_obs_data, n, num_threads);
    hipEventRecord(end_solver, 0);
    hipEventSynchronize(end_solver);
    hipEventRecord(end_overall, 0);
    hipEventSynchronize(end_overall);

    printf ("Predicted value is %lf\n", predicted_value);

    double actual_value = 1 - (((rstar[0].x - 0.5) * (rstar[0].x - 0.5)) +
            ((rstar[0].y - 0.5) * (rstar[0].y - 0.5))) + GET_RAND;

    printf ("Actual value is %lf\n", actual_value);
    float time_overall, time_LU, time_solver;
    hipEventElapsedTime(&time_overall, start_overall, end_overall);
    hipEventElapsedTime(&time_LU, start_LU, end_LU);
    hipEventElapsedTime(&time_solver, start_solver, end_solver);


    printf("Time Taken by Cholesky = %f ms\n", time_LU);
    printf("Time Taken by Solver = %f ms\n", time_solver);
    printf("Overall Time Taken = %f ms\n", time_overall);
    return 0;
}


	.text
	.file	"GPR.hip"
	.globl	_Z16alloc_mem_matrixi           # -- Begin function _Z16alloc_mem_matrixi
	.type	_Z16alloc_mem_matrixi,@function
_Z16alloc_mem_matrixi:                  # @_Z16alloc_mem_matrixi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edi, %ebp
	movslq	%edi, %rbx
	movl	$8, %esi
	movq	%rbx, %rdi
	callq	calloc
	movq	%rax, %r14
	testl	%ebx, %ebx
	jle	.LBB0_3
# %bb.1:                                # %.lr.ph.preheader
	movl	%ebp, %r15d
	xorl	%r12d, %r12d
.LBB0_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	$8, %esi
	movq	%rbx, %rdi
	callq	calloc
	movq	%rax, (%r14,%r12,8)
	incq	%r12
	cmpq	%r12, %r15
	jne	.LBB0_2
.LBB0_3:                                # %._crit_edge
	movq	%r14, %rax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z16alloc_mem_matrixi, .Lfunc_end0-_Z16alloc_mem_matrixi
	.cfi_endproc
                                        # -- End function
	.globl	_Z6printKPdi                    # -- Begin function _Z6printKPdi
	.type	_Z6printKPdi,@function
_Z6printKPdi:                           # @_Z6printKPdi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%esi, %ebp
	movq	%rdi, %r14
	movl	%esi, %r15d
	imull	%r15d, %r15d
	shlq	$3, %r15
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, %rbx
	movq	%rax, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$.Lstr, %edi
	callq	puts@PLT
	testl	%ebp, %ebp
	jle	.LBB1_5
# %bb.1:                                # %.lr.ph.preheader.preheader
	movl	%ebp, %r14d
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
.LBB1_2:                                # %.lr.ph.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_3 Depth 2
	movslq	%r12d, %r12
	leaq	(%rbx,%r12,8), %rbp
	xorl	%r13d, %r13d
.LBB1_3:                                # %.lr.ph
                                        #   Parent Loop BB1_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rbp,%r13,8), %xmm0            # xmm0 = mem[0],zero
	movl	$.L.str.1, %edi
	movb	$1, %al
	callq	printf
	incq	%r13
	cmpl	%r13d, %r14d
	jne	.LBB1_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB1_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incl	%r15d
	addq	%r13, %r12
	cmpl	%r14d, %r15d
	jne	.LBB1_2
.LBB1_5:                                # %._crit_edge21
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z6printKPdi, .Lfunc_end1-_Z6printKPdi
	.cfi_endproc
                                        # -- End function
	.globl	_Z30__device_stub__gpu_matrix_multPdS_S_iii # -- Begin function _Z30__device_stub__gpu_matrix_multPdS_S_iii
	.type	_Z30__device_stub__gpu_matrix_multPdS_S_iii,@function
_Z30__device_stub__gpu_matrix_multPdS_S_iii: # @_Z30__device_stub__gpu_matrix_multPdS_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	$_Z15gpu_matrix_multPdS_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_end2:
	.size	_Z30__device_stub__gpu_matrix_multPdS_S_iii, .Lfunc_end2-_Z30__device_stub__gpu_matrix_multPdS_S_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z19_ConvertSMVer2Coresii       # -- Begin function _Z19_ConvertSMVer2Coresii
	.type	_Z19_ConvertSMVer2Coresii,@function
_Z19_ConvertSMVer2Coresii:              # @_Z19_ConvertSMVer2Coresii
	.cfi_startproc
# %bb.0:
	shll	$4, %edi
	addl	%esi, %edi
	movl	$32, %eax
	movq	$-96, %rdx
.LBB3_1:                                # =>This Inner Loop Header: Depth=1
	movq	%rdx, %rcx
	cmpl	%edi, %eax
	je	.LBB3_3
# %bb.2:                                #   in Loop: Header=BB3_1 Depth=1
	movl	.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM+104(%rcx), %eax
	movq	%rcx, %rdx
	addq	$8, %rdx
	jne	.LBB3_1
.LBB3_3:                                # %.loopexit
	movl	.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM+100(%rcx), %eax
	retq
.Lfunc_end3:
	.size	_Z19_ConvertSMVer2Coresii, .Lfunc_end3-_Z19_ConvertSMVer2Coresii
	.cfi_endproc
                                        # -- End function
	.globl	_Z13getNumThreadsv              # -- Begin function _Z13getNumThreadsv
	.type	_Z13getNumThreadsv,@function
_Z13getNumThreadsv:                     # @_Z13getNumThreadsv
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$1488, %rsp                     # imm = 0x5D0
	.cfi_def_cfa_offset 1520
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	leaq	12(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipGetDeviceCount
	cmpl	$0, (%rbx)
	jle	.LBB4_1
# %bb.3:                                # %.lr.ph
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r14
	xorl	%ebp, %ebp
.LBB4_4:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_5 Depth 2
	movq	%r14, %rdi
	movl	%ebp, %esi
	callq	hipGetDevicePropertiesR0600
	movl	376(%rsp), %eax
	shll	$4, %eax
	addl	380(%rsp), %eax
	movl	$32, %ecx
	movq	$-96, %rsi
.LBB4_5:                                #   Parent Loop BB4_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%rsi, %rdx
	cmpl	%eax, %ecx
	je	.LBB4_7
# %bb.6:                                #   in Loop: Header=BB4_5 Depth=2
	movl	.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM+104(%rdx), %ecx
	movq	%rdx, %rsi
	addq	$8, %rsi
	jne	.LBB4_5
.LBB4_7:                                # %_Z19_ConvertSMVer2Coresii.exit
                                        #   in Loop: Header=BB4_4 Depth=1
	movl	.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM+100(%rdx), %eax
	cmpl	%ebx, %eax
	cmovgl	%eax, %ebx
	incl	%ebp
	cmpl	12(%rsp), %ebp
	jl	.LBB4_4
	jmp	.LBB4_2
.LBB4_1:
	xorl	%ebx, %ebx
.LBB4_2:                                # %._crit_edge
	movl	%ebx, %eax
	addq	$1488, %rsp                     # imm = 0x5D0
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z13getNumThreadsv, .Lfunc_end4-_Z13getNumThreadsv
	.cfi_endproc
                                        # -- End function
	.globl	_Z12print_matrixPcPPdi          # -- Begin function _Z12print_matrixPcPPdi
	.type	_Z12print_matrixPcPPdi,@function
_Z12print_matrixPcPPdi:                 # @_Z12print_matrixPcPPdi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %ebp
	movq	%rsi, %rbx
	movq	%rdi, %rsi
	movl	$.L.str.3, %edi
	xorl	%eax, %eax
	callq	printf
	testl	%ebp, %ebp
	jle	.LBB5_5
# %bb.1:                                # %.preheader.lr.ph
	movl	%ebp, %r14d
	xorl	%r15d, %r15d
.LBB5_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_3 Depth 2
	xorl	%r12d, %r12d
.LBB5_3:                                #   Parent Loop BB5_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	(%rbx,%r15,8), %rax
	movsd	(%rax,%r12,8), %xmm0            # xmm0 = mem[0],zero
	movl	$.L.str.4, %edi
	movb	$1, %al
	callq	printf
	incq	%r12
	cmpq	%r12, %r14
	jne	.LBB5_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB5_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%r15
	cmpq	%r14, %r15
	jne	.LBB5_2
.LBB5_5:                                # %._crit_edge15
	movl	$10, %edi
	callq	putchar@PLT
	movl	$10, %edi
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT                     # TAILCALL
.Lfunc_end5:
	.size	_Z12print_matrixPcPPdi, .Lfunc_end5-_Z12print_matrixPcPPdi
	.cfi_endproc
                                        # -- End function
	.globl	_Z15print_1d_matrixPcPdi        # -- Begin function _Z15print_1d_matrixPcPdi
	.type	_Z15print_1d_matrixPcPdi,@function
_Z15print_1d_matrixPcPdi:               # @_Z15print_1d_matrixPcPdi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %ebp
	movq	%rsi, %rbx
	movq	%rdi, %rsi
	xorl	%r14d, %r14d
	movl	$.L.str.3, %edi
	xorl	%eax, %eax
	callq	printf
	testl	%ebp, %ebp
	jle	.LBB6_5
# %bb.1:                                # %.lr.ph.preheader.preheader
	movl	%ebp, %r15d
	xorl	%r12d, %r12d
.LBB6_2:                                # %.lr.ph.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_3 Depth 2
	movslq	%r12d, %r12
	leaq	(%rbx,%r12,8), %rbp
	xorl	%r13d, %r13d
.LBB6_3:                                # %.lr.ph
                                        #   Parent Loop BB6_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rbp,%r13,8), %xmm0            # xmm0 = mem[0],zero
	movl	$.L.str.4, %edi
	movb	$1, %al
	callq	printf
	incq	%r13
	cmpl	%r13d, %r15d
	jne	.LBB6_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB6_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incl	%r14d
	addq	%r13, %r12
	cmpl	%r15d, %r14d
	jne	.LBB6_2
.LBB6_5:                                # %._crit_edge17
	movl	$10, %edi
	callq	putchar@PLT
	movl	$10, %edi
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT                     # TAILCALL
.Lfunc_end6:
	.size	_Z15print_1d_matrixPcPdi, .Lfunc_end6-_Z15print_1d_matrixPcPdi
	.cfi_endproc
                                        # -- End function
	.globl	_Z12print_pointsP10node_coordi  # -- Begin function _Z12print_pointsP10node_coordi
	.type	_Z12print_pointsP10node_coordi,@function
_Z12print_pointsP10node_coordi:         # @_Z12print_pointsP10node_coordi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%esi, %ebp
	movq	%rdi, %rbx
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	testl	%ebp, %ebp
	jle	.LBB7_5
# %bb.1:                                # %.lr.ph.preheader.preheader
	movl	%ebp, %r14d
	addq	$8, %rbx
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
.LBB7_2:                                # %.lr.ph.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_3 Depth 2
	movslq	%r12d, %r12
	movq	%r12, %rbp
	shlq	$4, %rbp
	addq	%rbx, %rbp
	xorl	%r13d, %r13d
.LBB7_3:                                # %.lr.ph
                                        #   Parent Loop BB7_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	-8(%rbp), %xmm0                 # xmm0 = mem[0],zero
	movsd	(%rbp), %xmm1                   # xmm1 = mem[0],zero
	movl	$.L.str.6, %edi
	movb	$2, %al
	callq	printf
	addq	$16, %rbp
	incq	%r13
	cmpl	%r13d, %r14d
	jne	.LBB7_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB7_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incl	%r15d
	addq	%r13, %r12
	cmpl	%r14d, %r15d
	jne	.LBB7_2
.LBB7_5:                                # %._crit_edge17
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_Z12print_pointsP10node_coordi, .Lfunc_end7-_Z12print_pointsP10node_coordi
	.cfi_endproc
                                        # -- End function
	.globl	_Z10print_dataPdi               # -- Begin function _Z10print_dataPdi
	.type	_Z10print_dataPdi,@function
_Z10print_dataPdi:                      # @_Z10print_dataPdi
	.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	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%esi, %ebp
	movq	%rdi, %rbx
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	testl	%ebp, %ebp
	jle	.LBB8_3
# %bb.1:                                # %.lr.ph.preheader
	movl	%ebp, %r14d
	xorl	%r15d, %r15d
.LBB8_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rbx,%r15,8), %xmm0            # xmm0 = mem[0],zero
	movl	$.L.str.8, %edi
	movb	$1, %al
	callq	printf
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB8_2
.LBB8_3:                                # %._crit_edge
	movl	$10, %edi
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.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_end8:
	.size	_Z10print_dataPdi, .Lfunc_end8-_Z10print_dataPdi
	.cfi_endproc
                                        # -- End function
	.globl	_Z17initialize_pointsP10node_coordid # -- Begin function _Z17initialize_pointsP10node_coordid
	.type	_Z17initialize_pointsP10node_coordid,@function
_Z17initialize_pointsP10node_coordid:   # @_Z17initialize_pointsP10node_coordid
	.cfi_startproc
# %bb.0:
                                        # kill: def $esi killed $esi def $rsi
	testl	%esi, %esi
	jle	.LBB9_5
# %bb.1:                                # %.lr.ph.preheader
	addq	$8, %rdi
	movl	%esi, %eax
	negl	%eax
	leal	-1(%rsi), %ecx
	incq	%rcx
	movl	$1, %edx
	xorl	%r8d, %r8d
.LBB9_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB9_3 Depth 2
	xorps	%xmm1, %xmm1
	cvtsi2sd	%edx, %xmm1
	mulsd	%xmm0, %xmm1
	movslq	%r8d, %r9
	leaq	(%rcx,%r9), %r8
	shlq	$4, %r9
	addq	%rdi, %r9
	movl	$1, %r10d
.LBB9_3:                                #   Parent Loop BB9_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	%xmm1, -8(%r9)
	xorps	%xmm2, %xmm2
	cvtsi2sd	%r10d, %xmm2
	mulsd	%xmm0, %xmm2
	movsd	%xmm2, (%r9)
	addq	$16, %r9
	leal	(%rax,%r10), %r11d
	incl	%r11d
                                        # kill: def $r10d killed $r10d killed $r10
	incl	%r10d
                                        # kill: def $r10d killed $r10d def $r10
	cmpl	$1, %r11d
	jne	.LBB9_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB9_2 Depth=1
	leal	1(%rdx), %r9d
	cmpl	%esi, %edx
	movl	%r9d, %edx
	jne	.LBB9_2
.LBB9_5:                                # %._crit_edge24
	retq
.Lfunc_end9:
	.size	_Z17initialize_pointsP10node_coordid, .Lfunc_end9-_Z17initialize_pointsP10node_coordid
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z23calculate_observed_dataPPdP10node_coordi
.LCPI10_0:
	.quad	0xbfe0000000000000              # double -0.5
.LCPI10_1:
	.quad	0x3ff0000000000000              # double 1
.LCPI10_2:
	.quad	0x4213ffffffd80000              # double 21474836470
.LCPI10_3:
	.quad	0xbfa999999999999a              # double -0.050000000000000003
	.text
	.globl	_Z23calculate_observed_dataPPdP10node_coordi
	.type	_Z23calculate_observed_dataPPdP10node_coordi,@function
_Z23calculate_observed_dataPPdP10node_coordi: # @_Z23calculate_observed_dataPPdP10node_coordi
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB10_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	%edx, %r15d
	shlq	$3, %r15
	xorl	%r12d, %r12d
.LBB10_2:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rbx,%r12,2), %xmm0            # xmm0 = mem[0],zero
	movsd	.LCPI10_0(%rip), %xmm2          # xmm2 = mem[0],zero
	addsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm0
	movsd	8(%rbx,%r12,2), %xmm1           # xmm1 = mem[0],zero
	addsd	%xmm2, %xmm1
	mulsd	%xmm1, %xmm1
	addsd	%xmm0, %xmm1
	movsd	.LCPI10_1(%rip), %xmm0          # xmm0 = mem[0],zero
	subsd	%xmm1, %xmm0
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	.LCPI10_2(%rip), %xmm0
	addsd	(%rsp), %xmm0                   # 8-byte Folded Reload
	addsd	.LCPI10_3(%rip), %xmm0
	movq	(%r14), %rax
	movsd	%xmm0, (%rax,%r12)
	addq	$8, %r12
	cmpq	%r12, %r15
	jne	.LBB10_2
# %bb.3:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r14
	.cfi_restore %r15
.LBB10_4:                               # %._crit_edge
	retq
.Lfunc_end10:
	.size	_Z23calculate_observed_dataPPdP10node_coordi, .Lfunc_end10-_Z23calculate_observed_dataPPdP10node_coordi
	.cfi_endproc
                                        # -- End function
	.globl	_Z35__device_stub__compute_K_matrix_gpuiPdP10node_coordi # -- Begin function _Z35__device_stub__compute_K_matrix_gpuiPdP10node_coordi
	.type	_Z35__device_stub__compute_K_matrix_gpuiPdP10node_coordi,@function
_Z35__device_stub__compute_K_matrix_gpuiPdP10node_coordi: # @_Z35__device_stub__compute_K_matrix_gpuiPdP10node_coordi
	.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	12(%rsp), %rax
	movl	%edi, (%rax)
	leaq	40(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	32(%rsp), %rsi
	movq	%rdx, (%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	$_Z20compute_K_matrix_gpuiPdP10node_coordi, %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_end11:
	.size	_Z35__device_stub__compute_K_matrix_gpuiPdP10node_coordi, .Lfunc_end11-_Z35__device_stub__compute_K_matrix_gpuiPdP10node_coordi
	.cfi_endproc
                                        # -- End function
	.globl	_Z30__device_stub__device_run_choliPdS_S_i # -- Begin function _Z30__device_stub__device_run_choliPdS_S_i
	.type	_Z30__device_stub__device_run_choliPdS_S_i,@function
_Z30__device_stub__device_run_choliPdS_S_i: # @_Z30__device_stub__device_run_choliPdS_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	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	4(%rsp), %rax
	movl	%edi, (%rax)
	leaq	40(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	32(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	24(%rsp), %rdx
	movq	%rcx, (%rdx)
	movq	%rsp, %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z15device_run_choliPdS_S_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end12:
	.size	_Z30__device_stub__device_run_choliPdS_S_i, .Lfunc_end12-_Z30__device_stub__device_run_choliPdS_S_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z21compute_matrix_part_1PPdiiiiii # -- Begin function _Z21compute_matrix_part_1PPdiiiiii
	.type	_Z21compute_matrix_part_1PPdiiiiii,@function
_Z21compute_matrix_part_1PPdiiiiii:     # @_Z21compute_matrix_part_1PPdiiiiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%r9d, %ebx
	movl	%r8d, %ebp
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %r14
	leal	1(%rbx), %r13d
	movslq	%r13d, %rdi
	shlq	$3, %rdi
	callq	malloc
	leal	(%rbx,%r15), %ecx
	cmpl	%ebp, %ecx
	jge	.LBB13_4
# %bb.1:                                # %.preheader41.lr.ph
	leal	(%rbx,%r12), %ecx
	movslq	%r12d, %rdx
	cmpl	%ecx, %edx
	cmovgl	%edx, %ecx
	movslq	%r15d, %rsi
	incl	%ecx
	movslq	%ebx, %rdi
	addq	%rsi, %rdi
	movslq	%ebp, %r8
	movl	%r13d, %r9d
	leaq	(%r14,%rdx,8), %r10
	shlq	$3, %rsi
.LBB13_3:                               # %.preheader41
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB13_9 Depth 2
                                        #       Child Loop BB13_10 Depth 3
                                        #     Child Loop BB13_7 Depth 2
	incq	%rdi
	movq	%rdx, %r11
	testl	%ebx, %ebx
	js	.LBB13_2
.LBB13_9:                               # %.lr.ph
                                        #   Parent Loop BB13_3 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB13_10 Depth 3
	movq	%r11, %r15
	subq	%rdx, %r15
	movq	(%r14,%r11,8), %r12
	addq	%rsi, %r12
	xorpd	%xmm0, %xmm0
	xorl	%r13d, %r13d
.LBB13_10:                              #   Parent Loop BB13_3 Depth=1
                                        #     Parent Loop BB13_9 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movsd	(%r12,%r13,8), %xmm1            # xmm1 = mem[0],zero
	movq	(%r10,%r13,8), %rbp
	mulsd	(%rbp,%rdi,8), %xmm1
	subsd	%xmm1, %xmm0
	incq	%r13
	cmpq	%r13, %r9
	jne	.LBB13_10
# %bb.8:                                #   in Loop: Header=BB13_9 Depth=2
	movsd	%xmm0, (%rax,%r15,8)
	incq	%r11
	cmpl	%r11d, %ecx
	jne	.LBB13_9
# %bb.5:                                # %.preheader
                                        #   in Loop: Header=BB13_3 Depth=1
	testl	%ebx, %ebx
	js	.LBB13_2
# %bb.6:                                # %.lr.ph49.preheader
                                        #   in Loop: Header=BB13_3 Depth=1
	xorl	%r11d, %r11d
.LBB13_7:                               # %.lr.ph49
                                        #   Parent Loop BB13_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rax,%r11,8), %xmm0            # xmm0 = mem[0],zero
	movq	(%r10,%r11,8), %r15
	movsd	%xmm0, (%r15,%rdi,8)
	incq	%r11
	cmpq	%r11, %r9
	jne	.LBB13_7
.LBB13_2:                               # %.loopexit
                                        #   in Loop: Header=BB13_3 Depth=1
	cmpq	%r8, %rdi
	jl	.LBB13_3
.LBB13_4:                               # %._crit_edge52
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end13:
	.size	_Z21compute_matrix_part_1PPdiiiiii, .Lfunc_end13-_Z21compute_matrix_part_1PPdiiiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z21compute_matrix_part_2PPdiiiiii # -- Begin function _Z21compute_matrix_part_2PPdiiiiii
	.type	_Z21compute_matrix_part_2PPdiiiiii,@function
_Z21compute_matrix_part_2PPdiiiiii:     # @_Z21compute_matrix_part_2PPdiiiiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%r9d, %r12d
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	64(%rsp), %ebp
	movl	%r9d, %r13d
	notl	%r13d
	addl	%ebp, %r13d
	movslq	%r13d, %rdi
	shlq	$3, %rdi
	callq	malloc
	testl	%r12d, %r12d
	js	.LBB14_7
# %bb.1:                                # %.lr.ph59
	leal	(%r12,%r14), %ecx
	movl	%r12d, %edx
	addl	%r15d, %edx
	leal	(%r12,%r15), %esi
	incl	%esi
	addl	%r15d, %ebp
	notl	%edx
	movl	%esi, 4(%rsp)                   # 4-byte Spill
	movslq	%esi, %rdi
	movslq	%r14d, %r8
	cmpl	%ecx, %r8d
	movslq	%ecx, %rsi
	cmovgl	%r8d, %ecx
	incl	%ecx
	movl	%ecx, (%rsp)                    # 4-byte Spill
	movl	%r13d, %r9d
	leaq	(%rbx,%rsi,8), %r10
	addq	$8, %r10
	movq	%rdi, %rcx
	leaq	(,%rdi,8), %r11
.LBB14_2:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB14_8 Depth 2
                                        #       Child Loop BB14_10 Depth 3
                                        #     Child Loop BB14_5 Depth 2
	movq	%rcx, %r14
	cmpl	%ebp, 4(%rsp)                   # 4-byte Folded Reload
	jge	.LBB14_3
.LBB14_8:                               #   Parent Loop BB14_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB14_10 Depth 3
	leal	(%r14,%rdx), %esi
	movslq	%esi, %r15
	movq	$0, (%rax,%r15,8)
	testl	%r13d, %r13d
	jle	.LBB14_12
# %bb.9:                                # %.lr.ph
                                        #   in Loop: Header=BB14_8 Depth=2
	movq	(%rbx,%r8,8), %r12
	addq	%r11, %r12
	xorpd	%xmm0, %xmm0
	xorl	%esi, %esi
.LBB14_10:                              #   Parent Loop BB14_2 Depth=1
                                        #     Parent Loop BB14_8 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movsd	(%r12,%rsi,8), %xmm1            # xmm1 = mem[0],zero
	movq	(%r10,%rsi,8), %rdi
	mulsd	(%rdi,%r14,8), %xmm1
	addsd	%xmm1, %xmm0
	incq	%rsi
	cmpq	%rsi, %r9
	jne	.LBB14_10
# %bb.11:                               # %._crit_edge
                                        #   in Loop: Header=BB14_8 Depth=2
	movsd	%xmm0, (%rax,%r15,8)
.LBB14_12:                              #   in Loop: Header=BB14_8 Depth=2
	incq	%r14
	cmpl	%r14d, %ebp
	jne	.LBB14_8
.LBB14_3:                               # %.preheader
                                        #   in Loop: Header=BB14_2 Depth=1
	testl	%r13d, %r13d
	jle	.LBB14_6
# %bb.4:                                # %.lr.ph54
                                        #   in Loop: Header=BB14_2 Depth=1
	movq	(%rbx,%r8,8), %rsi
	addq	%r11, %rsi
	xorl	%r14d, %r14d
.LBB14_5:                               #   Parent Loop BB14_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rax,%r14,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, (%rsi,%r14,8)
	incq	%r14
	cmpq	%r14, %r9
	jne	.LBB14_5
.LBB14_6:                               # %._crit_edge55
                                        #   in Loop: Header=BB14_2 Depth=1
	incq	%r8
	cmpl	%r8d, (%rsp)                    # 4-byte Folded Reload
	jne	.LBB14_2
.LBB14_7:                               # %._crit_edge60
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end14:
	.size	_Z21compute_matrix_part_2PPdiiiiii, .Lfunc_end14-_Z21compute_matrix_part_2PPdiiiiii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z15compute_inversePPdiiii
.LCPI15_0:
	.quad	0x3ff0000000000000              # double 1
	.text
	.globl	_Z15compute_inversePPdiiii
	.type	_Z15compute_inversePPdiiii,@function
_Z15compute_inversePPdiiii:             # @_Z15compute_inversePPdiiii
	.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
	movl	%ecx, %r13d
	movl	%edx, %ebx
	movq	%rdi, %r14
	movl	%ecx, %eax
	subl	%esi, %eax
	jne	.LBB15_3
# %bb.1:                                # %common.ret
	movslq	%r13d, %rax
	movq	(%r14,%rax,8), %rax
	movslq	%ebx, %rcx
	movsd	.LCPI15_0(%rip), %xmm0          # xmm0 = mem[0],zero
	divsd	(%rax,%rcx,8), %xmm0
	movsd	%xmm0, (%rax,%rcx,8)
	jmp	.LBB15_2
.LBB15_3:
	movl	%r8d, %ebp
	movl	%esi, %r15d
	leal	1(%rax), %ecx
	movl	%ecx, 20(%rsp)                  # 4-byte Spill
	movl	%eax, %r12d
	shrl	$31, %r12d
	addl	%eax, %r12d
	sarl	%r12d
	leal	(%r12,%r15), %ecx
	leal	(%r12,%rbx), %r8d
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_Z15compute_inversePPdiiii
	leal	(%r12,%r15), %esi
	incl	%esi
	leal	1(%r12,%rbx), %edx
	movq	%r14, %rdi
	movl	%r13d, %ecx
	movl	%ebp, %r8d
	callq	_Z15compute_inversePPdiiii
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movl	%ebp, %r8d
	movl	%r12d, %r9d
	callq	_Z21compute_matrix_part_1PPdiiiiii
	movl	20(%rsp), %eax                  # 4-byte Reload
	movl	%eax, (%rsp)
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movl	%r12d, %r9d
	callq	_Z21compute_matrix_part_2PPdiiiiii
.LBB15_2:                               # %common.ret
	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_end15:
	.size	_Z15compute_inversePPdiiii, .Lfunc_end15-_Z15compute_inversePPdiiii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z9compute_kPPdP10node_coordS2_i
.LCPI16_0:
	.quad	0x8000000000000000              # double -0
	.quad	0x8000000000000000              # double -0
	.text
	.globl	_Z9compute_kPPdP10node_coordS2_i
	.type	_Z9compute_kPPdP10node_coordS2_i,@function
_Z9compute_kPPdP10node_coordS2_i:       # @_Z9compute_kPPdP10node_coordS2_i
	.cfi_startproc
# %bb.0:
	testl	%ecx, %ecx
	jle	.LBB16_4
# %bb.1:                                # %.lr.ph
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	%ecx, %r12d
	shlq	$3, %r12
	xorl	%r13d, %r13d
.LBB16_2:                               # =>This Inner Loop Header: Depth=1
	movsd	(%rbx,%r13,2), %xmm1            # xmm1 = mem[0],zero
	movsd	8(%rbx,%r13,2), %xmm0           # xmm0 = mem[0],zero
	subsd	(%r14), %xmm1
	subsd	8(%r14), %xmm0
	mulsd	%xmm1, %xmm1
	mulsd	%xmm0, %xmm0
	addsd	%xmm1, %xmm0
	xorpd	.LCPI16_0(%rip), %xmm0
	callq	exp
	movq	(%r15), %rax
	movsd	%xmm0, (%rax,%r13)
	addq	$8, %r13
	cmpq	%r13, %r12
	jne	.LBB16_2
# %bb.3:
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
.LBB16_4:                               # %._crit_edge
	retq
.Lfunc_end16:
	.size	_Z9compute_kPPdP10node_coordS2_i, .Lfunc_end16-_Z9compute_kPPdP10node_coordS2_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z13convert_arrayPPdS_ib        # -- Begin function _Z13convert_arrayPPdS_ib
	.type	_Z13convert_arrayPPdS_ib,@function
_Z13convert_arrayPPdS_ib:               # @_Z13convert_arrayPPdS_ib
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB17_5
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %eax
	xorl	%r8d, %r8d
.LBB17_2:                               # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB17_3 Depth 2
	movl	%r8d, %r9d
	imull	%edx, %r9d
	leaq	(%rsi,%r9,8), %r11
	movq	(%rdi,%r8,8), %r9
	testb	%cl, %cl
	movq	%r11, %r10
	cmovneq	%r9, %r10
	cmovneq	%r11, %r9
	xorl	%r11d, %r11d
.LBB17_3:                               #   Parent Loop BB17_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%r9,%r11,8), %xmm0             # xmm0 = mem[0],zero
	movsd	%xmm0, (%r10,%r11,8)
	incq	%r11
	cmpq	%r11, %rax
	jne	.LBB17_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB17_2 Depth=1
	incq	%r8
	cmpq	%rax, %r8
	jne	.LBB17_2
.LBB17_5:                               # %._crit_edge24
	retq
.Lfunc_end17:
	.size	_Z13convert_arrayPPdS_ib, .Lfunc_end17-_Z13convert_arrayPPdS_ib
	.cfi_endproc
                                        # -- End function
	.globl	_Z13get_transposePPdS0_i        # -- Begin function _Z13get_transposePPdS0_i
	.type	_Z13get_transposePPdS0_i,@function
_Z13get_transposePPdS0_i:               # @_Z13get_transposePPdS0_i
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB18_5
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %eax
	xorl	%ecx, %ecx
.LBB18_2:                               # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB18_3 Depth 2
	movq	(%rdi,%rcx,8), %rdx
	xorl	%r8d, %r8d
.LBB18_3:                               #   Parent Loop BB18_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rdx,%r8,8), %xmm0             # xmm0 = mem[0],zero
	movq	(%rsi,%r8,8), %r9
	movsd	%xmm0, (%r9,%rcx,8)
	incq	%r8
	cmpq	%r8, %rax
	jne	.LBB18_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB18_2 Depth=1
	incq	%rcx
	cmpq	%rax, %rcx
	jne	.LBB18_2
.LBB18_5:                               # %._crit_edge15
	retq
.Lfunc_end18:
	.size	_Z13get_transposePPdS0_i, .Lfunc_end18-_Z13get_transposePPdS0_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z16duplicate_matrixPPdS0_i     # -- Begin function _Z16duplicate_matrixPPdS0_i
	.type	_Z16duplicate_matrixPPdS0_i,@function
_Z16duplicate_matrixPPdS0_i:            # @_Z16duplicate_matrixPPdS0_i
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB19_5
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %eax
	xorl	%ecx, %ecx
.LBB19_2:                               # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB19_3 Depth 2
	movq	(%rdi,%rcx,8), %rdx
	movq	(%rsi,%rcx,8), %r8
	xorl	%r9d, %r9d
.LBB19_3:                               #   Parent Loop BB19_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rdx,%r9,8), %xmm0             # xmm0 = mem[0],zero
	movsd	%xmm0, (%r8,%r9,8)
	incq	%r9
	cmpq	%r9, %rax
	jne	.LBB19_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB19_2 Depth=1
	incq	%rcx
	cmpq	%rax, %rcx
	jne	.LBB19_2
.LBB19_5:                               # %._crit_edge15
	retq
.Lfunc_end19:
	.size	_Z16duplicate_matrixPPdS0_i, .Lfunc_end19-_Z16duplicate_matrixPPdS0_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z10run_solverPdS_S_ii          # -- Begin function _Z10run_solverPdS_S_ii
	.type	_Z10run_solverPdS_S_ii,@function
_Z10run_solverPdS_S_ii:                 # @_Z10run_solverPdS_S_ii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$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	%r8d, 44(%rsp)                  # 4-byte Spill
	movl	%ecx, %ebx
	movq	%rdx, 48(%rsp)                  # 8-byte Spill
	movq	%rsi, 104(%rsp)                 # 8-byte Spill
	movq	%rdi, (%rsp)                    # 8-byte Spill
	movl	BLOCK_SIZE(%rip), %ecx
	leal	-1(%rbx), %eax
	movl	%eax, 8(%rsp)                   # 4-byte Spill
	leal	(%rbx,%rcx), %eax
	decl	%eax
	cltd
	movq	%rcx, 16(%rsp)                  # 8-byte Spill
	idivl	%ecx
                                        # kill: def $eax killed $eax def $rax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movl	%ebx, %edi
	callq	_Z16alloc_mem_matrixi
	movq	%rax, %r15
	movl	%ebx, %edi
	callq	_Z16alloc_mem_matrixi
	movq	%rax, %r13
	movl	%ebx, %edi
	callq	_Z16alloc_mem_matrixi
	movq	%rax, %rbp
	movl	%ebx, %r14d
	imull	%r14d, %r14d
	shlq	$3, %r14
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, %r12
	movq	%rax, %rdi
	movq	(%rsp), %rsi                    # 8-byte Reload
	movq	%r14, (%rsp)                    # 8-byte Spill
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	%ebx, %r14d
	testl	%ebx, %ebx
	jle	.LBB20_25
# %bb.1:                                # %.preheader.lr.ph.i
	movl	8(%rsp), %r9d                   # 4-byte Reload
	movq	(%rsp), %r8                     # 8-byte Reload
	xorl	%eax, %eax
	xorl	%ecx, %ecx
.LBB20_2:                               # %.lr.ph.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB20_3 Depth 2
	movl	%eax, %edx
	leaq	(%r12,%rdx,8), %rdx
	movq	(%r15,%rcx,8), %rsi
	xorl	%edi, %edi
.LBB20_3:                               #   Parent Loop BB20_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rdx,%rdi,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, (%rsi,%rdi,8)
	incq	%rdi
	cmpq	%rdi, %r14
	jne	.LBB20_3
# %bb.4:                                # %._crit_edge.i
                                        #   in Loop: Header=BB20_2 Depth=1
	incq	%rcx
	addl	%ebx, %eax
	cmpq	%r14, %rcx
	jne	.LBB20_2
# %bb.5:                                # %.lr.ph.i133.preheader
	xorl	%eax, %eax
	movq	%r8, %r12
	movl	%r9d, %r8d
.LBB20_6:                               # %.lr.ph.i133
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB20_7 Depth 2
	movq	(%r15,%rax,8), %rcx
	xorl	%edx, %edx
.LBB20_7:                               #   Parent Loop BB20_6 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rcx,%rdx,8), %xmm0            # xmm0 = mem[0],zero
	movq	(%r13,%rdx,8), %rsi
	movsd	%xmm0, (%rsi,%rax,8)
	incq	%rdx
	cmpq	%rdx, %r14
	jne	.LBB20_7
# %bb.8:                                # %._crit_edge.i137
                                        #   in Loop: Header=BB20_6 Depth=1
	incq	%rax
	cmpq	%r14, %rax
	jne	.LBB20_6
# %bb.9:                                # %_Z13get_transposePPdS0_i.exit
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	%r8d, %ecx
	callq	_Z15compute_inversePPdiiii
.LBB20_10:                              # %.lr.ph.i140
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB20_11 Depth 2
	movq	(%r13,%r15,8), %rax
	movq	(%rbp,%r15,8), %rcx
	xorl	%edx, %edx
.LBB20_11:                              #   Parent Loop BB20_10 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rax,%rdx,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, (%rcx,%rdx,8)
	incq	%rdx
	cmpq	%rdx, %r14
	jne	.LBB20_11
# %bb.12:                               # %._crit_edge.i145
                                        #   in Loop: Header=BB20_10 Depth=1
	incq	%r15
	cmpq	%r14, %r15
	jne	.LBB20_10
# %bb.13:                               # %.lr.ph.i150.preheader
	xorl	%eax, %eax
.LBB20_14:                              # %.lr.ph.i150
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB20_15 Depth 2
	movq	(%r13,%rax,8), %rcx
	xorl	%edx, %edx
.LBB20_15:                              #   Parent Loop BB20_14 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rcx,%rdx,8), %xmm0            # xmm0 = mem[0],zero
	movq	(%rbp,%rdx,8), %rsi
	movsd	%xmm0, (%rsi,%rax,8)
	incq	%rdx
	cmpq	%rdx, %r14
	jne	.LBB20_15
# %bb.16:                               # %._crit_edge.i155
                                        #   in Loop: Header=BB20_14 Depth=1
	incq	%rax
	cmpq	%r14, %rax
	jne	.LBB20_14
# %bb.17:                               # %_Z13get_transposePPdS0_i.exit158
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %r15
	xorl	%eax, %eax
	xorl	%ecx, %ecx
.LBB20_18:                              # %.lr.ph.i161
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB20_19 Depth 2
	movl	%eax, %edx
	leaq	(%r15,%rdx,8), %rdx
	movq	(%r13,%rcx,8), %rsi
	xorl	%edi, %edi
.LBB20_19:                              #   Parent Loop BB20_18 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rsi,%rdi,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, (%rdx,%rdi,8)
	incq	%rdi
	cmpq	%rdi, %r14
	jne	.LBB20_19
# %bb.20:                               # %._crit_edge.i170
                                        #   in Loop: Header=BB20_18 Depth=1
	incq	%rcx
	addl	%ebx, %eax
	cmpq	%r14, %rcx
	jne	.LBB20_18
# %bb.21:                               # %_Z13convert_arrayPPdS_ib.exit173
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %r13
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	movq	16(%rsp), %r8                   # 8-byte Reload
.LBB20_22:                              # %.lr.ph.i176
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB20_23 Depth 2
	movl	%eax, %edx
	leaq	(,%rdx,8), %rdx
	addq	%r13, %rdx
	movq	(%rbp,%rcx,8), %rsi
	xorl	%edi, %edi
.LBB20_23:                              #   Parent Loop BB20_22 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rsi,%rdi,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, (%rdx,%rdi,8)
	incq	%rdi
	cmpq	%rdi, %r14
	jne	.LBB20_23
# %bb.24:                               # %._crit_edge.i185
                                        #   in Loop: Header=BB20_22 Depth=1
	incq	%rcx
	addl	%ebx, %eax
	cmpq	%r14, %rcx
	jne	.LBB20_22
	jmp	.LBB20_26
.LBB20_25:                              # %_Z13get_transposePPdS0_i.exit.thread
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	8(%rsp), %ecx                   # 4-byte Reload
	movl	%ecx, %r8d
	callq	_Z15compute_inversePPdiiii
	movq	(%rsp), %r12                    # 8-byte Reload
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %r13
	movq	16(%rsp), %r8                   # 8-byte Reload
.LBB20_26:                              # %_Z13convert_arrayPPdS_ib.exit188
	movq	24(%rsp), %rbp                  # 8-byte Reload
	shlq	$32, %rbp
	movq	%r8, %rax
	shlq	$32, %rax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	leaq	96(%rsp), %rdi
	movq	(%rsp), %r12                    # 8-byte Reload
	movq	%r12, %rsi
	callq	hipMalloc
	leaq	88(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	leaq	96(%rsp), %rax
	movq	(%rax), %rdi
	movq	104(%rsp), %rsi                 # 8-byte Reload
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	88(%rsp), %rax
	movq	(%rax), %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	144(%rsp), %r15
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	leaq	136(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movq	(%r15), %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	136(%rsp), %rax
	movq	(%rax), %rdi
	movq	48(%rsp), %rsi                  # 8-byte Reload
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	80(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movl	44(%rsp), %edx                  # 4-byte Reload
	btsq	$32, %rdx
	movabsq	$4294967296, %rdi               # imm = 0x100000000
	orq	$1, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB20_28
# %bb.27:
	movq	96(%rsp), %rdi
	movq	88(%rsp), %rsi
	movq	80(%rsp), %rdx
	movl	%ebx, %ecx
	movl	%ebx, %r8d
	movl	%ebx, %r9d
	callq	_Z30__device_stub__gpu_matrix_multPdS_S_iii
.LBB20_28:
	orq	$1, %rbp
	movq	%rbp, 24(%rsp)                  # 8-byte Spill
	movq	16(%rsp), %rax                  # 8-byte Reload
	addq	%rax, 8(%rsp)                   # 8-byte Folded Spill
	movslq	%ebx, %rbp
	leaq	(,%rbp,8), %r15
	imulq	%r15, %rbp
	leaq	72(%rsp), %rdi
	xorl	%r12d, %r12d
	movq	%rbp, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	leaq	64(%rsp), %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	leaq	128(%rsp), %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	testl	%ebx, %ebx
	movq	48(%rsp), %r8                   # 8-byte Reload
	jle	.LBB20_36
# %bb.29:                               # %.preheader199.lr.ph
	movq	72(%rsp), %rax
	xorl	%ecx, %ecx
.LBB20_30:                              # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB20_31 Depth 2
	movl	%r12d, %esi
	leaq	(%rax,%rsi,8), %rdx
	leaq	(,%rsi,8), %rsi
	addq	%r13, %rsi
	xorl	%edi, %edi
.LBB20_31:                              #   Parent Loop BB20_30 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rsi,%rdi,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, (%rdx,%rdi,8)
	incq	%rdi
	cmpq	%rdi, %r14
	jne	.LBB20_31
# %bb.32:                               # %._crit_edge
                                        #   in Loop: Header=BB20_30 Depth=1
	incq	%rcx
	addl	%ebx, %r12d
	cmpq	%r14, %rcx
	jne	.LBB20_30
# %bb.33:                               # %.preheader
	testl	%ebx, %ebx
	jle	.LBB20_36
# %bb.34:                               # %.critedge.lr.ph
	movq	64(%rsp), %rax
	xorl	%ecx, %ecx
.LBB20_35:                              # %.critedge
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%r8,%rcx,8), %xmm0             # xmm0 = mem[0],zero
	movsd	%xmm0, (%rax,%rcx,8)
	incq	%rcx
	cmpq	%rcx, %r14
	jne	.LBB20_35
.LBB20_36:                              # %._crit_edge203
	leaq	120(%rsp), %r12
	movq	%r12, %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
	leaq	112(%rsp), %r13
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	leaq	32(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	movq	(%r12), %rdi
	movq	72(%rsp), %rsi
	movq	%rbp, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r13), %rdi
	movq	64(%rsp), %rsi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	24(%rsp), %r12                  # 8-byte Reload
	movq	%r12, %rdi
	movl	$1, %esi
	movq	8(%rsp), %r13                   # 8-byte Reload
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB20_38
# %bb.37:
	movq	120(%rsp), %rdi
	movq	112(%rsp), %rsi
	movq	32(%rsp), %rdx
	movl	%ebx, %ecx
	movl	%ebx, %r8d
	movl	$1, %r9d
	callq	_Z30__device_stub__gpu_matrix_multPdS_S_iii
.LBB20_38:
	movq	128(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	leaq	56(%rsp), %rdi
	movq	(%rsp), %r14                    # 8-byte Reload
	movq	%r14, %rsi
	callq	hipMalloc
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB20_40
# %bb.39:
	movq	80(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	56(%rsp), %rdx
	movl	$1, %ecx
	movl	%ebx, %r8d
	movl	$1, %r9d
	callq	_Z30__device_stub__gpu_matrix_multPdS_S_iii
.LBB20_40:
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, %rbx
	movq	56(%rsp), %rsi
	movq	%rax, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movsd	(%rbx), %xmm0                   # xmm0 = mem[0],zero
	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_end20:
	.size	_Z10run_solverPdS_S_ii, .Lfunc_end20-_Z10run_solverPdS_S_ii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI21_0:
	.quad	0x3ff0000000000000              # double 1
.LCPI21_1:
	.quad	0xbfe0000000000000              # double -0.5
.LCPI21_2:
	.quad	0x4213ffffffd80000              # double 21474836470
.LCPI21_3:
	.quad	0xbfa999999999999a              # double -0.050000000000000003
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$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
	movq	%rsi, %rbx
	movl	%edi, %ebp
	movl	$16, %edi
	callq	malloc
	cmpl	$4, %ebp
	jne	.LBB21_1
# %bb.2:
	movq	%rax, %r15
	movq	8(%rbx), %rdi
	callq	atoi
	movl	%eax, %r14d
	movq	16(%rbx), %rdi
	callq	atof
	movsd	%xmm0, 48(%rsp)                 # 8-byte Spill
	movsd	%xmm0, (%r15)
	movq	24(%rbx), %rdi
	callq	atof
	movsd	%xmm0, 40(%rsp)                 # 8-byte Spill
	movq	%r15, 16(%rsp)                  # 8-byte Spill
	movsd	%xmm0, 8(%r15)
	xorl	%r13d, %r13d
	movl	$.L.str.10, %edi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.11, %edi
	movsd	48(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movsd	40(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	movb	$2, %al
	callq	printf
	movl	%r14d, %ebx
	leal	1(%r14), %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	imull	%ebx, %ebx
	movsd	.LCPI21_0(%rip), %xmm1          # xmm1 = mem[0],zero
	divsd	%xmm0, %xmm1
	movsd	%xmm1, 88(%rsp)                 # 8-byte Spill
	callq	_Z13getNumThreadsv
	movl	%eax, 8(%rsp)                   # 4-byte Spill
	movq	%rbx, %r15
	shlq	$4, %r15
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, %rbp
	movq	%rax, %rdi
	movl	%r14d, %esi
	movsd	88(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_Z17initialize_pointsP10node_coordid
	leaq	104(%rsp), %r12
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	movq	(%r12), %rdi
	movq	%rbp, %rsi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	%ebx, %edi
	callq	_Z16alloc_mem_matrixi
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	%rbp, %rsi
	movl	%ebx, %edx
	callq	_Z23calculate_observed_dataPPdP10node_coordi
	movq	%rbx, %rsi
	imulq	%rbx, %rsi
	shlq	$3, %rsi
	leaq	72(%rsp), %rdi
	xorl	%edx, %edx
	callq	hipHostMalloc
	testl	%r14d, %r14d
	je	.LBB21_7
# %bb.3:                                # %.lr.ph.i.preheader
	movq	72(%rsp), %rax
	xorl	%ecx, %ecx
.LBB21_4:                               # %.lr.ph.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB21_5 Depth 2
	movl	%r13d, %edx
	leaq	(%rax,%rdx,8), %rdx
	movq	(%r15,%rcx,8), %rsi
	xorl	%edi, %edi
.LBB21_5:                               #   Parent Loop BB21_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rsi,%rdi,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, (%rdx,%rdi,8)
	incq	%rdi
	cmpq	%rdi, %rbx
	jne	.LBB21_5
# %bb.6:                                # %._crit_edge.i
                                        #   in Loop: Header=BB21_4 Depth=1
	incq	%rcx
	addl	%ebx, %r13d
	cmpq	%rbx, %rcx
	jne	.LBB21_4
.LBB21_7:                               # %_Z13convert_arrayPPdS_ib.exit
	movl	%ebx, %edi
	callq	_Z16alloc_mem_matrixi
	movq	%rax, %r12
	movl	%ebx, %r13d
	imull	%r13d, %r13d
	shlq	$3, %r13
	movq	%r13, %rdi
	callq	malloc
	movq	%rax, %r15
	movq	%r12, %rdi
	movq	16(%rsp), %rsi                  # 8-byte Reload
	movq	%rbp, %rdx
	movl	%ebx, %ecx
	callq	_Z9compute_kPPdP10node_coordS2_i
	testl	%r14d, %r14d
	je	.LBB21_12
# %bb.8:                                # %.lr.ph.i70.preheader
	xorl	%eax, %eax
	xorl	%ecx, %ecx
.LBB21_9:                               # %.lr.ph.i70
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB21_10 Depth 2
	movl	%eax, %edx
	leaq	(%r15,%rdx,8), %rdx
	movq	(%r12,%rcx,8), %rsi
	xorl	%edi, %edi
.LBB21_10:                              #   Parent Loop BB21_9 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rsi,%rdi,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, (%rdx,%rdi,8)
	incq	%rdi
	cmpq	%rdi, %rbx
	jne	.LBB21_10
# %bb.11:                               # %._crit_edge.i79
                                        #   in Loop: Header=BB21_9 Depth=1
	incq	%rcx
	addl	%ebx, %eax
	cmpq	%rbx, %rcx
	jne	.LBB21_9
.LBB21_12:                              # %_Z13convert_arrayPPdS_ib.exit82
	movq	%r14, 16(%rsp)                  # 8-byte Spill
	movabsq	$4294967297, %r14               # imm = 0x100000001
	leaq	80(%rsp), %rdi
	callq	hipEventCreate
	leaq	32(%rsp), %rdi
	callq	hipEventCreate
	leaq	64(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	movl	8(%rsp), %r12d                  # 4-byte Reload
	leaq	(%r12,%r14), %rbp
	decq	%rbp
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB21_14
# %bb.13:
	movq	64(%rsp), %rsi
	movq	104(%rsp), %rdx
	movl	8(%rsp), %edi                   # 4-byte Reload
	movq	16(%rsp), %rcx                  # 8-byte Reload
                                        # kill: def $ecx killed $ecx killed $rcx
	callq	_Z35__device_stub__compute_K_matrix_gpuiPdP10node_coordi
.LBB21_14:
	leaq	56(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	shlq	$3, %r12
	leaq	96(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	leaq	112(%rsp), %r14
	movq	%r14, %rdi
	callq	hipEventCreate
	leaq	24(%rsp), %rdi
	callq	hipEventCreate
	movq	(%r14), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	80(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB21_16
# %bb.15:
	movq	64(%rsp), %rsi
	movq	56(%rsp), %rdx
	movq	96(%rsp), %rcx
	movl	8(%rsp), %edi                   # 4-byte Reload
	movl	%ebx, %r8d
	callq	_Z30__device_stub__device_run_choliPdS_S_i
.LBB21_16:
	movq	24(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	24(%rsp), %rdi
	callq	hipEventSynchronize
	leaq	144(%rsp), %r14
	movq	%r14, %rdi
	callq	hipEventCreate
	leaq	136(%rsp), %r12
	movq	%r12, %rdi
	callq	hipEventCreate
	movq	(%r14), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	56(%rsp), %rdi
	movq	72(%rsp), %rdx
	movq	%r15, %rsi
	movl	%ebx, %ecx
	movl	8(%rsp), %r8d                   # 4-byte Reload
	callq	_Z10run_solverPdS_S_ii
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	movq	(%r12), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	(%r12), %rdi
	callq	hipEventSynchronize
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	32(%rsp), %rdi
	callq	hipEventSynchronize
	movl	$.L.str.12, %edi
	movsd	8(%rsp), %xmm0                  # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	movsd	.LCPI21_1(%rip), %xmm0          # xmm0 = mem[0],zero
	movsd	48(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	addsd	%xmm0, %xmm1
	mulsd	%xmm1, %xmm1
	movsd	40(%rsp), %xmm2                 # 8-byte Reload
                                        # xmm2 = mem[0],zero
	addsd	%xmm0, %xmm2
	mulsd	%xmm2, %xmm2
	addsd	%xmm1, %xmm2
	movsd	.LCPI21_0(%rip), %xmm0          # xmm0 = mem[0],zero
	subsd	%xmm2, %xmm0
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	.LCPI21_2(%rip), %xmm0
	addsd	8(%rsp), %xmm0                  # 8-byte Folded Reload
	addsd	.LCPI21_3(%rip), %xmm0
	movl	$.L.str.13, %edi
	movb	$1, %al
	callq	printf
	movq	80(%rsp), %rsi
	movq	32(%rsp), %rdx
	leaq	132(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
	movq	112(%rsp), %rsi
	movq	24(%rsp), %rdx
	leaq	128(%rsp), %r15
	movq	%r15, %rdi
	callq	hipEventElapsedTime
	movq	(%r14), %rsi
	movq	(%r12), %rdx
	leaq	124(%rsp), %r14
	movq	%r14, %rdi
	callq	hipEventElapsedTime
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r15), %xmm0
	movl	$.L.str.14, %edi
	movb	$1, %al
	callq	printf
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14), %xmm0
	movl	$.L.str.15, %edi
	movb	$1, %al
	callq	printf
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbx), %xmm0
	movl	$.L.str.16, %edi
	movb	$1, %al
	callq	printf
	jmp	.LBB21_17
.LBB21_1:
	movl	$.Lstr.3, %edi
	callq	puts@PLT
.LBB21_17:
	xorl	%eax, %eax
	addq	$152, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end21:
	.size	main, .Lfunc_end21-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB22_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB22_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z15gpu_matrix_multPdS_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	$_Z20compute_K_matrix_gpuiPdP10node_coordi, %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	$_Z15device_run_choliPdS_S_i, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$0, 8(%rsp)
	movl	$0, (%rsp)
	movl	$n, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	movl	$0, 8(%rsp)
	movl	$0, (%rsp)
	movl	$count, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	movl	$0, 8(%rsp)
	movl	$0, (%rsp)
	movl	$node_coord, %esi
	movl	$.L__unnamed_6, %edx
	movl	$.L__unnamed_6, %ecx
	movl	$16, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end22:
	.size	__hip_module_ctor, .Lfunc_end22-__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	.LBB23_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
.LBB23_2:
	retq
.Lfunc_end23:
	.size	__hip_module_dtor, .Lfunc_end23-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	n,@object                       # @n
	.local	n
	.comm	n,4,4
	.type	count,@object                   # @count
	.local	count
	.comm	count,4,4
	.type	BLOCK_SIZE,@object              # @BLOCK_SIZE
	.data
	.globl	BLOCK_SIZE
	.p2align	2, 0x0
BLOCK_SIZE:
	.long	16                              # 0x10
	.size	BLOCK_SIZE, 4

	.type	node_coord,@object              # @node_coord
	.local	node_coord
	.comm	node_coord,16,8
	.type	.L.str.1,@object                # @.str.1
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.1:
	.asciz	"(%5.5lf) "
	.size	.L.str.1, 10

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

	.type	.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM,@object # @__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM
	.p2align	4, 0x0
.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM:
	.long	32                              # 0x20
	.long	32                              # 0x20
	.long	33                              # 0x21
	.long	48                              # 0x30
	.long	48                              # 0x30
	.long	192                             # 0xc0
	.long	50                              # 0x32
	.long	192                             # 0xc0
	.long	53                              # 0x35
	.long	192                             # 0xc0
	.long	55                              # 0x37
	.long	192                             # 0xc0
	.long	80                              # 0x50
	.long	128                             # 0x80
	.long	82                              # 0x52
	.long	128                             # 0x80
	.long	83                              # 0x53
	.long	128                             # 0x80
	.long	96                              # 0x60
	.long	64                              # 0x40
	.long	97                              # 0x61
	.long	128                             # 0x80
	.long	98                              # 0x62
	.long	128                             # 0x80
	.long	4294967295                      # 0xffffffff
	.long	4294967295                      # 0xffffffff
	.size	.L__const._Z19_ConvertSMVer2Coresii.nGpuArchCoresPerSM, 104

	.type	.L.str.3,@object                # @.str.3
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.3:
	.asciz	"\n --------------------- %s --------------------- \n"
	.size	.L.str.3, 51

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"%4.9lf "
	.size	.L.str.4, 8

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"(%3.5lf %3.5lf) "
	.size	.L.str.6, 17

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"%3.5lf  "
	.size	.L.str.8, 9

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

	.type	_Z15device_run_choliPdS_S_i,@object # @_Z15device_run_choliPdS_S_i
	.globl	_Z15device_run_choliPdS_S_i
	.p2align	3, 0x0
_Z15device_run_choliPdS_S_i:
	.quad	_Z30__device_stub__device_run_choliPdS_S_i
	.size	_Z15device_run_choliPdS_S_i, 8

	.type	.L.str.10,@object               # @.str.10
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.10:
	.asciz	"Size: %d \n"
	.size	.L.str.10, 11

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"Given coordinates (%f, %f)\n"
	.size	.L.str.11, 28

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Predicted value is %lf\n"
	.size	.L.str.12, 24

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"Actual value is %lf\n"
	.size	.L.str.13, 21

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"Time Taken by Cholesky = %f ms\n"
	.size	.L.str.14, 32

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"Time Taken by Solver = %f ms\n"
	.size	.L.str.15, 30

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"Overall Time Taken = %f ms\n"
	.size	.L.str.16, 28

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z15gpu_matrix_multPdS_S_iii"
	.size	.L__unnamed_1, 29

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z20compute_K_matrix_gpuiPdP10node_coordi"
	.size	.L__unnamed_2, 42

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

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"n"
	.size	.L__unnamed_4, 2

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"count"
	.size	.L__unnamed_5, 6

	.type	.L__unnamed_6,@object           # @5
.L__unnamed_6:
	.asciz	"node_coord"
	.size	.L__unnamed_6, 11

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

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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"\n Device K ---------------------------------- "
	.size	.Lstr, 47

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"\n --------------------- Printing grid coordinates --------------------- "
	.size	.Lstr.1, 73

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"\n --------------------- Printing data points --------------------- "
	.size	.Lstr.2, 68

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"Invalid number of input arguements. Please execute the binary as ./a.out m x* y*"
	.size	.Lstr.3, 81

	.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 _Z30__device_stub__gpu_matrix_multPdS_S_iii
	.addrsig_sym _Z35__device_stub__compute_K_matrix_gpuiPdP10node_coordi
	.addrsig_sym _Z30__device_stub__device_run_choliPdS_S_i
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym n
	.addrsig_sym count
	.addrsig_sym node_coord
	.addrsig_sym _Z15gpu_matrix_multPdS_S_iii
	.addrsig_sym _Z20compute_K_matrix_gpuiPdP10node_coordi
	.addrsig_sym _Z15device_run_choliPdS_S_i
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z15gpu_matrix_multPdS_S_iii ; -- Begin function _Z15gpu_matrix_multPdS_S_iii
	.globl	_Z15gpu_matrix_multPdS_S_iii
	.p2align	8
	.type	_Z15gpu_matrix_multPdS_S_iii,@function
_Z15gpu_matrix_multPdS_S_iii:           ; @_Z15gpu_matrix_multPdS_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_i32_e32 vcc_lo, s6, v0
	v_cmp_gt_i32_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_mul_lo_u32 v2, v1, s5
	v_mov_b32_e32 v6, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[4:5], 3, v[2:3]
	v_mov_b32_e32 v2, 0
	v_mov_b32_e32 v3, 0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v4, vcc_lo, s8, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s9, v5, vcc_lo
.LBB0_3:                                ; =>This Inner Loop Header: Depth=1
	v_ashrrev_i32_e32 v7, 31, v6
	s_add_i32 s5, s5, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_cmp_eq_u32 s5, 0
	v_lshlrev_b64 v[7:8], 3, v[6:7]
	v_add_nc_u32_e32 v6, s6, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v7, vcc_lo, s10, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s11, v8, vcc_lo
	global_load_b64 v[9:10], v[4:5], off
	global_load_b64 v[7:8], v[7:8], off
	v_add_co_u32 v4, vcc_lo, v4, 8
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	s_waitcnt vmcnt(0)
	v_fma_f64 v[2:3], v[9:10], v[7:8], v[2:3]
	s_cbranch_scc0 .LBB0_3
	s_branch .LBB0_5
.LBB0_4:
	v_mov_b32_e32 v2, 0
	v_mov_b32_e32 v3, 0
.LBB0_5:                                ; %Flow54
	v_mad_u64_u32 v[4:5], null, v1, s6, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v5, 31, v4
	v_lshlrev_b64 v[0:1], 3, v[4:5]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b64 v[0:1], v[2:3], off
.LBB0_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z15gpu_matrix_multPdS_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	_Z15gpu_matrix_multPdS_S_iii, .Lfunc_end0-_Z15gpu_matrix_multPdS_S_iii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 352
; 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	_Z20compute_K_matrix_gpuiPdP10node_coordi ; -- Begin function _Z20compute_K_matrix_gpuiPdP10node_coordi
	.globl	_Z20compute_K_matrix_gpuiPdP10node_coordi
	.p2align	8
	.type	_Z20compute_K_matrix_gpuiPdP10node_coordi,@function
_Z20compute_K_matrix_gpuiPdP10node_coordi: ; @_Z20compute_K_matrix_gpuiPdP10node_coordi
; %bb.0:
	s_load_b32 s33, s[0:1], 0x18
	v_mov_b32_e32 v3, 0
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, n@rel32@lo+4
	s_addc_u32 s3, s3, n@rel32@hi+12
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s33, s33, s33
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v1, s33
	global_store_b32 v3, v1, s[2:3]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_u32_e64 s33, v0
	s_cbranch_execz .LBB1_5
; %bb.1:                                ; %.preheader.preheader
	s_clause 0x1
	s_load_b32 s40, s[0:1], 0x0
	s_load_b128 s[4:7], s[0:1], 0x8
	v_mul_lo_u32 v4, v0, s33
	s_mov_b32 s2, 0x652b82fe
	s_mov_b32 s8, 0xfefa39ef
	s_mov_b32 s10, 0x3b39803f
	s_mov_b32 s12, 0xfca7ab0c
	s_mov_b32 s14, 0x6a5dcb37
	s_mov_b32 s16, 0x623fde64
	s_mov_b32 s18, 0x7c89e6b0
	s_mov_b32 s20, 0x14761f6e
	s_mov_b32 s22, 0x1852b7b0
	s_mov_b32 s24, 0x11122322
	s_mov_b32 s26, 0x555502a1
	s_mov_b32 s28, 0x55555511
	s_mov_b32 s30, 11
	s_mov_b32 s34, 0x47ae147b
	s_mov_b32 s3, 0xbff71547
	s_mov_b32 s9, 0xbfe62e42
	s_mov_b32 s11, 0xbc7abc9e
	s_mov_b32 s13, 0x3e928af3
	s_waitcnt lgkmcnt(0)
	s_add_u32 s36, s6, 8
	s_mov_b32 s15, 0x3e5ade15
	s_mov_b32 s17, 0x3ec71dee
	s_mov_b32 s19, 0x3efa0199
	s_mov_b32 s21, 0x3f2a01a0
	s_mov_b32 s23, 0x3f56c16c
	s_mov_b32 s25, 0x3f811111
	s_mov_b32 s27, 0x3fa55555
	s_mov_b32 s29, 0x3fc55555
	s_mov_b32 s31, 0x3fe00000
	s_mov_b32 s35, 0x3f847ae1
	s_mul_i32 s1, s33, s40
	s_addc_u32 s37, s7, 0
	s_mov_b32 s41, 0
.LBB1_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_3 Depth 2
	v_ashrrev_i32_e32 v1, 31, v0
	s_mov_b64 s[38:39], s[36:37]
	s_mov_b32 s42, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[1:2], 4, v[0:1]
	v_add_co_u32 v1, vcc_lo, s6, v1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v2, vcc_lo, s7, v2, vcc_lo
.LBB1_3:                                ;   Parent Loop BB1_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_b128 v[5:8], v[1:2], off
	global_load_b128 v[9:12], v3, s[38:39] offset:-8
	v_cmp_eq_u32_e64 s0, s42, v0
	s_waitcnt vmcnt(0)
	v_add_f64 v[7:8], v[7:8], -v[11:12]
	v_add_f64 v[5:6], v[5:6], -v[9:10]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[7:8], v[7:8], v[7:8]
	v_fma_f64 v[5:6], v[5:6], v[5:6], v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mul_f64 v[7:8], v[5:6], s[2:3]
	v_cmp_nlt_f64_e32 vcc_lo, 0x4090cc00, v[5:6]
	v_rndne_f64_e32 v[7:8], v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fma_f64 v[9:10], v[7:8], s[8:9], -v[5:6]
	v_cvt_i32_f64_e32 v13, v[7:8]
	v_fma_f64 v[9:10], v[7:8], s[10:11], v[9:10]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[11:12], v[9:10], s[14:15], s[12:13]
	v_fma_f64 v[11:12], v[9:10], v[11:12], s[16:17]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[11:12], v[9:10], v[11:12], s[18:19]
	v_fma_f64 v[11:12], v[9:10], v[11:12], s[20:21]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[11:12], v[9:10], v[11:12], s[22:23]
	v_fma_f64 v[11:12], v[9:10], v[11:12], s[24:25]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[11:12], v[9:10], v[11:12], s[26:27]
	v_fma_f64 v[11:12], v[9:10], v[11:12], s[28:29]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[11:12], v[9:10], v[11:12], s[30:31]
	v_fma_f64 v[11:12], v[9:10], v[11:12], 1.0
	s_delay_alu instid0(VALU_DEP_1)
	v_fma_f64 v[7:8], v[9:10], v[11:12], 1.0
	v_add_nc_u32_e32 v9, s42, v4
	s_add_i32 s42, s42, 1
	s_add_u32 s38, s38, 16
	s_addc_u32 s39, s39, 0
	s_cmp_eq_u32 s33, s42
	v_ashrrev_i32_e32 v10, 31, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_lshlrev_b64 v[9:10], 3, v[9:10]
	v_ldexp_f64 v[7:8], v[7:8], v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_dual_cndmask_b32 v6, 0, v8 :: v_dual_cndmask_b32 v5, 0, v7
	v_add_co_u32 v9, vcc_lo, s4, v9
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v10, vcc_lo, s5, v10, vcc_lo
	v_add_f64 v[7:8], v[5:6], s[34:35]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e64 v6, v6, v8, s0
	v_cndmask_b32_e64 v5, v5, v7, s0
	global_store_b64 v[9:10], v[5:6], off
	s_cbranch_scc0 .LBB1_3
; %bb.4:                                ; %._crit_edge
                                        ;   in Loop: Header=BB1_2 Depth=1
	v_add_nc_u32_e32 v0, s40, v0
	v_add_nc_u32_e32 v4, s1, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_le_i32_e32 vcc_lo, s33, v0
	s_or_b32 s41, vcc_lo, s41
	s_and_not1_b32 exec_lo, exec_lo, s41
	s_cbranch_execnz .LBB1_2
.LBB1_5:                                ; %._crit_edge37
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z20compute_K_matrix_gpuiPdP10node_coordi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 28
		.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 14
		.amdhsa_next_free_sgpr 43
		.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	_Z20compute_K_matrix_gpuiPdP10node_coordi, .Lfunc_end1-_Z20compute_K_matrix_gpuiPdP10node_coordi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 756
; NumSgprs: 45
; NumVgprs: 14
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 5
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 45
; NumVGPRsForWavesPerEU: 14
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z15device_run_choliPdS_S_i ; -- Begin function _Z15device_run_choliPdS_S_i
	.globl	_Z15device_run_choliPdS_S_i
	.p2align	8
	.type	_Z15device_run_choliPdS_S_i,@function
_Z15device_run_choliPdS_S_i:            ; @_Z15device_run_choliPdS_S_i
; %bb.0:
	s_load_b32 s33, s[0:1], 0x20
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s33, 1
	s_cbranch_scc1 .LBB2_31
; %bb.1:                                ; %.preheader.lr.ph
	s_clause 0x2
	s_load_b32 s8, s[0:1], 0x0
	s_load_b64 s[10:11], s[0:1], 0x18
	s_load_b128 s[4:7], s[0:1], 0x8
	v_dual_mov_b32 v1, 0 :: v_dual_lshlrev_b32 v2, 3, v0
	v_cmp_eq_u32_e64 s0, 0, v0
	v_mov_b32_e32 v5, v0
	s_mov_b32 s14, 0x55555555
	s_mov_b32 s16, 0x968915a9
	s_mov_b32 s18, 0x4222de17
	s_mov_b32 s20, 0x3abe935a
	s_mov_b32 s22, 0x47e6c9c2
	s_mov_b32 s28, 0xcfa74449
	s_mov_b32 s30, 0x71bf3c30
	s_mov_b32 s34, 0x1c7792ce
	s_mov_b32 s36, 0x924920da
	s_mov_b32 s38, 0x9999999c
	s_mov_b32 s40, 0xfefa39ef
	s_mov_b32 s42, 0x3b39803f
	s_mov_b32 s46, 0xd5df274d
	s_waitcnt lgkmcnt(0)
	s_ashr_i32 s9, s8, 31
	v_add_co_u32 v3, s1, s10, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v4, null, s11, 0, s1
	s_lshl_b64 s[24:25], s[8:9], 3
	s_add_u32 s26, s10, 8
	s_mov_b32 s48, 0x652b82fe
	s_mov_b32 s50, 0xfca7ab0c
	s_mov_b32 s52, 0x6a5dcb37
	s_mov_b32 s54, 0x623fde64
	s_mov_b32 s56, 0x7c89e6b0
	s_mov_b32 s58, 0x14761f6e
	s_mov_b32 s60, 0x1852b7b0
	s_mov_b32 s62, 0x11122322
	s_mov_b32 s64, 0x555502a1
	s_mov_b32 s66, 0x55555511
	s_mov_b32 s68, 11
	s_mov_b32 s13, 0
	s_mov_b32 s15, 0x3fe55555
	s_mov_b32 s17, 0x3fba6564
	s_mov_b32 s19, 0x3fbdee67
	s_mov_b32 s21, 0x3fbe25e4
	s_mov_b32 s23, 0x3fc110ef
	s_addc_u32 s27, s11, 0
	s_mov_b32 s29, 0x3fc3b13b
	s_mov_b32 s31, 0x3fc745d1
	s_mov_b32 s35, 0x3fcc71c7
	s_mov_b32 s37, 0x3fd24924
	s_mov_b32 s39, 0x3fd99999
	s_mov_b32 s41, 0x3fe62e42
	s_mov_b32 s43, 0x3c7abc9e
	s_mov_b32 s45, 0xbfe55555
	s_mov_b32 s47, 0x3c8543b0
	s_mov_b32 s49, 0x3ff71547
	s_mov_b32 s51, 0x3e928af3
	s_mov_b32 s53, 0x3e5ade15
	s_mov_b32 s55, 0x3ec71dee
	s_mov_b32 s57, 0x3efa0199
	s_mov_b32 s59, 0x3f2a01a0
	s_mov_b32 s61, 0x3f56c16c
	s_mov_b32 s63, 0x3f811111
	s_mov_b32 s65, 0x3fa55555
	s_mov_b32 s67, 0x3fc55555
	s_mov_b32 s69, 0x3fe00000
	s_mov_b32 s71, 0xbfe62e42
	s_mov_b32 s73, 0xbc7abc9e
	s_mov_b32 s9, 0
.LBB2_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB2_3 Depth 2
                                        ;       Child Loop BB2_11 Depth 3
                                        ;       Child Loop BB2_14 Depth 3
                                        ;       Child Loop BB2_22 Depth 3
                                        ;       Child Loop BB2_25 Depth 3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_min_i32 s78, s8, s9
	v_ashrrev_i32_e32 v6, 31, v5
	s_and_b32 s1, s78, 1
	v_mov_b32_e32 v10, v0
	s_add_i32 s78, s78, s1
	s_mul_i32 s1, s9, s33
	s_add_i32 s79, s78, -1
	s_cmp_gt_i32 s78, 1
	v_lshlrev_b64 v[6:7], 3, v[5:6]
	s_cselect_b32 s80, -1, 0
	s_add_i32 s2, s1, s9
	v_cmp_gt_u32_e64 s1, s9, v0
	s_ashr_i32 s3, s2, 31
	s_mov_b32 s81, s13
	v_add_co_u32 v8, vcc_lo, s6, v6
	s_lshl_b64 s[2:3], s[2:3], 3
	v_add_co_ci_u32_e32 v9, vcc_lo, s7, v7, vcc_lo
	s_add_u32 s74, s6, s2
	s_addc_u32 s75, s7, s3
	s_add_u32 s76, s4, s2
	s_addc_u32 s77, s5, s3
.LBB2_3:                                ;   Parent Loop BB2_2 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB2_11 Depth 3
                                        ;       Child Loop BB2_14 Depth 3
                                        ;       Child Loop BB2_22 Depth 3
                                        ;       Child Loop BB2_25 Depth 3
	s_cmp_lg_u32 s81, s9
	s_mov_b32 s2, -1
	s_cbranch_scc0 .LBB2_19
; %bb.4:                                ;   in Loop: Header=BB2_3 Depth=2
	s_cmp_le_u32 s81, s9
	s_cbranch_scc0 .LBB2_8
; %bb.5:                                ;   in Loop: Header=BB2_3 Depth=2
	s_and_saveexec_b32 s2, s0
	s_cbranch_execz .LBB2_7
; %bb.6:                                ;   in Loop: Header=BB2_3 Depth=2
	s_mul_i32 s3, s81, s33
	v_mov_b32_e32 v2, v1
	s_add_i32 s12, s3, s9
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[82:83], s[12:13], 3
	s_add_u32 s82, s6, s82
	s_addc_u32 s83, s7, s83
	global_store_b64 v1, v[1:2], s[82:83]
.LBB2_7:                                ; %Flow
                                        ;   in Loop: Header=BB2_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s2
	s_mov_b32 s2, 0
.LBB2_8:                                ; %Flow147
                                        ;   in Loop: Header=BB2_3 Depth=2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s2
	s_cbranch_vccnz .LBB2_18
; %bb.9:                                ;   in Loop: Header=BB2_3 Depth=2
	v_mov_b32_e32 v2, v1
	global_store_b64 v[3:4], v[1:2], off
	s_and_saveexec_b32 s12, s1
	s_cbranch_execz .LBB2_12
; %bb.10:                               ; %.lr.ph
                                        ;   in Loop: Header=BB2_3 Depth=2
	v_ashrrev_i32_e32 v11, 31, v10
	v_dual_mov_b32 v13, 0 :: v_dual_mov_b32 v2, v0
	v_mov_b32_e32 v14, 0
	s_mov_b32 s44, 0
	s_delay_alu instid0(VALU_DEP_3)
	v_lshlrev_b64 v[11:12], 3, v[10:11]
	s_mov_b64 s[2:3], s[6:7]
.LBB2_11:                               ;   Parent Loop BB2_2 Depth=1
                                        ;     Parent Loop BB2_3 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_add_co_u32 v15, vcc_lo, s2, v11
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v16, vcc_lo, s3, v12, vcc_lo
	v_add_co_u32 v17, vcc_lo, s2, v6
	v_add_co_ci_u32_e32 v18, vcc_lo, s3, v7, vcc_lo
	v_add_nc_u32_e32 v2, s8, v2
	s_clause 0x1
	global_load_b64 v[15:16], v[15:16], off
	global_load_b64 v[17:18], v[17:18], off
	s_add_u32 s2, s2, s24
	s_addc_u32 s3, s3, s25
	v_cmp_le_i32_e32 vcc_lo, s9, v2
	s_or_b32 s44, vcc_lo, s44
	s_waitcnt vmcnt(0)
	v_fma_f64 v[13:14], v[15:16], v[17:18], v[13:14]
	global_store_b64 v[3:4], v[13:14], off
	s_and_not1_b32 exec_lo, exec_lo, s44
	s_cbranch_execnz .LBB2_11
.LBB2_12:                               ; %Flow146
                                        ;   in Loop: Header=BB2_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s12
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s44, s0
	s_cbranch_execz .LBB2_17
; %bb.13:                               ;   in Loop: Header=BB2_3 Depth=2
	global_load_b64 v[11:12], v1, s[10:11]
	v_mov_b32_e32 v2, s78
	s_getpc_b64 s[82:83]
	s_add_u32 s82, s82, count@rel32@lo+4
	s_addc_u32 s83, s83, count@rel32@hi+12
	s_and_not1_b32 vcc_lo, exec_lo, s80
	s_mov_b64 s[2:3], s[26:27]
	s_mov_b32 s12, s79
	global_store_b32 v1, v2, s[82:83]
	s_cbranch_vccnz .LBB2_16
.LBB2_14:                               ; %.lr.ph.i86
                                        ;   Parent Loop BB2_2 Depth=1
                                        ;     Parent Loop BB2_3 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	global_load_b64 v[13:14], v1, s[2:3]
	s_add_i32 s12, s12, -1
	s_add_u32 s2, s2, 8
	s_addc_u32 s3, s3, 0
	s_cmp_lg_u32 s12, 0
	s_waitcnt vmcnt(0)
	v_add_f64 v[11:12], v[11:12], v[13:14]
	s_cbranch_scc1 .LBB2_14
; %bb.15:                               ; %..loopexit_crit_edge.i90
                                        ;   in Loop: Header=BB2_3 Depth=2
	global_store_b64 v1, v[11:12], s[10:11]
.LBB2_16:                               ; %_Z13get_total_sumPdi.exit91
                                        ;   in Loop: Header=BB2_3 Depth=2
	s_mul_i32 s2, s81, s33
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_add_i32 s12, s2, s9
	s_lshl_b64 s[2:3], s[12:13], 3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s82, s4, s2
	s_addc_u32 s83, s5, s3
	s_add_u32 s2, s6, s2
	global_load_b64 v[13:14], v1, s[82:83]
	s_addc_u32 s3, s7, s3
	s_waitcnt vmcnt(0)
	v_add_f64 v[11:12], v[13:14], -v[11:12]
	global_store_b64 v1, v[11:12], s[2:3]
	global_load_b64 v[13:14], v1, s[74:75]
	s_waitcnt vmcnt(0)
	v_div_scale_f64 v[15:16], null, v[13:14], v[13:14], v[11:12]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[17:18], v[15:16]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[19:20], -v[15:16], v[17:18], 1.0
	v_fma_f64 v[17:18], v[17:18], v[19:20], v[17:18]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[19:20], -v[15:16], v[17:18], 1.0
	v_fma_f64 v[17:18], v[17:18], v[19:20], v[17:18]
	v_div_scale_f64 v[19:20], vcc_lo, v[11:12], v[13:14], v[11:12]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[21:22], v[19:20], v[17:18]
	v_fma_f64 v[15:16], -v[15:16], v[21:22], v[19:20]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[15:16], v[15:16], v[17:18], v[21:22]
	v_div_fixup_f64 v[11:12], v[15:16], v[13:14], v[11:12]
	global_store_b64 v1, v[11:12], s[2:3]
.LBB2_17:                               ; %Flow144
                                        ;   in Loop: Header=BB2_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s44
.LBB2_18:                               ; %Flow148
                                        ;   in Loop: Header=BB2_3 Depth=2
	s_mov_b32 s2, 0
.LBB2_19:                               ; %Flow153
                                        ;   in Loop: Header=BB2_3 Depth=2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s2
	s_cbranch_vccnz .LBB2_29
; %bb.20:                               ;   in Loop: Header=BB2_3 Depth=2
	v_mov_b32_e32 v2, v1
	global_store_b64 v[3:4], v[1:2], off
	s_and_saveexec_b32 s12, s1
	s_cbranch_execz .LBB2_23
; %bb.21:                               ; %.lr.ph97.preheader
                                        ;   in Loop: Header=BB2_3 Depth=2
	v_dual_mov_b32 v11, 0 :: v_dual_mov_b32 v14, v9
	v_dual_mov_b32 v12, 0 :: v_dual_mov_b32 v13, v8
	v_mov_b32_e32 v2, v0
	s_mov_b32 s82, 0
.LBB2_22:                               ; %.lr.ph97
                                        ;   Parent Loop BB2_2 Depth=1
                                        ;     Parent Loop BB2_3 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	global_load_b64 v[15:16], v[13:14], off
	s_mov_b32 s44, s14
	s_mov_b32 s70, s40
	s_mov_b32 s72, s42
	v_add_nc_u32_e32 v2, s8, v2
	s_waitcnt vmcnt(0)
	v_frexp_mant_f64_e64 v[17:18], |v[15:16]|
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_gt_f64_e32 vcc_lo, s[14:15], v[17:18]
	v_cndmask_b32_e64 v19, 0, 1, vcc_lo
	v_ldexp_f64 v[17:18], v[17:18], v19
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f64 v[19:20], v[17:18], 1.0
	v_add_f64 v[25:26], v[17:18], -1.0
	v_rcp_f64_e32 v[21:22], v[19:20]
	v_add_f64 v[27:28], v[19:20], -1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_f64 v[17:18], v[17:18], -v[27:28]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[23:24], -v[19:20], v[21:22], 1.0
	v_fma_f64 v[21:22], v[23:24], v[21:22], v[21:22]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[23:24], -v[19:20], v[21:22], 1.0
	v_fma_f64 v[21:22], v[23:24], v[21:22], v[21:22]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[23:24], v[25:26], v[21:22]
	v_mul_f64 v[29:30], v[19:20], v[23:24]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[19:20], v[23:24], v[19:20], -v[29:30]
	v_fma_f64 v[17:18], v[23:24], v[17:18], v[19:20]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[19:20], v[29:30], v[17:18]
	v_add_f64 v[27:28], v[25:26], -v[19:20]
	v_add_f64 v[29:30], v[19:20], -v[29:30]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[25:26], v[25:26], -v[27:28]
	v_add_f64 v[17:18], v[29:30], -v[17:18]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[19:20], v[25:26], -v[19:20]
	v_add_f64 v[17:18], v[17:18], v[19:20]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[17:18], v[27:28], v[17:18]
	v_mul_f64 v[17:18], v[21:22], v[17:18]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[19:20], v[23:24], v[17:18]
	v_add_f64 v[21:22], v[19:20], -v[23:24]
	v_mul_f64 v[23:24], v[19:20], v[19:20]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[17:18], v[17:18], -v[21:22]
	v_fma_f64 v[21:22], v[19:20], v[19:20], -v[23:24]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[25:26], v[17:18], v[17:18]
	v_fma_f64 v[21:22], v[19:20], v[25:26], v[21:22]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[25:26], v[23:24], v[21:22]
	v_fma_f64 v[27:28], v[25:26], s[18:19], s[16:17]
	v_add_f64 v[23:24], v[25:26], -v[23:24]
	v_mul_f64 v[31:32], v[19:20], v[25:26]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[27:28], v[25:26], v[27:28], s[20:21]
	v_add_f64 v[21:22], v[21:22], -v[23:24]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[35:36], v[25:26], v[19:20], -v[31:32]
	v_fma_f64 v[27:28], v[25:26], v[27:28], s[22:23]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[27:28], v[25:26], v[27:28], s[28:29]
	v_fma_f64 v[27:28], v[25:26], v[27:28], s[30:31]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[27:28], v[25:26], v[27:28], s[34:35]
	v_fma_f64 v[27:28], v[25:26], v[27:28], s[36:37]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[27:28], v[25:26], v[27:28], s[38:39]
	v_mul_f64 v[29:30], v[25:26], v[27:28]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_fma_f64 v[23:24], v[25:26], v[27:28], -v[29:30]
	v_fma_f64 v[25:26], v[25:26], v[17:18], v[35:36]
	v_ldexp_f64 v[17:18], v[17:18], 1
	v_fma_f64 v[23:24], v[21:22], v[27:28], v[23:24]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fma_f64 v[21:22], v[21:22], v[19:20], v[25:26]
	v_ldexp_f64 v[19:20], v[19:20], 1
	v_add_f64 v[27:28], v[29:30], v[23:24]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[25:26], v[31:32], v[21:22]
	v_add_f64 v[33:34], v[27:28], s[14:15]
	v_add_f64 v[29:30], v[27:28], -v[29:30]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[31:32], v[25:26], -v[31:32]
	v_add_f64 v[37:38], v[33:34], s[44:45]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[23:24], v[23:24], -v[29:30]
	v_add_f64 v[21:22], v[21:22], -v[31:32]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[27:28], v[27:28], -v[37:38]
	v_add_f64 v[23:24], v[23:24], s[46:47]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[23:24], v[23:24], v[27:28]
	v_add_f64 v[27:28], v[33:34], v[23:24]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f64 v[29:30], v[33:34], -v[27:28]
	v_mul_f64 v[33:34], v[25:26], v[27:28]
	v_add_f64 v[23:24], v[23:24], v[29:30]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[29:30], v[25:26], v[27:28], -v[33:34]
	v_fma_f64 v[23:24], v[25:26], v[23:24], v[29:30]
	v_frexp_exp_i32_f64_e32 v25, v[15:16]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[21:22], v[21:22], v[27:28], v[23:24]
	v_subrev_co_ci_u32_e32 v25, vcc_lo, 0, v25, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cvt_f64_i32_e32 v[25:26], v25
	v_add_f64 v[23:24], v[33:34], v[21:22]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[31:32], v[25:26], s[40:41]
	v_add_f64 v[27:28], v[19:20], v[23:24]
	v_add_f64 v[29:30], v[23:24], -v[33:34]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[19:20], v[27:28], -v[19:20]
	v_add_f64 v[21:22], v[21:22], -v[29:30]
	v_fma_f64 v[29:30], v[25:26], s[40:41], -v[31:32]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[19:20], v[23:24], -v[19:20]
	v_add_f64 v[17:18], v[17:18], v[21:22]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[21:22], v[25:26], s[42:43], v[29:30]
	v_add_f64 v[17:18], v[17:18], v[19:20]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[19:20], v[31:32], v[21:22]
	v_add_f64 v[23:24], v[27:28], v[17:18]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[31:32], v[19:20], -v[31:32]
	v_add_f64 v[25:26], v[19:20], v[23:24]
	v_add_f64 v[27:28], v[23:24], -v[27:28]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[21:22], v[21:22], -v[31:32]
	v_add_f64 v[29:30], v[25:26], -v[19:20]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[17:18], v[17:18], -v[27:28]
	v_add_f64 v[33:34], v[25:26], -v[29:30]
	v_add_f64 v[23:24], v[23:24], -v[29:30]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[27:28], v[21:22], v[17:18]
	v_add_f64 v[19:20], v[19:20], -v[33:34]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[19:20], v[23:24], v[19:20]
	v_add_f64 v[23:24], v[27:28], -v[21:22]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[19:20], v[27:28], v[19:20]
	v_add_f64 v[27:28], v[27:28], -v[23:24]
	v_add_f64 v[17:18], v[17:18], -v[23:24]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[29:30], v[25:26], v[19:20]
	v_add_f64 v[21:22], v[21:22], -v[27:28]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[23:24], v[29:30], -v[25:26]
	v_add_f64 v[17:18], v[17:18], v[21:22]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[19:20], v[19:20], -v[23:24]
	v_add_f64 v[17:18], v[17:18], v[19:20]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[19:20], v[29:30], v[17:18]
	v_add_f64 v[21:22], v[19:20], -v[29:30]
	v_add_f64 v[23:24], v[19:20], v[19:20]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[17:18], v[17:18], -v[21:22]
	v_fma_f64 v[19:20], v[19:20], 2.0, -v[23:24]
	v_cmp_class_f64_e64 vcc_lo, v[23:24], 0x204
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[17:18], v[17:18], 2.0, v[19:20]
	v_add_f64 v[19:20], v[23:24], v[17:18]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_cndmask_b32 v22, v20, v24 :: v_dual_cndmask_b32 v21, v19, v23
	v_add_f64 v[19:20], v[19:20], -v[23:24]
	v_mul_f64 v[25:26], v[21:22], s[48:49]
	v_cmp_nlt_f64_e64 s2, 0x40900000, v[21:22]
	v_cmp_neq_f64_e64 vcc_lo, 0x7ff00000, |v[21:22]|
	v_cmp_ngt_f64_e64 s3, 0xc090cc00, v[21:22]
	v_add_f64 v[17:18], v[17:18], -v[19:20]
	v_rndne_f64_e32 v[25:26], v[25:26]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_dual_cndmask_b32 v18, 0, v18 :: v_dual_cndmask_b32 v17, 0, v17
	s_and_b32 vcc_lo, s3, s2
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fma_f64 v[27:28], v[25:26], s[70:71], v[21:22]
	v_cvt_i32_f64_e32 v31, v[25:26]
	v_fma_f64 v[27:28], v[25:26], s[72:73], v[27:28]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[29:30], v[27:28], s[52:53], s[50:51]
	v_fma_f64 v[29:30], v[27:28], v[29:30], s[54:55]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[29:30], v[27:28], v[29:30], s[56:57]
	v_fma_f64 v[29:30], v[27:28], v[29:30], s[58:59]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[29:30], v[27:28], v[29:30], s[60:61]
	v_fma_f64 v[29:30], v[27:28], v[29:30], s[62:63]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[29:30], v[27:28], v[29:30], s[64:65]
	v_fma_f64 v[29:30], v[27:28], v[29:30], s[66:67]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[29:30], v[27:28], v[29:30], s[68:69]
	v_fma_f64 v[29:30], v[27:28], v[29:30], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[25:26], v[27:28], v[29:30], 1.0
	v_ldexp_f64 v[23:24], v[25:26], v31
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e64 v19, 0x7ff00000, v24, s2
	v_cmp_neq_f64_e64 s2, 0x7ff00000, |v[15:16]|
	v_cndmask_b32_e64 v20, 0, v19, s3
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v19, 0, v23, vcc_lo
	v_cmp_neq_f64_e64 s3, 0, v[15:16]
	v_fma_f64 v[17:18], v[19:20], v[17:18], v[19:20]
	v_cmp_class_f64_e64 vcc_lo, v[19:20], 0x204
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_dual_cndmask_b32 v18, v18, v20 :: v_dual_cndmask_b32 v15, v17, v19
	s_and_b32 vcc_lo, s3, s2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_cndmask_b32 v15, 0, v15 :: v_dual_and_b32 v18, 0x7fffffff, v18
	v_cmp_le_i32_e32 vcc_lo, s9, v2
	v_cndmask_b32_e64 v18, 0x7ff00000, v18, s2
	v_add_co_u32 v13, s2, v13, s24
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v14, s2, s25, v14, s2
	v_cndmask_b32_e64 v16, 0, v18, s3
	s_or_b32 s82, vcc_lo, s82
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f64 v[11:12], v[11:12], v[15:16]
	global_store_b64 v[3:4], v[11:12], off
	s_and_not1_b32 exec_lo, exec_lo, s82
	s_cbranch_execnz .LBB2_22
.LBB2_23:                               ; %Flow152
                                        ;   in Loop: Header=BB2_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s12
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s12, s0
	s_cbranch_execz .LBB2_28
; %bb.24:                               ;   in Loop: Header=BB2_3 Depth=2
	global_load_b64 v[11:12], v1, s[10:11]
	v_mov_b32_e32 v2, s78
	s_getpc_b64 s[82:83]
	s_add_u32 s82, s82, count@rel32@lo+4
	s_addc_u32 s83, s83, count@rel32@hi+12
	s_and_not1_b32 vcc_lo, exec_lo, s80
	s_mov_b64 s[2:3], s[26:27]
	s_mov_b32 s44, s79
	global_store_b32 v1, v2, s[82:83]
	s_cbranch_vccnz .LBB2_27
.LBB2_25:                               ; %.lr.ph.i
                                        ;   Parent Loop BB2_2 Depth=1
                                        ;     Parent Loop BB2_3 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	global_load_b64 v[13:14], v1, s[2:3]
	s_add_i32 s44, s44, -1
	s_add_u32 s2, s2, 8
	s_addc_u32 s3, s3, 0
	s_cmp_lg_u32 s44, 0
	s_waitcnt vmcnt(0)
	v_add_f64 v[11:12], v[11:12], v[13:14]
	s_cbranch_scc1 .LBB2_25
; %bb.26:                               ; %..loopexit_crit_edge.i
                                        ;   in Loop: Header=BB2_3 Depth=2
	global_store_b64 v1, v[11:12], s[10:11]
.LBB2_27:                               ; %_Z13get_total_sumPdi.exit
                                        ;   in Loop: Header=BB2_3 Depth=2
	global_load_b64 v[13:14], v1, s[76:77]
	s_waitcnt vmcnt(0)
	v_add_f64 v[11:12], v[13:14], -v[11:12]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_cmp_gt_f64_e32 vcc_lo, 0x10000000, v[11:12]
	v_cndmask_b32_e64 v2, 0, 1, vcc_lo
	s_and_b32 s2, vcc_lo, exec_lo
	s_cselect_b32 s2, 0xffffff80, 0
	v_lshlrev_b32_e32 v2, 8, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ldexp_f64 v[11:12], v[11:12], v2
	v_rsq_f64_e32 v[13:14], v[11:12]
	v_cmp_class_f64_e64 vcc_lo, v[11:12], 0x260
	s_waitcnt_depctr 0xfff
	v_mul_f64 v[15:16], v[11:12], v[13:14]
	v_mul_f64 v[13:14], v[13:14], 0.5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[17:18], -v[13:14], v[15:16], 0.5
	v_fma_f64 v[15:16], v[15:16], v[17:18], v[15:16]
	v_fma_f64 v[13:14], v[13:14], v[17:18], v[13:14]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[17:18], -v[15:16], v[15:16], v[11:12]
	v_fma_f64 v[15:16], v[17:18], v[13:14], v[15:16]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[17:18], -v[15:16], v[15:16], v[11:12]
	v_fma_f64 v[13:14], v[17:18], v[13:14], v[15:16]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ldexp_f64 v[13:14], v[13:14], s2
	v_dual_cndmask_b32 v11, v13, v11 :: v_dual_cndmask_b32 v12, v14, v12
	global_store_b64 v1, v[11:12], s[74:75]
.LBB2_28:                               ; %Flow150
                                        ;   in Loop: Header=BB2_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s12
.LBB2_29:                               ; %.critedge
                                        ;   in Loop: Header=BB2_3 Depth=2
	v_add_nc_u32_e32 v10, s33, v10
	s_add_i32 s81, s81, 1
	s_waitcnt_vscnt null, 0x0
	s_cmp_eq_u32 s81, s33
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc0 .LBB2_3
; %bb.30:                               ; %._crit_edge102
                                        ;   in Loop: Header=BB2_2 Depth=1
	v_add_nc_u32_e32 v5, s33, v5
	s_add_i32 s9, s9, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s9, s33
	s_cbranch_scc0 .LBB2_2
.LBB2_31:                               ; %._crit_edge104
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z15device_run_choliPdS_S_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 36
		.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 39
		.amdhsa_next_free_sgpr 84
		.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	_Z15device_run_choliPdS_S_i, .Lfunc_end2-_Z15device_run_choliPdS_S_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 3184
; NumSgprs: 86
; NumVgprs: 39
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 10
; VGPRBlocks: 4
; NumSGPRsForWavesPerEU: 86
; NumVGPRsForWavesPerEU: 39
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.protected	n                       ; @n
	.type	n,@object
	.section	.bss,"aw",@nobits
	.globl	n
	.p2align	2, 0x0
n:
	.long	0                               ; 0x0
	.size	n, 4

	.protected	count                   ; @count
	.type	count,@object
	.globl	count
	.p2align	2, 0x0
count:
	.long	0                               ; 0x0
	.size	count, 4

	.protected	node_coord              ; @node_coord
	.type	node_coord,@object
	.globl	node_coord
	.p2align	3, 0x0
node_coord:
	.zero	16
	.size	node_coord, 16

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

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym n
	.addrsig_sym count
	.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:           _Z15gpu_matrix_multPdS_S_iii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z15gpu_matrix_multPdS_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:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .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
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 28
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z20compute_K_matrix_gpuiPdP10node_coordi
    .private_segment_fixed_size: 0
    .sgpr_count:     45
    .sgpr_spill_count: 0
    .symbol:         _Z20compute_K_matrix_gpuiPdP10node_coordi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     14
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 36
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z15device_run_choliPdS_S_i
    .private_segment_fixed_size: 0
    .sgpr_count:     86
    .sgpr_spill_count: 0
    .symbol:         _Z15device_run_choliPdS_S_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     39
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
