//***************************************************************************
//  Broday Walker
//  Dr. Eduardo Colmenares
//   
//
//***************************************************************************

#include <cuda.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

const int GRID_X = 1; // Number of blocks in the grid on the x-axis 
const int BLOCK_X = 7; // Number of threads on the x-axis per block
const int SIZE = 49;

// Hold the adjacency matrix in constant memory on the device as it will not be
// modified over the lifetime of the program
__constant__ int adjMat_d[SIZE];

__global__ void dijkstra(int *dist_d, int *parent_d, int *visited_d, int s, int width)
{   
    int tid_x = threadIdx.x;
    int block_x = blockIdx.x;
    int grid_x = gridDim.x;




}

// A kernel for testing if the adjacency matrix was actually copied to the constant
// memory on the device
__global__ void printAdjMat(int *test, int width)
{
    int tid_x = threadIdx.x;
    
    for(int i = 0; i < width; i++)
        test[i * width + tid_x] = adjMat_d[i * width + tid_x];
}

int main()
{
    int vertices;

    cin >> vertices;

    while(vertices != 0)
    {
        // Host Declarations
        int adj_size, dist_size, parent_size, visited_size, start, end;
        int *adjMat, *dist, *parent, *visited;

        // Device declarations
        int *adj_d, *dist_d, *parent_d, *visited_d;

        // For error checking
        cudaError_t cudaErr;

        // This is a linearized adjacency matrix
        adjMat = new int[vertices * vertices];
        dist = new int[vertices];
        parent = new int[vertices];
        visited = new int[vertices];

        // Find size of arrays in bytes
        adj_size = vertices * vertices * sizeof(int);
        dist_size = vertices * sizeof(int); // Equal to the number of vertices
        parent_size = vertices * sizeof(int);
        visited_size = vertices * sizeof(int);

        // Fill the adjacency-matrix with 0s
        for(int i = 0; i < vertices * vertices; i++)
            adjMat[i] = -1;

        // A vertex does not have a parent if its value is -1 (after running 
        // Dijkstra's algorithm, this will only be true for the starting vertex).
        for(int i = 0; i < vertices; i++)
        {
            dist[i] = INT_MAX;
            parent[i] = -1;
            visited[i] = 0;
        }

        // Fill the adjacency matrix with data
        for(int i = 0; i < vertices; i++)
        {
            // Temporary storage for adjacent vertices and the weight of the edge
            int num_edges, u, w;

            // Read in the number of adjacent vertices for the ith vertex
            cin >> num_edges;

            // Add the adjacent vertices to the linearized adjacency-matrix for the ith vertex
            for(int j = 0; j < num_edges; j++)
            {
                cin >> u >> w;
                int offset = i * vertices + u;

                if(adjMat[offset] == -1 || w < adjMat[offset])
                    // This is basically blockIdx.x * blockDim.x + threadIdx.x where blockIdx.x 
                    // corresponds with the iteration of the loop we are on
                    adjMat[offset] = w;
            }
        }

        cin >> start >> end;
        dist[start] = 0;

        // Print weights for testing
        printf("Test print of all weights: \n");
        printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
        for(int i = 0; i < vertices; i++)
        {
            cout << "Row " << i << ": ";

            for(int j = 0; j < vertices; j++)
                cout << "{" << adjMat[i * vertices + j] << "} ";
            cout << '\n';
        }
        printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
        cout << "\n\n";
            
        // Copy the adjacency-matrix to constant memory on the device
        cudaErr = cudaMemcpyToSymbol(adjMat_d, adjMat, adj_size);
        
        if(cudaErr != cudaSuccess)
        {
            printf("Error copying from host to device symbol\n");
            return 1;
        }
        else
            printf("Successful copy from host to device symbol\n");
        
        // Set the dimensions of the grid and blocks
        dim3 gridDim(GRID_X, 1);
        dim3 blockDim(BLOCK_X, 1);




        // Allocate memory on the device 
        cudaMalloc((void **)&dist_d, dist_size);
        cudaMemcpy(dist_d, dist, dist_size, cudaMemcpyHostToDevice);

        cudaMalloc((void **)&parent_d, parent_size);
        cudaMemcpy(parent_d, parent, parent_size, cudaMemcpyHostToDevice);

        cudaMalloc((void**)&visited_d, visited_size);
        cudaMemcpy(visited_d, visited, visited_size, cudaMemcpyHostToDevice);

        // Invoke the kernel
        dijkstra<<<gridDim, blockDim>>>(dist_d, parent_d, visited_d, start, vertices);

        // Copy the results back
        cudaMemcpy(dist, dist_d, dist_size, cudaMemcpyDeviceToHost);
        cudaMemcpy(parent, parent_d, parent_size, cudaMemcpyDeviceToHost);

        // Free the device memory
        cudaFree(dist_d);
        cudaFree(parent_d);
        cudaFree(visited_d);


        // Print the distances from start vertex s
        for(int i = 0; i < vertices; i++)
            printf("%d to %d: %d\n", i, start, dist[i]);
        printf("\n\n");

        // Print the parent array
        for(int i = 0; i < vertices; i++)
            printf("%d: %d\n", i, parent[i]);
        printf("\n\n");


        // Free the host memory
        delete [] adjMat;
        delete [] dist;
        delete [] parent;
        delete [] visited;


        cin >> vertices;

    }

    return 0;
}
	.file	"tmpxft_002f50fe_00000000-6_test_read.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4264:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4264:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z33__device_stub__Z8dijkstraPiS_S_iiPiS_S_ii
	.type	_Z33__device_stub__Z8dijkstraPiS_S_iiPiS_S_ii, @function
_Z33__device_stub__Z8dijkstraPiS_S_iiPiS_S_ii:
.LFB4286:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z8dijkstraPiS_S_ii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L2:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4286:
	.size	_Z33__device_stub__Z8dijkstraPiS_S_iiPiS_S_ii, .-_Z33__device_stub__Z8dijkstraPiS_S_iiPiS_S_ii
	.globl	_Z8dijkstraPiS_S_ii
	.type	_Z8dijkstraPiS_S_ii, @function
_Z8dijkstraPiS_S_ii:
.LFB4287:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z8dijkstraPiS_S_iiPiS_S_ii
	.cfi_endproc
.LFE4287:
	.size	_Z8dijkstraPiS_S_ii, .-_Z8dijkstraPiS_S_ii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Test print of all weights: \n"
.LC1:
	.string	"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
.LC2:
	.string	"Row "
.LC3:
	.string	": "
.LC4:
	.string	"{"
.LC5:
	.string	"} "
.LC6:
	.string	"\n\n"
.LC7:
	.string	"Error copying from host to device symbol\n"
.LC8:
	.string	"Successful copy from host to device symbol\n"
.LC9:
	.string	"%d to %d: %d\n"
.LC10:
	.string	"%d: %d\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB4261:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 8(%rsp)
	movq	%rax, %rsi
.L42:
	leaq	_ZSt3cin(%rip), %rdi
	call	_ZNSirsERi@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L8
	movabsq	$2305843009213693950, %rbx
	imull	%eax, %eax
	movslq	%eax, %rdi
	salq	$2, %rdi
	call	_Znam@PLT
	movslq	44(%rsp), %rdi
	movq	%rax, %r13
	cmpq	%rdi, %rbx
	jb	.L10
	salq	$2, %rdi
	call	_Znam@PLT
	movslq	44(%rsp), %rdi
	movq	%rax, %rbp
	cmpq	%rdi, %rbx
	jnb	.L11
.L10:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	call	__cxa_throw_bad_array_new_length@PLT
.L11:
	salq	$2, %rdi
	call	_Znam@PLT
	movslq	44(%rsp), %rdi
	movq	%rax, %r12
	movabsq	$2305843009213693950, %rax
	cmpq	%rdi, %rax
	jb	.L10
	salq	$2, %rdi
	call	_Znam@PLT
	movl	44(%rsp), %edx
	movq	%rax, (%rsp)
	movl	%edx, %ecx
	imull	%edx, %ecx
	leal	0(,%rcx,4), %eax
	movl	%eax, 16(%rsp)
	leal	0(,%rdx,4), %eax
	movl	%eax, 20(%rsp)
	xorl	%eax, %eax
.L13:
	cmpl	%eax, %ecx
	jle	.L44
	movl	$-1, 0(%r13,%rax,4)
	incq	%rax
	jmp	.L13
.L44:
	xorl	%eax, %eax
.L15:
	cmpl	%eax, %edx
	jle	.L45
	movq	(%rsp), %rcx
	xorl	%esi, %esi
	movl	$2147483647, 0(%rbp,%rax,4)
	movl	$-1, (%r12,%rax,4)
	movl	%esi, (%rcx,%rax,4)
	incq	%rax
	jmp	.L15
.L45:
	leaq	72(%rsp), %rax
	xorl	%r14d, %r14d
	movq	%rax, 24(%rsp)
.L17:
	cmpl	%r14d, 44(%rsp)
	jle	.L46
	movq	24(%rsp), %rsi
	leaq	_ZSt3cin(%rip), %rdi
	xorl	%ebx, %ebx
	leaq	80(%rsp), %r15
	call	_ZNSirsERi@PLT
.L18:
	cmpl	%ebx, 72(%rsp)
	jle	.L47
	movq	%r15, %rsi
	leaq	_ZSt3cin(%rip), %rdi
	call	_ZNSirsERi@PLT
	leaq	92(%rsp), %rsi
	movq	%rax, %rdi
	call	_ZNSirsERi@PLT
	movl	44(%rsp), %eax
	imull	%r14d, %eax
	addl	80(%rsp), %eax
	cltq
	leaq	0(%r13,%rax,4), %rax
	movl	(%rax), %esi
	cmpl	$-1, %esi
	je	.L19
	cmpl	92(%rsp), %esi
	jle	.L20
.L19:
	movl	92(%rsp), %esi
	movl	%esi, (%rax)
.L20:
	incl	%ebx
	jmp	.L18
.L47:
	incl	%r14d
	jmp	.L17
.L46:
	leaq	48(%rsp), %rsi
	leaq	_ZSt3cin(%rip), %rdi
	xorl	%r15d, %r15d
	call	_ZNSirsERi@PLT
	leaq	52(%rsp), %rsi
	leaq	_ZSt4cout(%rip), %rbx
	movq	%rax, %rdi
	call	_ZNSirsERi@PLT
	movslq	48(%rsp), %rax
	xorl	%edx, %edx
	leaq	.LC0(%rip), %rsi
	movl	$2, %edi
	movl	%edx, 0(%rbp,%rax,4)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L23:
	cmpl	%r15d, 44(%rsp)
	jle	.L48
	leaq	.LC2(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%r14d, %r14d
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r15d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L24:
	cmpl	%r14d, 44(%rsp)
	jle	.L49
	leaq	.LC4(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	44(%rsp), %edx
	movq	%rax, %rdi
	imull	%r15d, %edx
	addl	%r14d, %edx
	incl	%r14d
	movslq	%edx, %rdx
	movl	0(%r13,%rdx,4), %esi
	call	_ZNSolsEi@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L24
.L49:
	movq	(%rbx), %rax
	movb	$10, 92(%rsp)
	movq	-24(%rax), %rax
	cmpq	$0, 16(%rbx,%rax)
	je	.L26
	leaq	92(%rsp), %rsi
	movl	$1, %edx
	movq	%rbx, %rdi
	call	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@PLT
	jmp	.L27
.L26:
	movl	$10, %esi
	movq	%rbx, %rdi
	call	_ZNSo3putEc@PLT
.L27:
	incl	%r15d
	jmp	.L23
.L48:
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC6(%rip), %r15
	movq	%rbx, %rdi
	movq	%r15, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movslq	16(%rsp), %rdx
	xorl	%ecx, %ecx
	movq	%r13, %rsi
	movl	$1, %r8d
	leaq	_ZL8adjMat_d(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	testl	%eax, %eax
	je	.L29
	leaq	.LC7(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %eax
	jmp	.L8
.L29:
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	20(%rsp), %rbx
	movabsq	$4294967297, %rax
	leaq	56(%rsp), %rdi
	movq	%rax, 80(%rsp)
	addq	$6, %rax
	movq	%rbx, %rsi
	movl	$1, 88(%rsp)
	movq	%rax, 92(%rsp)
	movl	$1, 100(%rsp)
	call	cudaMalloc@PLT
	movq	56(%rsp), %rdi
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	leaq	64(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	64(%rsp), %rdi
	movq	%rbx, %rdx
	movq	%r12, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	leaq	72(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	movq	72(%rsp), %rdi
	movq	%rbx, %rdx
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	100(%rsp), %ecx
	movl	88(%rsp), %esi
	xorl	%r9d, %r9d
	movq	92(%rsp), %rdx
	movq	80(%rsp), %rdi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L31
	movl	44(%rsp), %r8d
	movl	48(%rsp), %ecx
	movq	72(%rsp), %rdx
	movq	64(%rsp), %rsi
	movq	56(%rsp), %rdi
	call	_Z33__device_stub__Z8dijkstraPiS_S_iiPiS_S_ii
.L31:
	movq	56(%rsp), %rsi
	movq	%rbx, %rdx
	movl	$2, %ecx
	movq	%rbp, %rdi
	leaq	.LC9(%rip), %r14
	call	cudaMemcpy@PLT
	movq	64(%rsp), %rsi
	movq	%rbx, %rdx
	movq	%r12, %rdi
	movl	$2, %ecx
	xorl	%ebx, %ebx
	call	cudaMemcpy@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
.L32:
	movl	%ebx, %edx
	cmpl	%ebx, 44(%rsp)
	jle	.L50
	movl	0(%rbp,%rbx,4), %r8d
	movl	48(%rsp), %ecx
	movq	%r14, %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	incq	%rbx
	call	__printf_chk@PLT
	jmp	.L32
.L50:
	movq	%r15, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__printf_chk@PLT
	leaq	.LC10(%rip), %r14
.L34:
	movl	%ebx, %edx
	cmpl	%ebx, 44(%rsp)
	jle	.L51
	movl	(%r12,%rbx,4), %ecx
	movq	%r14, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%rbx
	call	__printf_chk@PLT
	jmp	.L34
.L51:
	movq	%r15, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r13, %rdi
	call	_ZdaPv@PLT
	movq	%rbp, %rdi
	call	_ZdaPv@PLT
	movq	%r12, %rdi
	call	_ZdaPv@PLT
	movq	(%rsp), %rdi
	call	_ZdaPv@PLT
	movq	8(%rsp), %rsi
	jmp	.L42
.L8:
	movq	104(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L37
.L43:
	call	__stack_chk_fail@PLT
.L37:
	addq	$120, %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
.LFE4261:
	.size	main, .-main
	.text
	.globl	_Z32__device_stub__Z11printAdjMatPiiPii
	.type	_Z32__device_stub__Z11printAdjMatPiiPii, @function
_Z32__device_stub__Z11printAdjMatPiiPii:
.LFB4288:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L52
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z11printAdjMatPii(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L52:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L54
	call	__stack_chk_fail@PLT
.L54:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4288:
	.size	_Z32__device_stub__Z11printAdjMatPiiPii, .-_Z32__device_stub__Z11printAdjMatPiiPii
	.globl	_Z11printAdjMatPii
	.type	_Z11printAdjMatPii, @function
_Z11printAdjMatPii:
.LFB4289:
	.cfi_startproc
	endbr64
	jmp	_Z32__device_stub__Z11printAdjMatPiiPii
	.cfi_endproc
.LFE4289:
	.size	_Z11printAdjMatPii, .-_Z11printAdjMatPii
	.section	.rodata.str1.1
.LC11:
	.string	"_Z11printAdjMatPii"
.LC12:
	.string	"_Z8dijkstraPiS_S_ii"
.LC13:
	.string	"adjMat_d"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4291:
	.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	.LC11(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z11printAdjMatPii(%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	.LC12(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z8dijkstraPiS_S_ii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC13(%rip), %rdx
	movl	$196, %r9d
	leaq	_ZL8adjMat_d(%rip), %rsi
	pushq	$1
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.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
.LFE4291:
	.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	_ZL8adjMat_d
	.comm	_ZL8adjMat_d,196,32
	.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:

//***************************************************************************
//  Broday Walker
//  Dr. Eduardo Colmenares
//   
//
//***************************************************************************

#include <hip/hip_runtime.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

const int GRID_X = 1; // Number of blocks in the grid on the x-axis 
const int BLOCK_X = 7; // Number of threads on the x-axis per block
const int SIZE = 49;

// Hold the adjacency matrix in constant memory on the device as it will not be
// modified over the lifetime of the program
__constant__ int adjMat_d[SIZE];

__global__ void dijkstra(int *dist_d, int *parent_d, int *visited_d, int s, int width)
{   
    int tid_x = threadIdx.x;
    int block_x = blockIdx.x;
    int grid_x = gridDim.x;




}

// A kernel for testing if the adjacency matrix was actually copied to the constant
// memory on the device
__global__ void printAdjMat(int *test, int width)
{
    int tid_x = threadIdx.x;
    
    for(int i = 0; i < width; i++)
        test[i * width + tid_x] = adjMat_d[i * width + tid_x];
}

int main()
{
    int vertices;

    cin >> vertices;

    while(vertices != 0)
    {
        // Host Declarations
        int adj_size, dist_size, parent_size, visited_size, start, end;
        int *adjMat, *dist, *parent, *visited;

        // Device declarations
        int *adj_d, *dist_d, *parent_d, *visited_d;

        // For error checking
        hipError_t cudaErr;

        // This is a linearized adjacency matrix
        adjMat = new int[vertices * vertices];
        dist = new int[vertices];
        parent = new int[vertices];
        visited = new int[vertices];

        // Find size of arrays in bytes
        adj_size = vertices * vertices * sizeof(int);
        dist_size = vertices * sizeof(int); // Equal to the number of vertices
        parent_size = vertices * sizeof(int);
        visited_size = vertices * sizeof(int);

        // Fill the adjacency-matrix with 0s
        for(int i = 0; i < vertices * vertices; i++)
            adjMat[i] = -1;

        // A vertex does not have a parent if its value is -1 (after running 
        // Dijkstra's algorithm, this will only be true for the starting vertex).
        for(int i = 0; i < vertices; i++)
        {
            dist[i] = INT_MAX;
            parent[i] = -1;
            visited[i] = 0;
        }

        // Fill the adjacency matrix with data
        for(int i = 0; i < vertices; i++)
        {
            // Temporary storage for adjacent vertices and the weight of the edge
            int num_edges, u, w;

            // Read in the number of adjacent vertices for the ith vertex
            cin >> num_edges;

            // Add the adjacent vertices to the linearized adjacency-matrix for the ith vertex
            for(int j = 0; j < num_edges; j++)
            {
                cin >> u >> w;
                int offset = i * vertices + u;

                if(adjMat[offset] == -1 || w < adjMat[offset])
                    // This is basically blockIdx.x * blockDim.x + threadIdx.x where blockIdx.x 
                    // corresponds with the iteration of the loop we are on
                    adjMat[offset] = w;
            }
        }

        cin >> start >> end;
        dist[start] = 0;

        // Print weights for testing
        printf("Test print of all weights: \n");
        printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
        for(int i = 0; i < vertices; i++)
        {
            cout << "Row " << i << ": ";

            for(int j = 0; j < vertices; j++)
                cout << "{" << adjMat[i * vertices + j] << "} ";
            cout << '\n';
        }
        printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
        cout << "\n\n";
            
        // Copy the adjacency-matrix to constant memory on the device
        cudaErr = hipMemcpyToSymbol(HIP_SYMBOL(adjMat_d), adjMat, adj_size);
        
        if(cudaErr != hipSuccess)
        {
            printf("Error copying from host to device symbol\n");
            return 1;
        }
        else
            printf("Successful copy from host to device symbol\n");
        
        // Set the dimensions of the grid and blocks
        dim3 gridDim(GRID_X, 1);
        dim3 blockDim(BLOCK_X, 1);




        // Allocate memory on the device 
        hipMalloc((void **)&dist_d, dist_size);
        hipMemcpy(dist_d, dist, dist_size, hipMemcpyHostToDevice);

        hipMalloc((void **)&parent_d, parent_size);
        hipMemcpy(parent_d, parent, parent_size, hipMemcpyHostToDevice);

        hipMalloc((void**)&visited_d, visited_size);
        hipMemcpy(visited_d, visited, visited_size, hipMemcpyHostToDevice);

        // Invoke the kernel
        dijkstra<<<gridDim, blockDim>>>(dist_d, parent_d, visited_d, start, vertices);

        // Copy the results back
        hipMemcpy(dist, dist_d, dist_size, hipMemcpyDeviceToHost);
        hipMemcpy(parent, parent_d, parent_size, hipMemcpyDeviceToHost);

        // Free the device memory
        hipFree(dist_d);
        hipFree(parent_d);
        hipFree(visited_d);


        // Print the distances from start vertex s
        for(int i = 0; i < vertices; i++)
            printf("%d to %d: %d\n", i, start, dist[i]);
        printf("\n\n");

        // Print the parent array
        for(int i = 0; i < vertices; i++)
            printf("%d: %d\n", i, parent[i]);
        printf("\n\n");


        // Free the host memory
        delete [] adjMat;
        delete [] dist;
        delete [] parent;
        delete [] visited;


        cin >> vertices;

    }

    return 0;
}
	.text
	.file	"test_read.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z23__device_stub__dijkstraPiS_S_ii # -- Begin function _Z23__device_stub__dijkstraPiS_S_ii
	.type	_Z23__device_stub__dijkstraPiS_S_ii,@function
_Z23__device_stub__dijkstraPiS_S_ii:    # @_Z23__device_stub__dijkstraPiS_S_ii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%rsp), %rdx
	movl	%ecx, (%rdx)
	movq	%rsp, %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z8dijkstraPiS_S_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z23__device_stub__dijkstraPiS_S_ii, .Lfunc_end0-_Z23__device_stub__dijkstraPiS_S_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__printAdjMatPii # -- Begin function _Z26__device_stub__printAdjMatPii
	.type	_Z26__device_stub__printAdjMatPii,@function
_Z26__device_stub__printAdjMatPii:      # @_Z26__device_stub__printAdjMatPii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	4(%rsp), %rcx
	movl	%esi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11printAdjMatPii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z26__device_stub__printAdjMatPii, .Lfunc_end1-_Z26__device_stub__printAdjMatPii
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function 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	$88, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	8(%rsp), %rbx
	movl	$_ZSt3cin, %edi
	movq	%rbx, %rsi
	callq	_ZNSirsERi
	movl	(%rbx), %eax
	testl	%eax, %eax
	je	.LBB2_35
# %bb.1:                                # %.lr.ph119.preheader
	leaq	60(%rsp), %r15
	leaq	56(%rsp), %r12
.LBB2_2:                                # %.lr.ph119
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_4 Depth 2
                                        #     Child Loop BB2_7 Depth 2
                                        #       Child Loop BB2_9 Depth 3
                                        #     Child Loop BB2_15 Depth 2
                                        #       Child Loop BB2_17 Depth 3
                                        #     Child Loop BB2_30 Depth 2
                                        #     Child Loop BB2_33 Depth 2
	movl	%eax, %ebx
	imull	%ebx, %ebx
	leaq	(,%rbx,4), %rdi
	movl	%eax, %r14d
	movl	%eax, 12(%rsp)                  # 4-byte Spill
	callq	_Znam
	movq	%rax, %rbp
	movslq	%r14d, %rax
	leaq	(,%rax,4), %r14
	testl	%eax, %eax
	movq	$-1, %rax
	cmovsq	%rax, %r14
	movq	%r14, %rdi
	callq	_Znam
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_Znam
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movq	%r14, %rdi
	callq	_Znam
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	cmpq	$1, %rbx
	movq	%rbx, 72(%rsp)                  # 8-byte Spill
	adcq	$0, %rbx
	shlq	$2, %rbx
	movq	%rbp, %rdi
	movl	$255, %esi
	movq	%rbx, %rdx
	callq	memset@PLT
	cmpl	$0, 12(%rsp)                    # 4-byte Folded Reload
	jle	.LBB2_13
# %bb.3:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB2_2 Depth=1
	movl	12(%rsp), %ebx                  # 4-byte Reload
	leaq	(,%rbx,4), %r14
	movq	64(%rsp), %rdi                  # 8-byte Reload
	movl	$255, %esi
	movq	%r14, %rdx
	callq	memset@PLT
	movq	40(%rsp), %rdi                  # 8-byte Reload
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	memset@PLT
	xorl	%eax, %eax
.LBB2_4:                                # %.lr.ph
                                        #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$2147483647, (%r13,%rax,4)      # imm = 0x7FFFFFFF
	incq	%rax
	cmpq	%rax, %rbx
	jne	.LBB2_4
# %bb.5:                                # %.preheader
                                        #   in Loop: Header=BB2_2 Depth=1
	cmpl	$0, 12(%rsp)                    # 4-byte Folded Reload
	jle	.LBB2_13
# %bb.6:                                # %.lr.ph99.preheader
                                        #   in Loop: Header=BB2_2 Depth=1
	xorl	%r14d, %r14d
.LBB2_7:                                # %.lr.ph99
                                        #   Parent Loop BB2_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_9 Depth 3
	movl	$_ZSt3cin, %edi
	leaq	16(%rsp), %rsi
	callq	_ZNSirsERi
	cmpl	$0, 16(%rsp)
	jle	.LBB2_20
# %bb.8:                                # %.lr.ph97.preheader
                                        #   in Loop: Header=BB2_7 Depth=2
	xorl	%ebx, %ebx
.LBB2_9:                                # %.lr.ph97
                                        #   Parent Loop BB2_2 Depth=1
                                        #     Parent Loop BB2_7 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	$_ZSt3cin, %edi
	movq	%r15, %rsi
	callq	_ZNSirsERi
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_ZNSirsERi
	movl	8(%rsp), %eax
	movl	%eax, %ecx
	imull	%r14d, %ecx
	movslq	60(%rsp), %rdx
	movslq	%ecx, %rcx
	addq	%rdx, %rcx
	movl	(%rbp,%rcx,4), %esi
	movl	56(%rsp), %edx
	cmpl	$-1, %esi
	je	.LBB2_11
# %bb.10:                               # %.lr.ph97
                                        #   in Loop: Header=BB2_9 Depth=3
	cmpl	%esi, %edx
	jge	.LBB2_12
.LBB2_11:                               #   in Loop: Header=BB2_9 Depth=3
	movl	%edx, (%rbp,%rcx,4)
.LBB2_12:                               #   in Loop: Header=BB2_9 Depth=3
	incl	%ebx
	cmpl	16(%rsp), %ebx
	jl	.LBB2_9
	jmp	.LBB2_21
.LBB2_20:                               # %.lr.ph99.._crit_edge_crit_edge
                                        #   in Loop: Header=BB2_7 Depth=2
	movl	8(%rsp), %eax
.LBB2_21:                               # %._crit_edge
                                        #   in Loop: Header=BB2_7 Depth=2
	incl	%r14d
	cmpl	%eax, %r14d
	jl	.LBB2_7
.LBB2_13:                               # %._crit_edge100
                                        #   in Loop: Header=BB2_2 Depth=1
	movl	$_ZSt3cin, %edi
	leaq	20(%rsp), %rsi
	callq	_ZNSirsERi
	movq	%rax, %rdi
	leaq	84(%rsp), %rsi
	callq	_ZNSirsERi
	movslq	20(%rsp), %rax
	movl	$0, (%r13,%rax,4)
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	cmpl	$0, 8(%rsp)
	jle	.LBB2_24
# %bb.14:                               # %.lr.ph107.preheader
                                        #   in Loop: Header=BB2_2 Depth=1
	xorl	%r14d, %r14d
.LBB2_15:                               # %.lr.ph107
                                        #   Parent Loop BB2_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_17 Depth 3
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$4, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%r14d, %esi
	callq	_ZNSolsEi
	movl	$.L.str.3, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	cmpl	$0, 8(%rsp)
	jle	.LBB2_18
# %bb.16:                               # %.lr.ph103.preheader
                                        #   in Loop: Header=BB2_15 Depth=2
	xorl	%ebx, %ebx
.LBB2_17:                               # %.lr.ph103
                                        #   Parent Loop BB2_2 Depth=1
                                        #     Parent Loop BB2_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movslq	8(%rsp), %rax
	movslq	%r14d, %rcx
	imulq	%rax, %rcx
	addq	%rbx, %rcx
	movl	(%rbp,%rcx,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%rbx
	cmpl	8(%rsp), %ebx
	jl	.LBB2_17
.LBB2_18:                               # %._crit_edge104
                                        #   in Loop: Header=BB2_15 Depth=2
	movb	$10, 16(%rsp)
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	cmpq	$0, _ZSt4cout+16(%rax)
	je	.LBB2_22
# %bb.19:                               #   in Loop: Header=BB2_15 Depth=2
	movl	$_ZSt4cout, %edi
	movl	$1, %edx
	leaq	16(%rsp), %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB2_23
.LBB2_22:                               #   in Loop: Header=BB2_15 Depth=2
	movl	$_ZSt4cout, %edi
	movl	$10, %esi
	callq	_ZNSo3putEc
.LBB2_23:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c.exit
                                        #   in Loop: Header=BB2_15 Depth=2
	incl	%r14d
	cmpl	8(%rsp), %r14d
	jl	.LBB2_15
.LBB2_24:                               # %._crit_edge108
                                        #   in Loop: Header=BB2_2 Depth=1
	movq	72(%rsp), %rbx                  # 8-byte Reload
	shll	$2, %ebx
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$2, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movslq	%ebx, %rdx
	movl	$adjMat_d, %edi
	movq	%rbp, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	testl	%eax, %eax
	movq	64(%rsp), %rbx                  # 8-byte Reload
	jne	.LBB2_25
# %bb.26:                               #   in Loop: Header=BB2_2 Depth=1
	movl	12(%rsp), %r14d                 # 4-byte Reload
	shll	$2, %r14d
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	movslq	%r14d, %r14
	leaq	32(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	32(%rsp), %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	24(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	24(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	48(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	48(%rsp), %rdi
	movq	40(%rsp), %rsi                  # 8-byte Reload
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	leaq	6(%rdi), %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_28
# %bb.27:                               #   in Loop: Header=BB2_2 Depth=1
	movq	32(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	48(%rsp), %rdx
	movl	20(%rsp), %ecx
	movl	8(%rsp), %r8d
	callq	_Z23__device_stub__dijkstraPiS_S_ii
.LBB2_28:                               #   in Loop: Header=BB2_2 Depth=1
	movq	32(%rsp), %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	24(%rsp), %rsi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	48(%rsp), %rdi
	callq	hipFree
	cmpl	$0, 8(%rsp)
	jle	.LBB2_31
# %bb.29:                               # %.lr.ph111.preheader
                                        #   in Loop: Header=BB2_2 Depth=1
	xorl	%r14d, %r14d
.LBB2_30:                               # %.lr.ph111
                                        #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	20(%rsp), %edx
	movl	(%r13,%r14,4), %ecx
	movl	$.L.str.9, %edi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	printf
	incq	%r14
	movslq	8(%rsp), %rax
	cmpq	%rax, %r14
	jl	.LBB2_30
.LBB2_31:                               # %._crit_edge112
                                        #   in Loop: Header=BB2_2 Depth=1
	movl	$.Lstr.5, %edi
	callq	puts@PLT
	cmpl	$0, 8(%rsp)
	jle	.LBB2_34
# %bb.32:                               # %.lr.ph115.preheader
                                        #   in Loop: Header=BB2_2 Depth=1
	xorl	%r14d, %r14d
.LBB2_33:                               # %.lr.ph115
                                        #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rbx,%r14,4), %edx
	movl	$.L.str.10, %edi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	printf
	incq	%r14
	movslq	8(%rsp), %rax
	cmpq	%rax, %r14
	jl	.LBB2_33
.LBB2_34:                               # %._crit_edge116
                                        #   in Loop: Header=BB2_2 Depth=1
	movl	$.Lstr.5, %edi
	callq	puts@PLT
	movq	%rbp, %rdi
	callq	_ZdaPv
	movq	%r13, %rdi
	callq	_ZdaPv
	movq	%rbx, %rdi
	callq	_ZdaPv
	movq	40(%rsp), %rdi                  # 8-byte Reload
	callq	_ZdaPv
	movl	$_ZSt3cin, %edi
	leaq	8(%rsp), %rsi
	callq	_ZNSirsERi
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jne	.LBB2_2
.LBB2_35:
	xorl	%eax, %eax
	jmp	.LBB2_36
.LBB2_25:                               # %.thread
	movl	$.Lstr.6, %edi
	callq	puts@PLT
	movl	$1, %eax
.LBB2_36:                               # %.loopexit
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	main, .Lfunc_end2-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	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z8dijkstraPiS_S_ii, %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	$_Z11printAdjMatPii, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$0, 8(%rsp)
	movl	$1, (%rsp)
	movl	$adjMat_d, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movl	$196, %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_end3:
	.size	__hip_module_ctor, .Lfunc_end3-__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	.LBB4_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
.LBB4_2:
	retq
.Lfunc_end4:
	.size	__hip_module_dtor, .Lfunc_end4-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	adjMat_d,@object                # @adjMat_d
	.local	adjMat_d
	.comm	adjMat_d,196,16
	.type	_Z8dijkstraPiS_S_ii,@object     # @_Z8dijkstraPiS_S_ii
	.section	.rodata,"a",@progbits
	.globl	_Z8dijkstraPiS_S_ii
	.p2align	3, 0x0
_Z8dijkstraPiS_S_ii:
	.quad	_Z23__device_stub__dijkstraPiS_S_ii
	.size	_Z8dijkstraPiS_S_ii, 8

	.type	_Z11printAdjMatPii,@object      # @_Z11printAdjMatPii
	.globl	_Z11printAdjMatPii
	.p2align	3, 0x0
_Z11printAdjMatPii:
	.quad	_Z26__device_stub__printAdjMatPii
	.size	_Z11printAdjMatPii, 8

	.type	.L.str.2,@object                # @.str.2
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.2:
	.asciz	"Row "
	.size	.L.str.2, 5

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

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

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"} "
	.size	.L.str.5, 3

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"\n\n"
	.size	.L.str.6, 3

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"%d to %d: %d\n"
	.size	.L.str.9, 14

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"%d: %d\n"
	.size	.L.str.10, 8

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

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z11printAdjMatPii"
	.size	.L__unnamed_2, 19

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"adjMat_d"
	.size	.L__unnamed_3, 9

	.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	"Test print of all weights: "
	.size	.Lstr, 28

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
	.size	.Lstr.2, 61

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"Successful copy from host to device symbol"
	.size	.Lstr.3, 43

	.type	.Lstr.5,@object                 # @str.5
.Lstr.5:
	.asciz	"\n"
	.size	.Lstr.5, 2

	.type	.Lstr.6,@object                 # @str.6
.Lstr.6:
	.asciz	"Error copying from host to device symbol"
	.size	.Lstr.6, 41

	.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 _Z23__device_stub__dijkstraPiS_S_ii
	.addrsig_sym _Z26__device_stub__printAdjMatPii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym adjMat_d
	.addrsig_sym _Z8dijkstraPiS_S_ii
	.addrsig_sym _Z11printAdjMatPii
	.addrsig_sym _ZSt3cin
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z8dijkstraPiS_S_ii     ; -- Begin function _Z8dijkstraPiS_S_ii
	.globl	_Z8dijkstraPiS_S_ii
	.p2align	8
	.type	_Z8dijkstraPiS_S_ii,@function
_Z8dijkstraPiS_S_ii:                    ; @_Z8dijkstraPiS_S_ii
; %bb.0:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8dijkstraPiS_S_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 32
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 1
		.amdhsa_next_free_sgpr 1
		.amdhsa_reserve_vcc 0
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z8dijkstraPiS_S_ii, .Lfunc_end0-_Z8dijkstraPiS_S_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 4
; NumSgprs: 0
; NumVgprs: 0
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 1
; NumVGPRsForWavesPerEU: 1
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z11printAdjMatPii      ; -- Begin function _Z11printAdjMatPii
	.globl	_Z11printAdjMatPii
	.p2align	8
	.type	_Z11printAdjMatPii,@function
_Z11printAdjMatPii:                     ; @_Z11printAdjMatPii
; %bb.0:
	s_load_b32 s2, s[0:1], 0x8
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s2, 1
	s_cbranch_scc1 .LBB1_3
; %bb.1:                                ; %.lr.ph.preheader
	s_load_b64 s[0:1], s[0:1], 0x0
	v_mov_b32_e32 v1, 0
	s_mov_b32 s3, s2
	s_getpc_b64 s[4:5]
	s_add_u32 s4, s4, adjMat_d@rel32@lo+4
	s_addc_u32 s5, s5, adjMat_d@rel32@hi+12
.LBB1_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	v_lshlrev_b64 v[2:3], 2, v[0:1]
	v_add_nc_u32_e32 v0, s2, v0
	s_add_i32 s3, s3, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_cmp_eq_u32 s3, 0
	v_add_co_u32 v4, vcc_lo, v2, s4
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v3, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s0, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
	global_load_b32 v4, v[4:5], off
	s_waitcnt vmcnt(0)
	global_store_b32 v[2:3], v4, off
	s_cbranch_scc0 .LBB1_2
.LBB1_3:                                ; %._crit_edge
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11printAdjMatPii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 12
		.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 6
		.amdhsa_next_free_sgpr 6
		.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	_Z11printAdjMatPii, .Lfunc_end1-_Z11printAdjMatPii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 148
; NumSgprs: 8
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 8
; NumVGPRsForWavesPerEU: 6
; 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	adjMat_d                ; @adjMat_d
	.type	adjMat_d,@object
	.section	.bss,"aw",@nobits
	.globl	adjMat_d
	.p2align	4, 0x0
adjMat_d:
	.zero	196
	.size	adjMat_d, 196

	.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 adjMat_d
	.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
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 32
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8dijkstraPiS_S_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     0
    .sgpr_spill_count: 0
    .symbol:         _Z8dijkstraPiS_S_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     0
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 12
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11printAdjMatPii
    .private_segment_fixed_size: 0
    .sgpr_count:     8
    .sgpr_spill_count: 0
    .symbol:         _Z11printAdjMatPii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
