; LLVM IR from brpapa/algorithms :: solutions/uva/10806.ll (Z4dijki)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Tadj, std::allocator<Tadj>>::_Vector_impl" }
%"struct.std::_Vector_base<Tadj, std::allocator<Tadj>>::_Vector_impl" = type { %"struct.std::_Vector_base<Tadj, std::allocator<Tadj>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Tadj, std::allocator<Tadj>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector.5", [8 x i8] }>
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<Tpq, std::allocator<Tpq>>::_Vector_impl" }
%"struct.std::_Vector_base<Tpq, std::allocator<Tpq>>::_Vector_impl" = type { %"struct.std::_Vector_base<Tpq, std::allocator<Tpq>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Tpq, std::allocator<Tpq>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Tpq = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.Tadj = type { i32, i32 }

@V = external dso_local global i32, align 4
@adjList = external dso_local global [110 x %"class.std::vector"], align 16
@usedEdge = external dso_local global [110 x [110 x i8]], align 16
@shortestDist = external dso_local global %"class.std::vector.0", align 8
@parent = external dso_local global %"class.std::vector.0", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4dijki(i32 noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::priority_queue", align 8
  %6 = alloca %struct.Tpq, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.Tpq, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %struct.Tadj, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.Tpq, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr @V, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1073741824, ptr %3, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE6assignEmRKi(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef %18, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef 0) #5
  store i32 0, ptr %19, align 4, !tbaa !5
  %20 = load i32, ptr @V, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 -1, ptr %4, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE6assignEmRKi(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %21, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #5
  call void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %22 = load i32, ptr %2, align 4, !tbaa !5
  invoke void @_ZN3TpqC2Eii(ptr noundef nonnull align 4 dereferenceable(8) %6, i32 noundef %22, i32 noundef 0)
          to label %23 unwind label %42

23:                                               ; preds = %1
  invoke void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 4 dereferenceable(8) %6)
          to label %24 unwind label %42

24:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %25

25:                                               ; preds = %131, %129, %24
  %26 = invoke noundef zeroext i1 @_ZNKSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %27 unwind label %46

27:                                               ; preds = %25
  %28 = xor i1 %26, true
  br i1 %28, label %29, label %133

29:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %30 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %31 unwind label %50

31:                                               ; preds = %29
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %30, i64 8, i1 false), !tbaa.struct !9
  invoke void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %32 unwind label %50

32:                                               ; preds = %31
  %33 = getelementptr inbounds %struct.Tpq, ptr %9, i32 0, i32 1
  %34 = load i32, ptr %33, align 4, !tbaa !10
  %35 = getelementptr inbounds %struct.Tpq, ptr %9, i32 0, i32 0
  %36 = load i32, ptr %35, align 4, !tbaa !12
  %37 = sext i32 %36 to i64
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef %37) #5
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = icmp sgt i32 %34, %39
  br i1 %40, label %41, label %54

41:                                               ; preds = %32
  store i32 2, ptr %10, align 4
  br label %129, !llvm.loop !13

42:                                               ; preds = %23, %1
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %7, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %134

46:                                               ; preds = %25
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %7, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %8, align 4
  br label %134

50:                                               ; preds = %31, %29
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %7, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %8, align 4
  br label %132

54:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %55 = getelementptr inbounds %struct.Tpq, ptr %9, i32 0, i32 0
  %56 = load i32, ptr %55, align 4, !tbaa !12
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [110 x %"class.std::vector"], ptr @adjList, i64 0, i64 %57
  store ptr %58, ptr %11, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %59 = load ptr, ptr %11, align 8, !tbaa !15
  %60 = call ptr @_ZNSt6vectorI4TadjSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #5
  %61 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %60, ptr %61, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %62 = load ptr, ptr %11, align 8, !tbaa !15
  %63 = call ptr @_ZNSt6vectorI4TadjSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #5
  %64 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %63, ptr %64, align 8
  br label %65

65:                                               ; preds = %126, %54
  %66 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4TadjSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br i1 %66, label %68, label %67

67:                                               ; preds = %65
  store i32 4, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %128

68:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %69 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TadjSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %69, i64 8, i1 false), !tbaa.struct !9
  %70 = getelementptr inbounds %struct.Tpq, ptr %9, i32 0, i32 0
  %71 = load i32, ptr %70, align 4, !tbaa !12
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [110 x [110 x i8]], ptr @usedEdge, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.Tadj, ptr %14, i32 0, i32 0
  %75 = load i32, ptr %74, align 4, !tbaa !17
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [110 x i8], ptr %73, i64 0, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !19, !range !21, !noundef !22
  %79 = trunc i8 %78 to i1
  br i1 %79, label %80, label %81

80:                                               ; preds = %68
  store i32 5, ptr %10, align 4
  br label %123

81:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %82 = getelementptr inbounds %struct.Tpq, ptr %9, i32 0, i32 0
  %83 = load i32, ptr %82, align 4, !tbaa !12
  %84 = sext i32 %83 to i64
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef %84) #5
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = getelementptr inbounds %struct.Tadj, ptr %14, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !23
  %89 = add nsw i32 %86, %88
  store i32 %89, ptr %15, align 4, !tbaa !5
  %90 = load i32, ptr %15, align 4, !tbaa !5
  %91 = getelementptr inbounds %struct.Tadj, ptr %14, i32 0, i32 0
  %92 = load i32, ptr %91, align 4, !tbaa !17
  %93 = sext i32 %92 to i64
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef %93) #5
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = icmp slt i32 %90, %95
  br i1 %96, label %97, label %122

97:                                               ; preds = %81
  %98 = load i32, ptr %15, align 4, !tbaa !5
  %99 = getelementptr inbounds %struct.Tadj, ptr %14, i32 0, i32 0
  %100 = load i32, ptr %99, align 4, !tbaa !17
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef %101) #5
  store i32 %98, ptr %102, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %103 = getelementptr inbounds %struct.Tadj, ptr %14, i32 0, i32 0
  %104 = load i32, ptr %103, align 4, !tbaa !17
  %105 = getelementptr inbounds %struct.Tadj, ptr %14, i32 0, i32 0
  %106 = load i32, ptr %105, align 4, !tbaa !17
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef %107) #5
  %109 = load i32, ptr %108, align 4, !tbaa !5
  invoke void @_ZN3TpqC2Eii(ptr noundef nonnull align 4 dereferenceable(8) %16, i32 noundef %104, i32 noundef %109)
          to label %110 unwind label %118

110:                                              ; preds = %97
  invoke void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 4 dereferenceable(8) %16)
          to label %111 unwind label %118

111:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %112 = getelementptr inbounds %struct.Tpq, ptr %9, i32 0, i32 0
  %113 = load i32, ptr %112, align 4, !tbaa !12
  %114 = getelementptr inbounds %struct.Tadj, ptr %14, i32 0, i32 0
  %115 = load i32, ptr %114, align 4, !tbaa !17
  %116 = sext i32 %115 to i64
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %116) #5
  store i32 %113, ptr %117, align 4, !tbaa !5
  br label %122

118:                                              ; preds = %110, %97
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %7, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %132

122:                                              ; preds = %111, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  store i32 0, ptr %10, align 4
  br label %123

123:                                              ; preds = %122, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  %124 = load i32, ptr %10, align 4
  switch i32 %124, label %140 [
    i32 0, label %125
    i32 5, label %126
  ]

125:                                              ; preds = %123
  br label %126

126:                                              ; preds = %125, %123
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4TadjSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br label %65

128:                                              ; preds = %67
  store i32 0, ptr %10, align 4
  br label %129

129:                                              ; preds = %128, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  %130 = load i32, ptr %10, align 4
  switch i32 %130, label %140 [
    i32 0, label %131
    i32 2, label %25
  ]

131:                                              ; preds = %129
  br label %25, !llvm.loop !13

132:                                              ; preds = %118, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %134

133:                                              ; preds = %27
  call void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  ret void

134:                                              ; preds = %132, %46, %42
  call void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  br label %135

135:                                              ; preds = %134
  %136 = load ptr, ptr %7, align 8
  %137 = load i32, ptr %8, align 4
  %138 = insertvalue { ptr, i32 } poison, ptr %136, 0
  %139 = insertvalue { ptr, i32 } %138, i32 %137, 1
  resume { ptr, i32 } %139

140:                                              ; preds = %129, %123
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE6assignEmRKi(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3TpqC2Eii(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef, i32 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorI4TadjSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorI4TadjSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIP4TadjSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TadjSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4TadjSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #4 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!10 = !{!11, !6, i64 4}
!11 = !{!"_ZTS3Tpq", !6, i64 0, !6, i64 4}
!12 = !{!11, !6, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTS4Tadj", !6, i64 0, !6, i64 4}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!18, !6, i64 4}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Tadj, std::allocator<Tadj>>::_Vector_impl" }
%"struct.std::_Vector_base<Tadj, std::allocator<Tadj>>::_Vector_impl" = type { %"struct.std::_Vector_base<Tadj, std::allocator<Tadj>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Tadj, std::allocator<Tadj>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector.5", [8 x i8] }>
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<Tpq, std::allocator<Tpq>>::_Vector_impl" }
%"struct.std::_Vector_base<Tpq, std::allocator<Tpq>>::_Vector_impl" = type { %"struct.std::_Vector_base<Tpq, std::allocator<Tpq>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Tpq, std::allocator<Tpq>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Tpq = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@V = external dso_local local_unnamed_addr global i32, align 4
@adjList = external dso_local global [110 x %"class.std::vector"], align 16
@usedEdge = external dso_local local_unnamed_addr global [110 x [110 x i8]], align 16
@shortestDist = external dso_local global %"class.std::vector.0", align 8
@parent = external dso_local global %"class.std::vector.0", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4dijki(i32 noundef %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::priority_queue", align 8
  %5 = alloca %struct.Tpq, align 4
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %struct.Tpq, align 4
  %9 = load i32, ptr @V, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  store i32 1073741824, ptr %2, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE6assignEmRKi(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef %10, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %11 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef 0) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  %12 = load i32, ptr @V, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 -1, ptr %3, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE6assignEmRKi(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %13, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  call void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @_ZN3TpqC2Eii(ptr noundef nonnull align 4 dereferenceable(8) %5, i32 noundef %0, i32 noundef 0)
  invoke void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 4 dereferenceable(8) %5)
          to label %14 unwind label %22

14:                                               ; preds = %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %15 = call noundef zeroext i1 @_ZNKSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  br i1 %15, label %._crit_edge23, label %.lr.ph22

.lr.ph22:                                         ; preds = %14, %54
  %16 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  %.sroa.08.0.copyload = load i32, ptr %16, align 4, !tbaa !5
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %16, i64 4
  %.sroa.9.0.copyload = load i32, ptr %.sroa.9.0..sroa_idx, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
          to label %17 unwind label %24

17:                                               ; preds = %.lr.ph22
  %18 = sext i32 %.sroa.08.0.copyload to i64
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef %18) #4
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = icmp sgt i32 %.sroa.9.0.copyload, %20
  br i1 %21, label %54, label %26, !llvm.loop !9

22:                                               ; preds = %1
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %56

24:                                               ; preds = %.lr.ph22
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %56

26:                                               ; preds = %17
  %27 = getelementptr inbounds [110 x %"class.std::vector"], ptr @adjList, i64 0, i64 %18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %28 = call ptr @_ZNSt6vectorI4TadjSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #4
  store ptr %28, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %29 = call ptr @_ZNSt6vectorI4TadjSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #4
  store ptr %29, ptr %7, align 8
  %30 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4TadjSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br i1 %30, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %51, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %54

.lr.ph:                                           ; preds = %26, %51
  %31 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TadjSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %.sroa.0.0.copyload = load i32, ptr %31, align 4, !tbaa !5
  %32 = sext i32 %.sroa.0.0.copyload to i64
  %33 = getelementptr inbounds [110 x [110 x i8]], ptr @usedEdge, i64 0, i64 %18, i64 %32
  %34 = load i8, ptr %33, align 1, !tbaa !11, !range !13, !noundef !14
  %35 = trunc nuw i8 %34 to i1
  br i1 %35, label %51, label %36

36:                                               ; preds = %.lr.ph
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %31, i64 4
  %.sroa.10.0.copyload = load i32, ptr %.sroa.10.0..sroa_idx, align 4, !tbaa !5
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef %18) #4
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = add nsw i32 %38, %.sroa.10.0.copyload
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef %32) #4
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = icmp slt i32 %39, %41
  br i1 %42, label %43, label %51

43:                                               ; preds = %36
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef %32) #4
  store i32 %39, ptr %44, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @shortestDist, i64 noundef %32) #4
  %46 = load i32, ptr %45, align 4, !tbaa !5
  call void @_ZN3TpqC2Eii(ptr noundef nonnull align 4 dereferenceable(8) %8, i32 noundef %.sroa.0.0.copyload, i32 noundef %46)
  invoke void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %47 unwind label %49

47:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %32) #4
  store i32 %.sroa.08.0.copyload, ptr %48, align 4, !tbaa !5
  br label %51

49:                                               ; preds = %43
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %56

51:                                               ; preds = %36, %47, %.lr.ph
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4TadjSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %53 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4TadjSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br i1 %53, label %.lr.ph, label %._crit_edge

54:                                               ; preds = %17, %._crit_edge
  %55 = call noundef zeroext i1 @_ZNKSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  br i1 %55, label %._crit_edge23, label %.lr.ph22

._crit_edge23:                                    ; preds = %54, %14
  call void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  ret void

56:                                               ; preds = %24, %49, %22
  %.pn.pn = phi { ptr, i32 } [ %23, %22 ], [ %50, %49 ], [ %25, %24 ]
  call void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE6assignEmRKi(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3TpqC2Eii(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef, i32 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorI4TadjSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorI4TadjSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIP4TadjSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4TadjSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4TadjSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueI3TpqSt6vectorIS0_SaIS0_EESt4lessIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #3 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass