#include <iostream>
#include <math.h>
#include <time.h>

using namespace std;

// Kernel function to add the elements of two arrays
__global__
void dijkstra(int N, int *hasil_gabung, int *graph)
{
  int index = blockIdx.x * blockDim.x + threadIdx.x;
  int stride = blockDim.x * gridDim.x;
  for (int src = index; src < N; src += stride){
    const int N_const = N;
    int dist[110]; // Ganti ini juga sesuai dengan nilai N 
    int sptSet[110]; // Ganti ini juga sesuai dengan nilai N

    for (int i = 0; i < N; i++) 
      dist[i] = INT_MAX, sptSet[i] = 0; 

    dist[src] = 0; 

    for (int count = 0; count < N - 1; count++) { 
      int min = INT_MAX, min_index; 
      for (int v = 0; v < N; v++) 
        if (sptSet[v] == 0 && dist[v] <= min) min = dist[v], min_index = v;
      int u = min_index; 
  
      sptSet[u] = 1; 

      for (int v = 0; v < N; v++) 
        if (!sptSet[v] && graph[u*N+v] && dist[u] != INT_MAX 
          && dist[u] + graph[u*N+v] < dist[v]) 
          dist[v] = dist[u] + graph[u*N+v]; 
    }

    for (int i=0; i<N; i++) {
          hasil_gabung[src*N+i] = dist[i];
      }
    }
}


int main(int argc, char** argv)
{
  int N = stoi(argv[1]);
  int *hasil_gabung;
  int *graph;

  cudaMallocManaged(&hasil_gabung, N*N*sizeof(int));  
  cudaMallocManaged(&graph, N*N*sizeof(int));

  srand(13517093);
  for(int i = 0;i<N;i++) {
      graph[i*N+i] = 0;
      for(int j = i+1;j<N;j++) {
          graph[i*N+j] = rand() % 23;
          if(graph[i*N+j] == 0) graph[i*N+j] = 1;
          graph[j*N+i] = graph[i*N+j];
      }
  }
  struct timeval start, end;
  // gettimeofday(&start, NULL);
  
  int blockSize = stoi(argv[2]);  
  int numBlocks = (N + blockSize - 1) / blockSize;

  clock_t tStart = clock();
  dijkstra<<<numBlocks , blockSize>>>(N, hasil_gabung, graph);

  cudaDeviceSynchronize();

  //for (int i = 0;i < N;i++) {
    // for (int j = 0;j < N; j++) {
      // cout << graph[i*N+j];
       // if(j != N-1) {
         // cout << " ";
      // }
     //}
     //cout << endl;
  // }

  cout << "------DIJKSTRA-------" << endl;

   for (int i = 0;i < N;i++) {
     for (int j = 0;j < N; j++) {
       cout << hasil_gabung[i*N+j];
         if(j != N-1) {
            cout << " ";
          }
     }
     cout << endl;
  }
  // gettimeofday(&end, NULL);

  // double delta = ((end.tv_sec  - start.tv_sec) * 1000000u + end.tv_usec - start.tv_usec) / 1.e6;
  // printf("Time execution : %lf", delta);
  printf("Time taken: %.2f microsekon\n", (double)(clock() - tStart)/CLOCKS_PER_SEC*1000000 );
  // https://www.geeksforgeeks.org/clock-function-in-c-c/
  // Free memory
  cudaFree(hasil_gabung);
  cudaFree(graph);
  
  return 0;
}
	.file	"tmpxft_0037b1fa_00000000-6_main.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3638:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3638:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z30__device_stub__Z8dijkstraiPiS_iPiS_
	.type	_Z30__device_stub__Z8dijkstraiPiS_iPiS_, @function
_Z30__device_stub__Z8dijkstraiPiS_iPiS_:
.LFB3660:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movl	%edi, 28(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%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)
	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 152
	leaq	_Z8dijkstraiPiS_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L2:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3660:
	.size	_Z30__device_stub__Z8dijkstraiPiS_iPiS_, .-_Z30__device_stub__Z8dijkstraiPiS_iPiS_
	.globl	_Z8dijkstraiPiS_
	.type	_Z8dijkstraiPiS_, @function
_Z8dijkstraiPiS_:
.LFB3661:
	.cfi_startproc
	endbr64
	jmp	_Z30__device_stub__Z8dijkstraiPiS_iPiS_
	.cfi_endproc
.LFE3661:
	.size	_Z8dijkstraiPiS_, .-_Z8dijkstraiPiS_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z8dijkstraiPiS_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3663:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 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	.LC0(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z8dijkstraiPiS_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3663:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev,"axG",@progbits,_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD5Ev,comdat
	.align 2
	.weak	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev
	.type	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev, @function
_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev:
.LFB3742:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	call	__errno_location@PLT
	cmpl	$0, (%rax)
	jne	.L10
	movl	(%rbx), %edx
	movl	%edx, (%rax)
.L10:
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3742:
	.size	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev, .-_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev
	.weak	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD1Ev
	.set	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD1Ev,_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev
	.section	.text._ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,"axG",@progbits,_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,comdat
	.weak	_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_
	.type	_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_, @function
_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_:
.LFB3737:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3737
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rsi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rcx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdx, %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movl	%r8d, 12(%rsp)
	leaq	28(%rsp), %r13
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	__errno_location@PLT
	movl	12(%rsp), %edx
	leaq	32(%rsp), %rsi
	movq	%rbx, %rdi
	movq	%rax, %rbp
	movl	(%rax), %eax
	movl	%eax, 28(%rsp)
	xorl	%eax, %eax
	movl	%eax, 0(%rbp)
.LEHB0:
	call	*%r15
	movq	32(%rsp), %rdx
	cmpq	%rbx, %rdx
	jne	.L14
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	movq	%r14, %rdi
	call	_ZSt24__throw_invalid_argumentPKc@PLT
.L14:
	cmpl	$34, 0(%rbp)
	je	.L16
	movl	$2147483648, %ecx
	movl	$4294967295, %esi
	addq	%rax, %rcx
	cmpq	%rcx, %rsi
	jnb	.L17
.L16:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	movq	%r14, %rdi
	call	_ZSt20__throw_out_of_rangePKc@PLT
.LEHE0:
.L17:
	testq	%r12, %r12
	je	.L19
	subq	%rbx, %rdx
	movq	%rdx, (%r12)
.L19:
	movq	%r13, %rdi
	movl	%eax, 12(%rsp)
	call	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD1Ev
	movl	12(%rsp), %eax
	movq	40(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	jmp	.L27
.L23:
	endbr64
	movq	%rax, %rbx
.L20:
	movq	%r13, %rdi
	call	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD1Ev
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	movq	%rbx, %rdi
.LEHB1:
	call	_Unwind_Resume@PLT
.LEHE1:
.L27:
	call	__stack_chk_fail@PLT
.L22:
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3737:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table._ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,"aG",@progbits,_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,comdat
.LLSDA3737:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3737-.LLSDACSB3737
.LLSDACSB3737:
	.uleb128 .LEHB0-.LFB3737
	.uleb128 .LEHE0-.LEHB0
	.uleb128 .L23-.LFB3737
	.uleb128 0
	.uleb128 .LEHB1-.LFB3737
	.uleb128 .LEHE1-.LEHB1
	.uleb128 0
	.uleb128 0
.LLSDACSE3737:
	.section	.text._ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,"axG",@progbits,_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,comdat
	.size	_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_, .-_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_
	.section	.rodata._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.str1.1,"aMS",@progbits,1
.LC1:
	.string	"basic_string: construction from null is not valid"
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC5IS3_EEPKcRKS3_,comdat
	.align 2
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_:
.LFB3964:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	jne	.L31
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	leaq	.LC1(%rip), %rdi
	call	_ZSt19__throw_logic_errorPKc@PLT
.L31:
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movq	%rsi, %rbp
	call	strlen@PLT
	movq	%rax, (%rsp)
	leaq	0(%rbp,%rax), %r12
	cmpq	$15, %rax
	jbe	.L33
	movq	%rsp, %rsi
	xorl	%edx, %edx
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
	movq	%rax, (%rbx)
	movq	(%rsp), %rax
	movq	%rax, 16(%rbx)
.L33:
	movq	(%rbx), %rdi
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	(%rsp), %rax
	movq	(%rbx), %rdx
	movq	%rax, 8(%rbx)
	movb	$0, (%rdx,%rax)
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L34
.L36:
	call	__stack_chk_fail@PLT
.L34:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3964:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
	.set	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.section	.rodata.str1.1
.LC2:
	.string	"stoi"
.LC3:
	.string	"------DIJKSTRA-------"
.LC4:
	.string	" "
.LC6:
	.string	"Time taken: %.2f microsekon\n"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3635:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3635
	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
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	8(%rsi), %rsi
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	76(%rsp), %rax
	movq	%rax, 16(%rsp)
	leaq	88(%rsp), %rax
	movq	16(%rsp), %rdx
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
.LEHB2:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE2:
	movq	88(%rsp), %rdx
	movq	__isoc23_strtol@GOTPCREL(%rip), %rdi
	xorl	%ecx, %ecx
	movl	$10, %r8d
	leaq	.LC2(%rip), %rsi
.LEHB3:
	call	_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_
.LEHE3:
	movl	%eax, %ebx
	movq	8(%rsp), %rdi
	xorl	%r13d, %r13d
	movl	%ebx, %ebp
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	imull	%ebx, %ebp
	leaq	48(%rsp), %rdi
	movl	$1, %edx
	movslq	%ebp, %rbp
	salq	$2, %rbp
	movq	%rbp, %rsi
.LEHB4:
	call	cudaMallocManaged@PLT
	movq	%rbp, %rsi
	leaq	56(%rsp), %rdi
	xorl	%ebp, %ebp
	movl	$1, %edx
	call	cudaMallocManaged@PLT
	movl	$13517093, %edi
	call	srand@PLT
	movslq	%ebx, %rax
	leaq	4(,%rax,4), %r15
	leaq	-4(%r15), %r14
.L38:
	cmpl	%ebx, %r13d
	jge	.L60
	movq	56(%rsp), %rax
	xorl	%edx, %edx
	incl	%r13d
	leaq	(%r14,%rbp), %rdi
	leaq	4(%rbp), %r8
	movl	%r13d, %esi
	movl	%edx, (%rax,%rbp)
.L39:
	cmpl	%ebx, %esi
	je	.L61
	movq	%r8, 40(%rsp)
	movq	%rdi, 32(%rsp)
	movl	%esi, 28(%rsp)
	call	rand@PLT
	movl	$23, %ecx
	movq	56(%rsp), %r10
	movq	40(%rsp), %r8
	cltd
	movl	28(%rsp), %esi
	movq	32(%rsp), %rdi
	idivl	%ecx
	leaq	(%r10,%r8), %r11
	testl	%edx, %edx
	jne	.L40
	movl	$1, %edx
.L40:
	movl	%edx, (%r11)
	incl	%esi
	addq	$4, %r8
	movl	%edx, (%r10,%rdi)
	addq	%r14, %rdi
	jmp	.L39
.L61:
	addq	%r15, %rbp
	jmp	.L38
.L60:
	movq	16(%r12), %rsi
	movq	16(%rsp), %rdx
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE4:
	movq	88(%rsp), %rdx
	movq	__isoc23_strtol@GOTPCREL(%rip), %rdi
	xorl	%ecx, %ecx
	movl	$10, %r8d
	leaq	.LC2(%rip), %rsi
.LEHB5:
	call	_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_
.LEHE5:
	movq	8(%rsp), %rdi
	movl	%eax, %ebp
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	leal	-1(%rbx,%rbp), %eax
	cltd
	idivl	%ebp
	movl	%eax, %r12d
	call	clock@PLT
	movl	%ebp, 76(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdx
	movl	%r12d, 64(%rsp)
	movq	%rdx, 68(%rsp)
	movq	64(%rsp), %rdi
	movq	%rdx, 80(%rsp)
	movl	72(%rsp), %esi
	movl	84(%rsp), %ecx
	movq	76(%rsp), %rdx
	movq	%rax, 8(%rsp)
.LEHB6:
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L43
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rsi
	movl	%ebx, %edi
	call	_Z30__device_stub__Z8dijkstraiPiS_iPiS_
.L43:
	call	cudaDeviceSynchronize@PLT
	leaq	.LC3(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.L44:
	cmpl	%ebx, %r12d
	jge	.L62
	movq	%r13, %r15
	xorl	%ebp, %ebp
.L46:
	movq	48(%rsp), %rax
	leaq	_ZSt4cout(%rip), %rdi
	movl	(%rax,%r15), %esi
	call	_ZNSolsEi@PLT
	leal	-1(%rbx), %eax
	cmpl	%ebp, %eax
	je	.L45
	leaq	.LC4(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L45:
	incl	%ebp
	addq	$4, %r15
	cmpl	%ebx, %ebp
	jne	.L46
	leaq	_ZSt4cout(%rip), %rdi
	incl	%r12d
	addq	%r14, %r13
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	jmp	.L44
.L62:
	call	clock@PLT
	movq	8(%rsp), %rcx
	movl	$2, %edi
	movsd	.LC5(%rip), %xmm1
	leaq	.LC6(%rip), %rsi
	subq	%rcx, %rax
	cvtsi2sdq	%rax, %xmm0
	movb	$1, %al
	divsd	%xmm1, %xmm0
	mulsd	%xmm1, %xmm0
	call	__printf_chk@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L51
	jmp	.L56
.L53:
	endbr64
	jmp	.L59
.L54:
	endbr64
.L59:
	movq	%rax, %rbx
.L49:
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	movq	%rbx, %rdi
	call	_Unwind_Resume@PLT
.LEHE6:
.L56:
	call	__stack_chk_fail@PLT
.L51:
	addq	$136, %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
.LFE3635:
	.section	.gcc_except_table,"a",@progbits
.LLSDA3635:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3635-.LLSDACSB3635
.LLSDACSB3635:
	.uleb128 .LEHB2-.LFB3635
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB3-.LFB3635
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L53-.LFB3635
	.uleb128 0
	.uleb128 .LEHB4-.LFB3635
	.uleb128 .LEHE4-.LEHB4
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB5-.LFB3635
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L54-.LFB3635
	.uleb128 0
	.uleb128 .LEHB6-.LFB3635
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
.LLSDACSE3635:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC5:
	.long	0
	.long	1093567616
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <iostream>
#include <math.h>
#include <time.h>

using namespace std;

// Kernel function to add the elements of two arrays
__global__
void dijkstra(int N, int *hasil_gabung, int *graph)
{
  int index = blockIdx.x * blockDim.x + threadIdx.x;
  int stride = blockDim.x * gridDim.x;
  for (int src = index; src < N; src += stride){
    const int N_const = N;
    int dist[110]; // Ganti ini juga sesuai dengan nilai N 
    int sptSet[110]; // Ganti ini juga sesuai dengan nilai N

    for (int i = 0; i < N; i++) 
      dist[i] = INT_MAX, sptSet[i] = 0; 

    dist[src] = 0; 

    for (int count = 0; count < N - 1; count++) { 
      int min = INT_MAX, min_index; 
      for (int v = 0; v < N; v++) 
        if (sptSet[v] == 0 && dist[v] <= min) min = dist[v], min_index = v;
      int u = min_index; 
  
      sptSet[u] = 1; 

      for (int v = 0; v < N; v++) 
        if (!sptSet[v] && graph[u*N+v] && dist[u] != INT_MAX 
          && dist[u] + graph[u*N+v] < dist[v]) 
          dist[v] = dist[u] + graph[u*N+v]; 
    }

    for (int i=0; i<N; i++) {
          hasil_gabung[src*N+i] = dist[i];
      }
    }
}


int main(int argc, char** argv)
{
  int N = stoi(argv[1]);
  int *hasil_gabung;
  int *graph;

  hipMallocManaged(&hasil_gabung, N*N*sizeof(int));  
  hipMallocManaged(&graph, N*N*sizeof(int));

  srand(13517093);
  for(int i = 0;i<N;i++) {
      graph[i*N+i] = 0;
      for(int j = i+1;j<N;j++) {
          graph[i*N+j] = rand() % 23;
          if(graph[i*N+j] == 0) graph[i*N+j] = 1;
          graph[j*N+i] = graph[i*N+j];
      }
  }
  struct timeval start, end;
  // gettimeofday(&start, NULL);
  
  int blockSize = stoi(argv[2]);  
  int numBlocks = (N + blockSize - 1) / blockSize;

  clock_t tStart = clock();
  dijkstra<<<numBlocks , blockSize>>>(N, hasil_gabung, graph);

  hipDeviceSynchronize();

  //for (int i = 0;i < N;i++) {
    // for (int j = 0;j < N; j++) {
      // cout << graph[i*N+j];
       // if(j != N-1) {
         // cout << " ";
      // }
     //}
     //cout << endl;
  // }

  cout << "------DIJKSTRA-------" << endl;

   for (int i = 0;i < N;i++) {
     for (int j = 0;j < N; j++) {
       cout << hasil_gabung[i*N+j];
         if(j != N-1) {
            cout << " ";
          }
     }
     cout << endl;
  }
  // gettimeofday(&end, NULL);

  // double delta = ((end.tv_sec  - start.tv_sec) * 1000000u + end.tv_usec - start.tv_usec) / 1.e6;
  // printf("Time execution : %lf", delta);
  printf("Time taken: %.2f microsekon\n", (double)(clock() - tStart)/CLOCKS_PER_SEC*1000000 );
  // https://www.geeksforgeeks.org/clock-function-in-c-c/
  // Free memory
  hipFree(hasil_gabung);
  hipFree(graph);
  
  return 0;
}
	.text
	.file	"main.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z23__device_stub__dijkstraiPiS_ # -- Begin function _Z23__device_stub__dijkstraiPiS_
	.type	_Z23__device_stub__dijkstraiPiS_,@function
_Z23__device_stub__dijkstraiPiS_:       # @_Z23__device_stub__dijkstraiPiS_
	.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), %rcx
	movq	%rsi, (%rcx)
	leaq	32(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z8dijkstraiPiS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z23__device_stub__dijkstraiPiS_, .Lfunc_end0-_Z23__device_stub__dijkstraiPiS_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI1_0:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r15
	movq	8(%rsi), %rsi
.Ltmp0:
	leaq	56(%rsp), %rdi
	leaq	40(%rsp), %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
.Ltmp1:
# %bb.1:
	movq	56(%rsp), %r12
	callq	__errno_location
	movq	%rax, %r14
	movl	(%rax), %ebp
	movl	$0, (%rax)
	leaq	112(%rsp), %r13
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	$10, %edx
	callq	__isoc23_strtol
	cmpq	%r12, (%r13)
	movq	%r14, 16(%rsp)                  # 8-byte Spill
	je	.LBB1_2
# %bb.9:
	movq	%rax, %rbx
	movslq	%ebx, %rax
	cmpq	%rbx, %rax
	jne	.LBB1_11
# %bb.10:
	movl	(%r14), %eax
	cmpl	$34, %eax
	je	.LBB1_11
# %bb.13:
	movq	%r15, 88(%rsp)                  # 8-byte Spill
	testl	%eax, %eax
	jne	.LBB1_15
# %bb.14:
	movl	%ebp, (%r14)
.LBB1_15:
	leaq	72(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB1_17
# %bb.16:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB1_17:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movl	%ebx, %r12d
	imull	%r12d, %r12d
	andl	$-3, %r12d
	shlq	$2, %r12
	leaq	40(%rsp), %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	hipMallocManaged
	leaq	32(%rsp), %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	hipMallocManaged
	movl	$13517093, %edi                 # imm = 0xCE4125
	callq	srand
	testl	%ebx, %ebx
	movq	%rbx, 48(%rsp)                  # 8-byte Spill
	jle	.LBB1_21
# %bb.18:                               # %.lr.ph87.preheader
	movl	%ebx, %r14d
	leaq	1(%r14), %rax
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	movl	$1, %ebp
	xorl	%eax, %eax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movq	%r14, %r15
	xorl	%ecx, %ecx
.LBB1_19:                               # %.lr.ph87
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_28 Depth 2
	movl	%ecx, %eax
	imull	%ebx, %eax
	cltq
	shlq	$2, %rax
	addq	32(%rsp), %rax
	movl	$0, (%rax,%rcx,4)
	incq	%rcx
	movq	%rcx, 104(%rsp)                 # 8-byte Spill
	cmpq	%r14, %rcx
	jae	.LBB1_20
# %bb.27:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB1_19 Depth=1
	movl	24(%rsp), %ebx                  # 4-byte Reload
	addq	%rbp, %rbx
	movq	%r14, %r12
	movq	%r15, %r13
.LBB1_28:                               # %.lr.ph
                                        #   Parent Loop BB1_19 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	cltq
	imulq	$-1307163959, %rax, %rcx        # imm = 0xB21642C9
	shrq	$32, %rcx
	addl	%eax, %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	sarl	$4, %ecx
	addl	%edx, %ecx
	leal	(%rcx,%rcx,2), %edx
	shll	$3, %edx
	subl	%edx, %ecx
	leal	(%rax,%rcx), %edx
	movq	32(%rsp), %rsi
	cmpl	$1, %edx
	adcl	%eax, %ecx
	movl	%ecx, (%rsi,%rbx,4)
	movl	%ecx, (%rsi,%r13,4)
	incq	%rbx
	addq	%r14, %r13
	decq	%r12
	cmpq	%r12, %rbp
	jne	.LBB1_28
.LBB1_20:                               # %.loopexit
                                        #   in Loop: Header=BB1_19 Depth=1
	incq	%rbp
	movq	48(%rsp), %rbx                  # 8-byte Reload
	movq	24(%rsp), %rax                  # 8-byte Reload
	addl	%ebx, %eax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	addq	96(%rsp), %r15                  # 8-byte Folded Reload
	movq	104(%rsp), %rcx                 # 8-byte Reload
	cmpq	%r14, %rcx
	jne	.LBB1_19
.LBB1_21:                               # %._crit_edge
	movq	88(%rsp), %rax                  # 8-byte Reload
	movq	16(%rax), %rsi
.Ltmp3:
	leaq	56(%rsp), %rdi
	leaq	15(%rsp), %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
.Ltmp4:
# %bb.22:
	movq	56(%rsp), %r12
	movq	16(%rsp), %r14                  # 8-byte Reload
	movl	(%r14), %ebp
	movl	$0, (%r14)
	leaq	112(%rsp), %r13
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	$10, %edx
	callq	__isoc23_strtol
	cmpq	%r12, (%r13)
	je	.LBB1_23
# %bb.33:
	movq	%rax, %r15
	movabsq	$-4294967296, %rax              # imm = 0xFFFFFFFF00000000
	leaq	-2147483648(%r15), %rcx
	cmpq	%rax, %rcx
	jb	.LBB1_35
# %bb.34:
	movl	(%r14), %eax
	cmpl	$34, %eax
	je	.LBB1_35
# %bb.37:
	testl	%eax, %eax
	jne	.LBB1_39
# %bb.38:
	movl	%ebp, (%r14)
.LBB1_39:
	movq	56(%rsp), %rdi
	leaq	72(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB1_41
# %bb.40:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i76
	callq	_ZdlPv
.LBB1_41:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit78
	leal	(%rbx,%r15), %eax
	decl	%eax
	cltd
	idivl	%r15d
	movl	%eax, %r12d
	callq	clock
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	btsq	$32, %r12
	movl	%r15d, %edx
	btsq	$32, %rdx
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_43
# %bb.42:
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdx
	movl	%ebx, %edi
	callq	_Z23__device_stub__dijkstraiPiS_
.LBB1_43:
	callq	hipDeviceSynchronize
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	testl	%ebx, %ebx
	jle	.LBB1_50
# %bb.44:                               # %.preheader.lr.ph
	leal	-1(%rbx), %eax
	movl	%eax, %r12d
	movl	%ebx, %r13d
	xorl	%ebp, %ebp
	xorl	%r14d, %r14d
.LBB1_45:                               # %.lr.ph89
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_46 Depth 2
	movl	%ebp, %ebx
	shlq	$2, %rbx
	xorl	%r15d, %r15d
.LBB1_46:                               #   Parent Loop BB1_45 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	40(%rsp), %rax
	addq	%rbx, %rax
	movl	(%rax,%r15,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	cmpq	%r15, %r12
	je	.LBB1_48
# %bb.47:                               #   in Loop: Header=BB1_46 Depth=2
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB1_48:                               #   in Loop: Header=BB1_46 Depth=2
	incq	%r15
	cmpq	%r15, %r13
	jne	.LBB1_46
# %bb.49:                               # %._crit_edge90
                                        #   in Loop: Header=BB1_45 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incq	%r14
	addl	48(%rsp), %ebp                  # 4-byte Folded Reload
	cmpq	%r13, %r14
	jne	.LBB1_45
.LBB1_50:                               # %._crit_edge92
	callq	clock
	subq	24(%rsp), %rax                  # 8-byte Folded Reload
	cvtsi2sd	%rax, %xmm0
	movsd	.LCPI1_0(%rip), %xmm1           # xmm1 = mem[0],zero
	divsd	%xmm1, %xmm0
	mulsd	%xmm1, %xmm0
	movl	$.L.str.2, %edi
	movb	$1, %al
	callq	printf
	movq	40(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	xorl	%eax, %eax
	addq	$120, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB1_2:
	.cfi_def_cfa_offset 176
.Ltmp13:
	movl	$.L.str.3, %edi
	callq	_ZSt24__throw_invalid_argumentPKc
.Ltmp14:
# %bb.3:
.LBB1_11:                               # %.critedge.i.i
.Ltmp11:
	movl	$.L.str.3, %edi
	callq	_ZSt20__throw_out_of_rangePKc
.Ltmp12:
# %bb.12:
.LBB1_23:
.Ltmp8:
	movl	$.L.str.3, %edi
	callq	_ZSt24__throw_invalid_argumentPKc
.Ltmp9:
# %bb.29:
.LBB1_35:                               # %.critedge.i.i71
.Ltmp6:
	movl	$.L.str.3, %edi
	callq	_ZSt20__throw_out_of_rangePKc
.Ltmp7:
# %bb.36:
.LBB1_51:
.Ltmp5:
	jmp	.LBB1_25
.LBB1_24:
.Ltmp2:
.LBB1_25:
	movq	%rax, %rbx
	jmp	.LBB1_26
.LBB1_30:
.Ltmp10:
	movq	%rax, %rbx
	movq	16(%rsp), %rax                  # 8-byte Reload
	cmpl	$0, (%rax)
	jne	.LBB1_32
# %bb.31:
	movq	16(%rsp), %rax                  # 8-byte Reload
	movl	%ebp, (%rax)
.LBB1_32:                               # %_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev.exit.i.i72
	movq	56(%rsp), %rdi
	leaq	72(%rsp), %rax
	jmp	.LBB1_7
.LBB1_4:
.Ltmp15:
	movq	%rax, %rbx
	movq	16(%rsp), %rax                  # 8-byte Reload
	cmpl	$0, (%rax)
	jne	.LBB1_6
# %bb.5:
	movq	16(%rsp), %rax                  # 8-byte Reload
	movl	%ebp, (%rax)
.LBB1_6:                                # %_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev.exit.i.i
	leaq	72(%rsp), %rax
	movq	-16(%rax), %rdi
.LBB1_7:                                # %_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev.exit.i.i
	cmpq	%rax, %rdi
	je	.LBB1_26
# %bb.8:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i67
	callq	_ZdlPv
.LBB1_26:
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table1:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 1 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp1-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp3-.Ltmp1                  #   Call between .Ltmp1 and .Ltmp3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp4-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp13-.Ltmp4                 #   Call between .Ltmp4 and .Ltmp13
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp13-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp12-.Ltmp13                #   Call between .Ltmp13 and .Ltmp12
	.uleb128 .Ltmp15-.Lfunc_begin0          #     jumps to .Ltmp15
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp8-.Lfunc_begin0           # >> Call Site 6 <<
	.uleb128 .Ltmp7-.Ltmp8                  #   Call between .Ltmp8 and .Ltmp7
	.uleb128 .Ltmp10-.Lfunc_begin0          #     jumps to .Ltmp10
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp7-.Lfunc_begin0           # >> Call Site 7 <<
	.uleb128 .Lfunc_end1-.Ltmp7             #   Call between .Ltmp7 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_ # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	je	.LBB2_1
# %bb.2:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	strlen
	leaq	(%rax,%rbx), %rdx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # TAILCALL
.LBB2_1:
	.cfi_def_cfa_offset 32
	movl	$.L.str.4, %edi
	callq	_ZSt19__throw_logic_errorPKc
.Lfunc_end2:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .Lfunc_end2-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_startproc
# %bb.0:
	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	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB3_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB3_3
.LBB3_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB3_3:
	testq	%r14, %r14
	je	.LBB3_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB3_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB3_7
.LBB3_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB3_7:                                # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	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
	retq
.Lfunc_end3:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end3-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z8dijkstraiPiS_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end4:
	.size	__hip_module_ctor, .Lfunc_end4-__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	.LBB5_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
.LBB5_2:
	retq
.Lfunc_end5:
	.size	__hip_module_dtor, .Lfunc_end5-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z8dijkstraiPiS_,@object        # @_Z8dijkstraiPiS_
	.section	.rodata,"a",@progbits
	.globl	_Z8dijkstraiPiS_
	.p2align	3, 0x0
_Z8dijkstraiPiS_:
	.quad	_Z23__device_stub__dijkstraiPiS_
	.size	_Z8dijkstraiPiS_, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"------DIJKSTRA-------"
	.size	.L.str, 22

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Time taken: %.2f microsekon\n"
	.size	.L.str.2, 29

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"basic_string: construction from null is not valid"
	.size	.L.str.4, 50

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z8dijkstraiPiS_"
	.size	.L__unnamed_1, 17

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

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

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z23__device_stub__dijkstraiPiS_
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z8dijkstraiPiS_
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z8dijkstraiPiS_        ; -- Begin function _Z8dijkstraiPiS_
	.globl	_Z8dijkstraiPiS_
	.p2align	8
	.type	_Z8dijkstraiPiS_,@function
_Z8dijkstraiPiS_:                       ; @_Z8dijkstraiPiS_
; %bb.0:
	s_clause 0x1
	s_load_b32 s5, s[0:1], 0x24
	s_load_b32 s4, s[0:1], 0x0
	s_add_u32 s2, s0, 24
	s_addc_u32 s3, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s7, s5, 0xffff
	s_mov_b32 s5, exec_lo
	v_mad_u64_u32 v[1:2], null, s15, s7, v[0:1]
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s4, v1
	s_cbranch_execz .LBB0_25
; %bb.1:                                ; %.lr.ph92
	s_load_b32 s8, s[2:3], 0x0
	s_load_b128 s[0:3], s[0:1], 0x8
	v_mul_lo_u32 v2, s4, v1
	s_cmp_gt_i32 s4, 0
	v_bfrev_b32_e32 v0, -2
	v_dual_mov_b32 v5, 0 :: v_dual_mov_b32 v6, 1
	s_cselect_b32 s5, -1, 0
	s_cmp_gt_i32 s4, 1
                                        ; implicit-def: $vgpr7
	s_cselect_b32 s6, -1, 0
	s_add_i32 s9, s4, -2
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s7, s8, s7
	s_mov_b32 s8, 0
	s_mul_i32 s10, s7, s4
.LBB0_2:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;     Child Loop BB0_7 Depth 2
                                        ;       Child Loop BB0_9 Depth 3
                                        ;       Child Loop BB0_14 Depth 3
                                        ;     Child Loop BB0_23 Depth 2
	s_and_not1_b32 vcc_lo, exec_lo, s5
	s_cbranch_vccnz .LBB0_5
; %bb.3:                                ; %.lr.ph.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_dual_mov_b32 v3, 16 :: v_dual_mov_b32 v4, 0x1d0
	s_mov_b32 s11, s4
.LBB0_4:                                ; %.lr.ph
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	scratch_store_b32 v3, v0, off
	scratch_store_b32 v4, v5, off
	v_add_nc_u32_e32 v3, 4, v3
	v_add_nc_u32_e32 v4, 4, v4
	s_add_i32 s11, s11, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s11, 0
	s_cbranch_scc0 .LBB0_4
.LBB0_5:                                ; %._crit_edge
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_lshl_add_u32 v3, v1, 2, 16
	s_and_not1_b32 vcc_lo, exec_lo, s6
	scratch_store_b32 v3, v5, off
	s_cbranch_vccnz .LBB0_21
; %bb.6:                                ; %.preheader.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_mov_b32 s11, 0
.LBB0_7:                                ; %.preheader
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_9 Depth 3
                                        ;       Child Loop BB0_14 Depth 3
	s_and_not1_b32 vcc_lo, exec_lo, s5
	s_cbranch_vccnz .LBB0_12
; %bb.8:                                ; %.lr.ph77.preheader
                                        ;   in Loop: Header=BB0_7 Depth=2
	v_dual_mov_b32 v3, 0x1d0 :: v_dual_mov_b32 v4, 16
	v_bfrev_b32_e32 v8, -2
	s_mov_b32 s12, 0
.LBB0_9:                                ; %.lr.ph77
                                        ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	scratch_load_b32 v9, v3, off
	s_mov_b32 s13, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u32_e32 0, v9
	s_cbranch_execz .LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=3
	scratch_load_b32 v9, v4, off
	s_waitcnt vmcnt(0)
	v_cmp_gt_i32_e32 vcc_lo, v9, v8
	v_min_i32_e32 v8, v9, v8
	v_cndmask_b32_e32 v7, s12, v7, vcc_lo
.LBB0_11:                               ;   in Loop: Header=BB0_9 Depth=3
	s_or_b32 exec_lo, exec_lo, s13
	v_add_nc_u32_e32 v3, 4, v3
	v_add_nc_u32_e32 v4, 4, v4
	s_add_i32 s12, s12, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s4, s12
	s_cbranch_scc0 .LBB0_9
.LBB0_12:                               ; %._crit_edge78
                                        ;   in Loop: Header=BB0_7 Depth=2
	v_lshl_add_u32 v3, v7, 2, 0x1d0
	s_and_not1_b32 vcc_lo, exec_lo, s5
	scratch_store_b32 v3, v6, off
	s_cbranch_vccnz .LBB0_19
; %bb.13:                               ; %.lr.ph81
                                        ;   in Loop: Header=BB0_7 Depth=2
	v_mul_lo_u32 v3, v7, s4
	v_lshl_add_u32 v8, v7, 2, 16
	v_dual_mov_b32 v9, 0x1d0 :: v_dual_mov_b32 v10, 16
	s_mov_b32 s12, s4
.LBB0_14:                               ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	scratch_load_b32 v4, v9, off
	s_mov_b32 s13, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u32_e32 0, v4
	s_cbranch_execz .LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=3
	v_ashrrev_i32_e32 v4, 31, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[11:12], 2, v[3:4]
	v_add_co_u32 v11, vcc_lo, s2, v11
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v12, vcc_lo, s3, v12, vcc_lo
	global_load_b32 v4, v[11:12], off
	s_waitcnt vmcnt(0)
	v_cmp_ne_u32_e32 vcc_lo, 0, v4
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=3
	scratch_load_b32 v11, v8, off
	s_waitcnt vmcnt(0)
	v_cmp_ne_u32_e32 vcc_lo, 0x7fffffff, v11
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=3
	scratch_load_b32 v12, v10, off
	v_add_nc_u32_e32 v4, v11, v4
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_min_i32_e32 v4, v4, v12
	scratch_store_b32 v10, v4, off
.LBB0_18:                               ;   in Loop: Header=BB0_14 Depth=3
	s_or_b32 exec_lo, exec_lo, s13
	v_add_nc_u32_e32 v3, 1, v3
	v_add_nc_u32_e32 v9, 4, v9
	v_add_nc_u32_e32 v10, 4, v10
	s_add_i32 s12, s12, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s12, 0
	s_cbranch_scc0 .LBB0_14
.LBB0_19:                               ; %._crit_edge82
                                        ;   in Loop: Header=BB0_7 Depth=2
	s_add_i32 s12, s11, 1
	s_cmp_eq_u32 s11, s9
	s_cbranch_scc1 .LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_7 Depth=2
	s_mov_b32 s11, s12
	s_branch .LBB0_7
.LBB0_21:                               ; %.preheader72
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_and_not1_b32 vcc_lo, exec_lo, s5
	s_cbranch_vccnz .LBB0_24
; %bb.22:                               ; %.lr.ph87
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_ashrrev_i32_e32 v3, 31, v2
	v_mov_b32_e32 v8, 16
	s_mov_b32 s11, s4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[3:4], 2, v[2:3]
	v_add_co_u32 v3, vcc_lo, s0, v3
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v4, vcc_lo, s1, v4, vcc_lo
.LBB0_23:                               ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	scratch_load_b32 v9, v8, off
	v_add_nc_u32_e32 v8, 4, v8
	s_add_i32 s11, s11, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s11, 0
	s_waitcnt vmcnt(0)
	global_store_b32 v[3:4], v9, off
	v_add_co_u32 v3, vcc_lo, v3, 4
	v_add_co_ci_u32_e32 v4, vcc_lo, 0, v4, vcc_lo
	s_cbranch_scc0 .LBB0_23
.LBB0_24:                               ; %._crit_edge88
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v1, s7, v1
	v_add_nc_u32_e32 v2, s10, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_le_i32_e32 vcc_lo, s4, v1
	s_or_b32 s8, vcc_lo, s8
	s_and_not1_b32 exec_lo, exec_lo, s8
	s_cbranch_execnz .LBB0_2
.LBB0_25:                               ; %Flow141
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8dijkstraiPiS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 912
		.amdhsa_kernarg_size 280
		.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 1
		.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 13
		.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	_Z8dijkstraiPiS_, .Lfunc_end0-_Z8dijkstraiPiS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 720
; NumSgprs: 18
; NumVgprs: 13
; ScratchSize: 912
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 13
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 1
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
