; LLVM IR from CodersForLife/Data-Structures-Algorithms :: Dijkstra/Dijkstra.cpp.ll (ZN5Graph8DijkstraEi)

; 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"

%"struct.std::_List_iterator" = type { ptr }
%class.Graph = type { i32, ptr, ptr, %"class.std::vector", ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_List_impl" }
%"struct.std::__cxx11::_List_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5Graph8DijkstraEi(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::_List_iterator", align 8
  %8 = alloca %"struct.std::_List_iterator", align 8
  %9 = alloca %"struct.std::_List_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::_List_iterator", align 8
  %12 = alloca %"struct.std::_List_iterator", align 8
  %13 = alloca %"struct.std::_List_iterator", align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %15 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %16 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 0
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = add nsw i32 %17, 1
  %19 = sext i32 %18 to i64
  %20 = call noalias noundef nonnull ptr @_Znam(i64 noundef %19) #6
  store ptr %20, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %42, %2
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 0
  %24 = load i32, ptr %23, align 8, !tbaa !11
  %25 = icmp sle i32 %22, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %45

27:                                               ; preds = %21
  %28 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !17
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i32, ptr %29, i64 %31
  store i32 -1, ptr %32, align 4, !tbaa !9
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = load i32, ptr %6, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i8, ptr %33, i64 %35
  store i8 0, ptr %36, align 1, !tbaa !18
  %37 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !20
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr %38, i64 %40
  store i32 -1, ptr %41, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %27
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %6, align 4, !tbaa !9
  br label %21, !llvm.loop !21

45:                                               ; preds = %26
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = load i32, ptr %4, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i8, ptr %46, i64 %48
  store i8 1, ptr %49, align 1, !tbaa !18
  %50 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8, !tbaa !20
  %52 = load i32, ptr %4, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr %51, i64 %53
  store i32 0, ptr %54, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %55 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 4
  %56 = load ptr, ptr %55, align 8, !tbaa !23
  %57 = load i32, ptr %4, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds %"class.std::__cxx11::list", ptr %56, i64 %58
  %60 = call ptr @_ZNSt7__cxx114listISt4pairIiiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #5
  %61 = getelementptr inbounds %"struct.std::_List_iterator", ptr %7, i32 0, i32 0
  store ptr %60, ptr %61, align 8
  br label %62

62:                                               ; preds = %71, %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %63 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 4
  %64 = load ptr, ptr %63, align 8, !tbaa !23
  %65 = load i32, ptr %4, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds %"class.std::__cxx11::list", ptr %64, i64 %66
  %68 = call ptr @_ZNSt7__cxx114listISt4pairIiiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %67) #5
  %69 = getelementptr inbounds %"struct.std::_List_iterator", ptr %8, i32 0, i32 0
  store ptr %68, ptr %69, align 8
  %70 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br i1 %70, label %71, label %88

71:                                               ; preds = %62
  %72 = call noundef ptr @_ZNKSt14_List_iteratorISt4pairIiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %73 = getelementptr inbounds %"struct.std::pair", ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 4, !tbaa !24
  %75 = call noundef ptr @_ZNKSt14_List_iteratorISt4pairIiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %76 = getelementptr inbounds %"struct.std::pair", ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 4, !tbaa !26
  %78 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8, !tbaa !20
  %80 = load i32, ptr %4, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i32, ptr %79, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = add nsw i32 %77, %83
  %85 = call noundef i32 @_ZN5Graph6insertEii(ptr noundef nonnull align 8 dereferenceable(56) %15, i32 noundef %74, i32 noundef %84)
  %86 = call ptr @_ZNSt14_List_iteratorISt4pairIiiEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 0) #5
  %87 = getelementptr inbounds %"struct.std::_List_iterator", ptr %9, i32 0, i32 0
  store ptr %86, ptr %87, align 8
  br label %62, !llvm.loop !27

88:                                               ; preds = %62
  br label %89

89:                                               ; preds = %144, %88
  %90 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 3
  %91 = call noundef zeroext i1 @_ZNKSt6vectorIiSaIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %90) #5
  %92 = xor i1 %91, true
  br i1 %92, label %93, label %145

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %94 = call noundef i32 @_ZN5Graph11extract_minEv(ptr noundef nonnull align 8 dereferenceable(56) %15)
  store i32 %94, ptr %10, align 4, !tbaa !9
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = load i32, ptr %10, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i8, ptr %95, i64 %97
  store i8 1, ptr %98, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %99 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 4
  %100 = load ptr, ptr %99, align 8, !tbaa !23
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds %"class.std::__cxx11::list", ptr %100, i64 %102
  %104 = call ptr @_ZNSt7__cxx114listISt4pairIiiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %103) #5
  %105 = getelementptr inbounds %"struct.std::_List_iterator", ptr %11, i32 0, i32 0
  store ptr %104, ptr %105, align 8
  br label %106

106:                                              ; preds = %141, %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %107 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 4
  %108 = load ptr, ptr %107, align 8, !tbaa !23
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds %"class.std::__cxx11::list", ptr %108, i64 %110
  %112 = call ptr @_ZNSt7__cxx114listISt4pairIiiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %111) #5
  %113 = getelementptr inbounds %"struct.std::_List_iterator", ptr %12, i32 0, i32 0
  store ptr %112, ptr %113, align 8
  %114 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br i1 %114, label %115, label %144

115:                                              ; preds = %106
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = call noundef ptr @_ZNKSt14_List_iteratorISt4pairIiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  %118 = getelementptr inbounds %"struct.std::pair", ptr %117, i32 0, i32 0
  %119 = load i32, ptr %118, align 4, !tbaa !24
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i8, ptr %116, i64 %120
  %122 = load i8, ptr %121, align 1, !tbaa !18, !range !28, !noundef !29
  %123 = trunc i8 %122 to i1
  %124 = zext i1 %123 to i32
  %125 = icmp eq i32 %124, 0
  br i1 %125, label %126, label %141

126:                                              ; preds = %115
  %127 = call noundef ptr @_ZNKSt14_List_iteratorISt4pairIiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  %128 = getelementptr inbounds %"struct.std::pair", ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 4, !tbaa !24
  %130 = call noundef ptr @_ZNKSt14_List_iteratorISt4pairIiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  %131 = getelementptr inbounds %"struct.std::pair", ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !26
  %133 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 1
  %134 = load ptr, ptr %133, align 8, !tbaa !20
  %135 = load i32, ptr %10, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i32, ptr %134, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !9
  %139 = add nsw i32 %132, %138
  %140 = call noundef i32 @_ZN5Graph6insertEii(ptr noundef nonnull align 8 dereferenceable(56) %15, i32 noundef %129, i32 noundef %139)
  br label %141

141:                                              ; preds = %126, %115
  %142 = call ptr @_ZNSt14_List_iteratorISt4pairIiiEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef 0) #5
  %143 = getelementptr inbounds %"struct.std::_List_iterator", ptr %13, i32 0, i32 0
  store ptr %142, ptr %143, align 8
  br label %106, !llvm.loop !30

144:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %89, !llvm.loop !31

145:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %146

146:                                              ; preds = %165, %145
  %147 = load i32, ptr %14, align 4, !tbaa !9
  %148 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 0
  %149 = load i32, ptr %148, align 8, !tbaa !11
  %150 = icmp sle i32 %147, %149
  br i1 %150, label %152, label %151

151:                                              ; preds = %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %168

152:                                              ; preds = %146
  %153 = load i32, ptr %4, align 4, !tbaa !9
  %154 = load i32, ptr %14, align 4, !tbaa !9
  %155 = icmp ne i32 %153, %154
  br i1 %155, label %156, label %164

156:                                              ; preds = %152
  %157 = getelementptr inbounds %class.Graph, ptr %15, i32 0, i32 1
  %158 = load ptr, ptr %157, align 8, !tbaa !20
  %159 = load i32, ptr %14, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds i32, ptr %158, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !9
  %163 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %162)
  br label %164

164:                                              ; preds = %156, %152
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %14, align 4, !tbaa !9
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %14, align 4, !tbaa !9
  br label %146, !llvm.loop !32

168:                                              ; preds = %151
  %169 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret i32 0
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5Graph6insertEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5Graph11extract_minEv(ptr noundef nonnull align 8 dereferenceable(56)) #2 align 2

declare i32 @printf(ptr noundef, ...) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nobuiltin allocsize(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 = { "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 }
attributes #6 = { builtin allocsize(0) }

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS5Graph", !10, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !6, i64 48}
!13 = !{!"_ZTSSt6vectorIiSaIiEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!12, !6, i64 16}
!18 = !{!19, !19, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!12, !6, i64 8}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!12, !6, i64 48}
!24 = !{!25, !10, i64 0}
!25 = !{!"_ZTSSt4pairIiiE", !10, i64 0, !10, i64 4}
!26 = !{!25, !10, i64 4}
!27 = distinct !{!27, !22}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = distinct !{!30, !22}
!31 = distinct !{!31, !22}
!32 = distinct !{!32, !22}


; 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"

%"struct.std::_List_iterator" = type { ptr }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_List_impl" }
%"struct.std::__cxx11::_List_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5Graph8DijkstraEi(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %1) local_unnamed_addr #2 align 2 {
  %3 = alloca %"struct.std::_List_iterator", align 8
  %4 = alloca %"struct.std::_List_iterator", align 8
  %5 = alloca %"struct.std::_List_iterator", align 8
  %6 = alloca %"struct.std::_List_iterator", align 8
  %7 = load i32, ptr %0, align 8, !tbaa !5
  %8 = add nsw i32 %7, 1
  %9 = sext i32 %8 to i64
  %10 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %9) #5
  %.not28 = icmp slt i32 %7, 1
  br i1 %.not28, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %2
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 8
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !15
  br label %._crit_edge

.lr.ph:                                           ; preds = %2
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  br label %28

._crit_edge:                                      ; preds = %28, %.._crit_edge_crit_edge
  %15 = phi ptr [ %.pre, %.._crit_edge_crit_edge ], [ %14, %28 ]
  %16 = sext i32 %1 to i64
  %17 = getelementptr inbounds i8, ptr %10, i64 %16
  store i8 1, ptr %17, align 1, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = getelementptr inbounds i32, ptr %15, i64 %16
  store i32 0, ptr %19, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %20 = getelementptr inbounds i8, ptr %0, i64 48
  %21 = load ptr, ptr %20, align 8, !tbaa !20
  %22 = getelementptr inbounds %"class.std::__cxx11::list", ptr %21, i64 %16
  %23 = tail call ptr @_ZNSt7__cxx114listISt4pairIiiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #6
  store ptr %23, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %24 = load ptr, ptr %20, align 8, !tbaa !20
  %25 = getelementptr inbounds %"class.std::__cxx11::list", ptr %24, i64 %16
  %26 = tail call ptr @_ZNSt7__cxx114listISt4pairIiiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #6
  store ptr %26, ptr %4, align 8
  %27 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %27, label %.lr.ph31, label %.preheader27

28:                                               ; preds = %.lr.ph, %28
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %28 ]
  %29 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv
  store i32 -1, ptr %29, align 4, !tbaa !19
  %30 = getelementptr inbounds i8, ptr %10, i64 %indvars.iv
  store i8 0, ptr %30, align 1, !tbaa !17
  %31 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv
  store i32 -1, ptr %31, align 4, !tbaa !19
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = load i32, ptr %0, align 8, !tbaa !5
  %33 = sext i32 %32 to i64
  %.not.not = icmp slt i64 %indvars.iv, %33
  br i1 %.not.not, label %28, label %._crit_edge, !llvm.loop !21

.preheader27:                                     ; preds = %.lr.ph31, %._crit_edge
  %34 = getelementptr inbounds i8, ptr %0, i64 24
  %35 = call noundef zeroext i1 @_ZNKSt6vectorIiSaIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #6
  br i1 %35, label %.preheader, label %.lr.ph35

.lr.ph31:                                         ; preds = %._crit_edge, %.lr.ph31
  %36 = call noundef ptr @_ZNKSt14_List_iteratorISt4pairIiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %37 = load i32, ptr %36, align 4, !tbaa !23
  %38 = call noundef ptr @_ZNKSt14_List_iteratorISt4pairIiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %39 = getelementptr inbounds i8, ptr %38, i64 4
  %40 = load i32, ptr %39, align 4, !tbaa !25
  %41 = load ptr, ptr %18, align 8, !tbaa !15
  %42 = getelementptr inbounds i32, ptr %41, i64 %16
  %43 = load i32, ptr %42, align 4, !tbaa !19
  %44 = add nsw i32 %43, %40
  %45 = call noundef i32 @_ZN5Graph6insertEii(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %37, i32 noundef %44)
  %46 = call ptr @_ZNSt14_List_iteratorISt4pairIiiEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %47 = load ptr, ptr %20, align 8, !tbaa !20
  %48 = getelementptr inbounds %"class.std::__cxx11::list", ptr %47, i64 %16
  %49 = call ptr @_ZNSt7__cxx114listISt4pairIiiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #6
  store ptr %49, ptr %4, align 8
  %50 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %50, label %.lr.ph31, label %.preheader27, !llvm.loop !26

.preheader:                                       ; preds = %._crit_edge34, %.preheader27
  %51 = load i32, ptr %0, align 8, !tbaa !5
  %.not2536 = icmp slt i32 %51, 1
  br i1 %.not2536, label %._crit_edge39, label %.lr.ph38.preheader

.lr.ph38.preheader:                               ; preds = %.preheader
  %52 = zext i32 %1 to i64
  br label %.lr.ph38

.lr.ph35:                                         ; preds = %.preheader27, %._crit_edge34
  %53 = call noundef i32 @_ZN5Graph11extract_minEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %10, i64 %54
  store i8 1, ptr %55, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %56 = load ptr, ptr %20, align 8, !tbaa !20
  %57 = getelementptr inbounds %"class.std::__cxx11::list", ptr %56, i64 %54
  %58 = call ptr @_ZNSt7__cxx114listISt4pairIiiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #6
  store ptr %58, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %59 = load ptr, ptr %20, align 8, !tbaa !20
  %60 = getelementptr inbounds %"class.std::__cxx11::list", ptr %59, i64 %54
  %61 = call ptr @_ZNSt7__cxx114listISt4pairIiiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #6
  store ptr %61, ptr %6, align 8
  %62 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br i1 %62, label %.lr.ph33, label %._crit_edge34

.lr.ph33:                                         ; preds = %.lr.ph35, %80
  %63 = call noundef ptr @_ZNKSt14_List_iteratorISt4pairIiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %64 = load i32, ptr %63, align 4, !tbaa !23
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i8, ptr %10, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !17, !range !27, !noundef !28
  %68 = icmp eq i8 %67, 0
  br i1 %68, label %69, label %80

69:                                               ; preds = %.lr.ph33
  %70 = call noundef ptr @_ZNKSt14_List_iteratorISt4pairIiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %71 = load i32, ptr %70, align 4, !tbaa !23
  %72 = call noundef ptr @_ZNKSt14_List_iteratorISt4pairIiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %73 = getelementptr inbounds i8, ptr %72, i64 4
  %74 = load i32, ptr %73, align 4, !tbaa !25
  %75 = load ptr, ptr %18, align 8, !tbaa !15
  %76 = getelementptr inbounds i32, ptr %75, i64 %54
  %77 = load i32, ptr %76, align 4, !tbaa !19
  %78 = add nsw i32 %77, %74
  %79 = call noundef i32 @_ZN5Graph6insertEii(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %71, i32 noundef %78)
  br label %80

80:                                               ; preds = %69, %.lr.ph33
  %81 = call ptr @_ZNSt14_List_iteratorISt4pairIiiEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %82 = load ptr, ptr %20, align 8, !tbaa !20
  %83 = getelementptr inbounds %"class.std::__cxx11::list", ptr %82, i64 %54
  %84 = call ptr @_ZNSt7__cxx114listISt4pairIiiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #6
  store ptr %84, ptr %6, align 8
  %85 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br i1 %85, label %.lr.ph33, label %._crit_edge34, !llvm.loop !29

._crit_edge34:                                    ; preds = %80, %.lr.ph35
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %86 = call noundef zeroext i1 @_ZNKSt6vectorIiSaIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #6
  br i1 %86, label %.preheader, label %.lr.ph35, !llvm.loop !30

._crit_edge39:                                    ; preds = %94, %.preheader
  %87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 0

.lr.ph38:                                         ; preds = %.lr.ph38.preheader, %94
  %88 = phi i32 [ %51, %.lr.ph38.preheader ], [ %95, %94 ]
  %indvars.iv41 = phi i64 [ 1, %.lr.ph38.preheader ], [ %indvars.iv.next42, %94 ]
  %.not26 = icmp eq i64 %indvars.iv41, %52
  br i1 %.not26, label %94, label %89

89:                                               ; preds = %.lr.ph38
  %90 = load ptr, ptr %18, align 8, !tbaa !15
  %91 = getelementptr inbounds i32, ptr %90, i64 %indvars.iv41
  %92 = load i32, ptr %91, align 4, !tbaa !19
  %93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %92)
  %.pre44 = load i32, ptr %0, align 8, !tbaa !5
  br label %94

94:                                               ; preds = %.lr.ph38, %89
  %95 = phi i32 [ %88, %.lr.ph38 ], [ %.pre44, %89 ]
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %96 = sext i32 %95 to i64
  %.not25.not = icmp slt i64 %indvars.iv41, %96
  br i1 %.not25.not, label %.lr.ph38, label %._crit_edge39, !llvm.loop !31
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5Graph6insertEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nobuiltin allocsize(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 = { nofree nounwind "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 = { builtin allocsize(0) }
attributes #6 = { 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, !7, i64 0}
!6 = !{!"_ZTS5Graph", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !10, i64 48}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTSSt6vectorIiSaIiEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!15 = !{!6, !10, i64 8}
!16 = !{!6, !10, i64 16}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !8, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!6, !10, i64 48}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !7, i64 0}
!24 = !{!"_ZTSSt4pairIiiE", !7, i64 0, !7, i64 4}
!25 = !{!24, !7, i64 4}
!26 = distinct !{!26, !22}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = distinct !{!29, !22}
!30 = distinct !{!30, !22}
!31 = distinct !{!31, !22}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass