; LLVM IR from xtaci/algorithms :: src (dijkstra_demo)

; 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::auto_ptr" = type { ptr }
%struct.list_head = type { ptr, ptr }
%"struct.alg::Graph::Adjacent" = type <{ %"struct.alg::Graph::Vertex", i32, i32, i32, [4 x i8], %struct.list_head, %struct.list_head, i32, [4 x i8] }>
%"struct.alg::Graph::Vertex" = type { i32, i32, %struct.list_head }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::auto_ptr", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call i64 @time(ptr noundef null) #7
  %11 = trunc i64 %10 to i32
  call void @srand(i32 noundef %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 10, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = call noundef ptr @_ZN3alg13DirectedGraph9randgraphEi(i32 noundef %12)
  call void @_ZNSt8auto_ptrIN3alg13DirectedGraphEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %13) #7
  %14 = call noundef ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  invoke void @_ZNK3alg5Graph8printdotEv(ptr noundef nonnull align 8 dereferenceable(36) %14)
          to label %15 unwind label %57

15:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %16 = invoke i32 (ptr, ...) @printf(ptr noundef @.str)
          to label %17 unwind label %61

17:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %18 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %19 = invoke noundef ptr @_ZN3alg8Dijkstra3runERKNS_5GraphEj(ptr noundef nonnull align 8 dereferenceable(36) %18, i32 noundef 1)
          to label %20 unwind label %65

20:                                               ; preds = %17
  store ptr %19, ptr %7, align 8, !tbaa !9
  %21 = call noundef ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %22 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3alg5Graph4listEv(ptr noundef nonnull align 8 dereferenceable(36) %21)
          to label %23 unwind label %65

23:                                               ; preds = %20
  %24 = getelementptr inbounds %struct.list_head, ptr %22, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  %26 = ptrtoint ptr %25 to i64
  %27 = sub i64 %26, ptrtoint (ptr getelementptr inbounds (%"struct.alg::Graph::Adjacent", ptr inttoptr (i64 1 to ptr), i32 0, i32 6) to i64)
  %28 = add nsw i64 %27, 1
  %29 = inttoptr i64 %28 to ptr
  store ptr %29, ptr %6, align 8, !tbaa !9
  br label %30

30:                                               ; preds = %78, %23
  %31 = load ptr, ptr %6, align 8, !tbaa !9
  %32 = getelementptr inbounds %"struct.alg::Graph::Adjacent", ptr %31, i32 0, i32 6
  %33 = call noundef ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %34 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3alg5Graph4listEv(ptr noundef nonnull align 8 dereferenceable(36) %33)
          to label %35 unwind label %65

35:                                               ; preds = %30
  %36 = icmp ne ptr %32, %34
  br i1 %36, label %37, label %87

37:                                               ; preds = %35
  %38 = load ptr, ptr %6, align 8, !tbaa !9
  %39 = getelementptr inbounds %"struct.alg::Graph::Adjacent", ptr %38, i32 0, i32 0
  %40 = getelementptr inbounds %"struct.alg::Graph::Vertex", ptr %39, i32 0, i32 0
  %41 = load i32, ptr %40, align 8, !tbaa !13
  %42 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %41)
          to label %43 unwind label %65

43:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %44 = load ptr, ptr %7, align 8, !tbaa !9
  %45 = load ptr, ptr %6, align 8, !tbaa !9
  %46 = getelementptr inbounds %"struct.alg::Graph::Adjacent", ptr %45, i32 0, i32 0
  %47 = getelementptr inbounds %"struct.alg::Graph::Vertex", ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !13
  %49 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3alg9HashTableIiiNS_9hash_codeIiEEEixEi(ptr noundef nonnull align 8 dereferenceable(24) %44, i32 noundef %48)
          to label %50 unwind label %69

50:                                               ; preds = %43
  %51 = load i32, ptr %49, align 4, !tbaa !5
  store i32 %51, ptr %8, align 4, !tbaa !5
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = icmp eq i32 %52, -1
  br i1 %53, label %54, label %73

54:                                               ; preds = %50
  %55 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2)
          to label %56 unwind label %69

56:                                               ; preds = %54
  br label %77

57:                                               ; preds = %0
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %4, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %5, align 4
  br label %159

61:                                               ; preds = %15
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %4, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %5, align 4
  br label %158

65:                                               ; preds = %113, %106, %96, %93, %91, %37, %30, %20, %17
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %4, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %5, align 4
  br label %157

69:                                               ; preds = %73, %54, %43
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %4, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %157

73:                                               ; preds = %50
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %74)
          to label %76 unwind label %69

76:                                               ; preds = %73
  br label %77

77:                                               ; preds = %76, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %78

78:                                               ; preds = %77
  %79 = load ptr, ptr %6, align 8, !tbaa !9
  %80 = getelementptr inbounds %"struct.alg::Graph::Adjacent", ptr %79, i32 0, i32 6
  %81 = getelementptr inbounds %struct.list_head, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !16
  %83 = ptrtoint ptr %82 to i64
  %84 = sub i64 %83, ptrtoint (ptr getelementptr inbounds (%"struct.alg::Graph::Adjacent", ptr inttoptr (i64 1 to ptr), i32 0, i32 6) to i64)
  %85 = add nsw i64 %84, 1
  %86 = inttoptr i64 %85 to ptr
  store ptr %86, ptr %6, align 8, !tbaa !9
  br label %30, !llvm.loop !17

87:                                               ; preds = %35
  %88 = load ptr, ptr %7, align 8, !tbaa !9
  %89 = icmp eq ptr %88, null
  br i1 %89, label %91, label %90

90:                                               ; preds = %87
  call void @_ZN3alg9HashTableIiiNS_9hash_codeIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %88) #7
  call void @_ZdlPvm(ptr noundef %88, i64 noundef 24) #8
  br label %91

91:                                               ; preds = %90, %87
  %92 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4)
          to label %93 unwind label %65

93:                                               ; preds = %91
  %94 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %95 = invoke noundef ptr @_ZN3alg8Dijkstra3runERKNS_5GraphEj(ptr noundef nonnull align 8 dereferenceable(36) %94, i32 noundef 2)
          to label %96 unwind label %65

96:                                               ; preds = %93
  store ptr %95, ptr %7, align 8, !tbaa !9
  %97 = call noundef ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %98 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3alg5Graph4listEv(ptr noundef nonnull align 8 dereferenceable(36) %97)
          to label %99 unwind label %65

99:                                               ; preds = %96
  %100 = getelementptr inbounds %struct.list_head, ptr %98, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8, !tbaa !11
  %102 = ptrtoint ptr %101 to i64
  %103 = sub i64 %102, ptrtoint (ptr getelementptr inbounds (%"struct.alg::Graph::Adjacent", ptr inttoptr (i64 1 to ptr), i32 0, i32 6) to i64)
  %104 = add nsw i64 %103, 1
  %105 = inttoptr i64 %104 to ptr
  store ptr %105, ptr %6, align 8, !tbaa !9
  br label %106

106:                                              ; preds = %142, %99
  %107 = load ptr, ptr %6, align 8, !tbaa !9
  %108 = getelementptr inbounds %"struct.alg::Graph::Adjacent", ptr %107, i32 0, i32 6
  %109 = call noundef ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %110 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3alg5Graph4listEv(ptr noundef nonnull align 8 dereferenceable(36) %109)
          to label %111 unwind label %65

111:                                              ; preds = %106
  %112 = icmp ne ptr %108, %110
  br i1 %112, label %113, label %151

113:                                              ; preds = %111
  %114 = load ptr, ptr %6, align 8, !tbaa !9
  %115 = getelementptr inbounds %"struct.alg::Graph::Adjacent", ptr %114, i32 0, i32 0
  %116 = getelementptr inbounds %"struct.alg::Graph::Vertex", ptr %115, i32 0, i32 0
  %117 = load i32, ptr %116, align 8, !tbaa !13
  %118 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %117)
          to label %119 unwind label %65

119:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %120 = load ptr, ptr %7, align 8, !tbaa !9
  %121 = load ptr, ptr %6, align 8, !tbaa !9
  %122 = getelementptr inbounds %"struct.alg::Graph::Adjacent", ptr %121, i32 0, i32 0
  %123 = getelementptr inbounds %"struct.alg::Graph::Vertex", ptr %122, i32 0, i32 0
  %124 = load i32, ptr %123, align 8, !tbaa !13
  %125 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3alg9HashTableIiiNS_9hash_codeIiEEEixEi(ptr noundef nonnull align 8 dereferenceable(24) %120, i32 noundef %124)
          to label %126 unwind label %133

126:                                              ; preds = %119
  %127 = load i32, ptr %125, align 4, !tbaa !5
  store i32 %127, ptr %9, align 4, !tbaa !5
  %128 = load i32, ptr %9, align 4, !tbaa !5
  %129 = icmp eq i32 %128, -1
  br i1 %129, label %130, label %137

130:                                              ; preds = %126
  %131 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2)
          to label %132 unwind label %133

132:                                              ; preds = %130
  br label %141

133:                                              ; preds = %137, %130, %119
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %4, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %157

137:                                              ; preds = %126
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %138)
          to label %140 unwind label %133

140:                                              ; preds = %137
  br label %141

141:                                              ; preds = %140, %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %142

142:                                              ; preds = %141
  %143 = load ptr, ptr %6, align 8, !tbaa !9
  %144 = getelementptr inbounds %"struct.alg::Graph::Adjacent", ptr %143, i32 0, i32 6
  %145 = getelementptr inbounds %struct.list_head, ptr %144, i32 0, i32 0
  %146 = load ptr, ptr %145, align 8, !tbaa !16
  %147 = ptrtoint ptr %146 to i64
  %148 = sub i64 %147, ptrtoint (ptr getelementptr inbounds (%"struct.alg::Graph::Adjacent", ptr inttoptr (i64 1 to ptr), i32 0, i32 6) to i64)
  %149 = add nsw i64 %148, 1
  %150 = inttoptr i64 %149 to ptr
  store ptr %150, ptr %6, align 8, !tbaa !9
  br label %106, !llvm.loop !19

151:                                              ; preds = %111
  %152 = load ptr, ptr %7, align 8, !tbaa !9
  %153 = icmp eq ptr %152, null
  br i1 %153, label %155, label %154

154:                                              ; preds = %151
  call void @_ZN3alg9HashTableIiiNS_9hash_codeIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %152) #7
  call void @_ZdlPvm(ptr noundef %152, i64 noundef 24) #8
  br label %155

155:                                              ; preds = %154, %151
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @_ZNSt8auto_ptrIN3alg13DirectedGraphEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %156 = load i32, ptr %1, align 4
  ret i32 %156

157:                                              ; preds = %133, %69, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %158

158:                                              ; preds = %157, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %159

159:                                              ; preds = %158, %57
  call void @_ZNSt8auto_ptrIN3alg13DirectedGraphEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %160

160:                                              ; preds = %159
  %161 = load ptr, ptr %4, align 8
  %162 = load i32, ptr %5, align 4
  %163 = insertvalue { ptr, i32 } poison, ptr %161, 0
  %164 = insertvalue { ptr, i32 } %163, i32 %162, 1
  resume { ptr, i32 } %164
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) #1

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3alg13DirectedGraph9randgraphEi(i32 noundef) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3alg5Graph8printdotEv(ptr noundef nonnull align 8 dereferenceable(36)) #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3alg9HashTableIiiNS_9hash_codeIiEEEixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #3 align 2

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #6

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

attributes #0 = { mustprogress norecurse 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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 = { "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 #6 = { nobuiltin 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 #7 = { nounwind }
attributes #8 = { builtin 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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS9list_head", !10, i64 0, !10, i64 8}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSN3alg5Graph8AdjacentE", !15, i64 0, !6, i64 24, !6, i64 28, !6, i64 32, !12, i64 40, !12, i64 56, !6, i64 72}
!15 = !{!"_ZTSN3alg5Graph6VertexE", !6, i64 0, !6, i64 4, !12, i64 8}
!16 = !{!14, !10, i64 56}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


; 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::auto_ptr" = type { ptr }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::auto_ptr", align 8
  %2 = tail call i64 @time(ptr noundef null) #7
  %3 = trunc i64 %2 to i32
  tail call void @srand(i32 noundef %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %4 = tail call noundef ptr @_ZN3alg13DirectedGraph9randgraphEi(i32 noundef 10)
  call void @_ZNSt8auto_ptrIN3alg13DirectedGraphEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %4) #7
  %5 = call noundef ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  invoke void @_ZNK3alg5Graph8printdotEv(ptr noundef nonnull align 8 dereferenceable(36) %5)
          to label %6 unwind label %26

6:                                                ; preds = %0
  %7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %8 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %9 = invoke noundef ptr @_ZN3alg8Dijkstra3runERKNS_5GraphEj(ptr noundef nonnull align 8 dereferenceable(36) %8, i32 noundef 1)
          to label %10 unwind label %28

10:                                               ; preds = %6
  %11 = call noundef ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3alg5Graph4listEv(ptr noundef nonnull align 8 dereferenceable(36) %11)
  %.019.in.in.in32 = load ptr, ptr %12, align 8, !tbaa !5
  %.019.in.in33 = ptrtoint ptr %.019.in.in.in32 to i64
  %.019.in34 = add i64 %.019.in.in33, -56
  %.01935 = inttoptr i64 %.019.in34 to ptr
  %13 = getelementptr inbounds i8, ptr %.01935, i64 56
  %14 = call noundef ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3alg5Graph4listEv(ptr noundef nonnull align 8 dereferenceable(36) %14)
  %.not36 = icmp eq ptr %13, %15
  br i1 %.not36, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %10, %34
  %16 = phi ptr [ %35, %34 ], [ %13, %10 ]
  %.01937 = phi ptr [ %.019, %34 ], [ %.01935, %10 ]
  %17 = load i32, ptr %.01937, align 8, !tbaa !10
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17)
  %19 = load i32, ptr %.01937, align 8, !tbaa !10
  %20 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3alg9HashTableIiiNS_9hash_codeIiEEEixEi(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %19)
          to label %21 unwind label %30

21:                                               ; preds = %.lr.ph
  %22 = load i32, ptr %20, align 4, !tbaa !14
  %23 = icmp eq i32 %22, -1
  br i1 %23, label %24, label %32

24:                                               ; preds = %21
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %34

26:                                               ; preds = %0
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %71

28:                                               ; preds = %40, %6
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %71

30:                                               ; preds = %.lr.ph
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %71

32:                                               ; preds = %21
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %22)
  br label %34

34:                                               ; preds = %32, %24
  %.019.in.in.in = load ptr, ptr %16, align 8, !tbaa !5
  %.019.in.in = ptrtoint ptr %.019.in.in.in to i64
  %.019.in = add i64 %.019.in.in, -56
  %.019 = inttoptr i64 %.019.in to ptr
  %35 = getelementptr inbounds i8, ptr %.019, i64 56
  %36 = call noundef ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3alg5Graph4listEv(ptr noundef nonnull align 8 dereferenceable(36) %36)
  %.not = icmp eq ptr %35, %37
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %34, %10
  %38 = icmp eq ptr %9, null
  br i1 %38, label %40, label %39

39:                                               ; preds = %._crit_edge
  call void @_ZN3alg9HashTableIiiNS_9hash_codeIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @_ZdlPvm(ptr noundef nonnull %9, i64 noundef 24) #8
  br label %40

40:                                               ; preds = %39, %._crit_edge
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %42 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %43 = invoke noundef ptr @_ZN3alg8Dijkstra3runERKNS_5GraphEj(ptr noundef nonnull align 8 dereferenceable(36) %42, i32 noundef 2)
          to label %44 unwind label %28

44:                                               ; preds = %40
  %45 = call noundef ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3alg5Graph4listEv(ptr noundef nonnull align 8 dereferenceable(36) %45)
  %.120.in.in.in38 = load ptr, ptr %46, align 8, !tbaa !5
  %.120.in.in39 = ptrtoint ptr %.120.in.in.in38 to i64
  %.120.in40 = add i64 %.120.in.in39, -56
  %.12041 = inttoptr i64 %.120.in40 to ptr
  %47 = getelementptr inbounds i8, ptr %.12041, i64 56
  %48 = call noundef ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3alg5Graph4listEv(ptr noundef nonnull align 8 dereferenceable(36) %48)
  %.not2942 = icmp eq ptr %47, %49
  br i1 %.not2942, label %._crit_edge46, label %.lr.ph45

.lr.ph45:                                         ; preds = %44, %64
  %50 = phi ptr [ %65, %64 ], [ %47, %44 ]
  %.12043 = phi ptr [ %.120, %64 ], [ %.12041, %44 ]
  %51 = load i32, ptr %.12043, align 8, !tbaa !10
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %51)
  %53 = load i32, ptr %.12043, align 8, !tbaa !10
  %54 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3alg9HashTableIiiNS_9hash_codeIiEEEixEi(ptr noundef nonnull align 8 dereferenceable(24) %43, i32 noundef %53)
          to label %55 unwind label %60

55:                                               ; preds = %.lr.ph45
  %56 = load i32, ptr %54, align 4, !tbaa !14
  %57 = icmp eq i32 %56, -1
  br i1 %57, label %58, label %62

58:                                               ; preds = %55
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %64

60:                                               ; preds = %.lr.ph45
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %71

62:                                               ; preds = %55
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %56)
  br label %64

64:                                               ; preds = %62, %58
  %.120.in.in.in = load ptr, ptr %50, align 8, !tbaa !5
  %.120.in.in = ptrtoint ptr %.120.in.in.in to i64
  %.120.in = add i64 %.120.in.in, -56
  %.120 = inttoptr i64 %.120.in to ptr
  %65 = getelementptr inbounds i8, ptr %.120, i64 56
  %66 = call noundef ptr @_ZNKSt8auto_ptrIN3alg13DirectedGraphEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3alg5Graph4listEv(ptr noundef nonnull align 8 dereferenceable(36) %66)
  %.not29 = icmp eq ptr %65, %67
  br i1 %.not29, label %._crit_edge46, label %.lr.ph45, !llvm.loop !17

._crit_edge46:                                    ; preds = %64, %44
  %68 = icmp eq ptr %43, null
  br i1 %68, label %70, label %69

69:                                               ; preds = %._crit_edge46
  call void @_ZN3alg9HashTableIiiNS_9hash_codeIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %43) #7
  call void @_ZdlPvm(ptr noundef nonnull %43, i64 noundef 24) #8
  br label %70

70:                                               ; preds = %69, %._crit_edge46
  call void @_ZNSt8auto_ptrIN3alg13DirectedGraphEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

71:                                               ; preds = %28, %30, %60, %26
  %.pn.pn = phi { ptr, i32 } [ %27, %26 ], [ %31, %30 ], [ %61, %60 ], [ %29, %28 ]
  call void @_ZNSt8auto_ptrIN3alg13DirectedGraphEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3alg13DirectedGraph9randgraphEi(i32 noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3alg5Graph8printdotEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3alg9HashTableIiiNS_9hash_codeIiEEEixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #6

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

attributes #0 = { mustprogress norecurse 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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 = { 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 #6 = { nobuiltin 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 #7 = { nounwind }
attributes #8 = { builtin 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 = !{!"_ZTS9list_head", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !13, i64 0}
!11 = !{!"_ZTSN3alg5Graph8AdjacentE", !12, i64 0, !13, i64 24, !13, i64 28, !13, i64 32, !6, i64 40, !6, i64 56, !13, i64 72}
!12 = !{!"_ZTSN3alg5Graph6VertexE", !13, i64 0, !13, i64 4, !6, i64 8}
!13 = !{!"int", !8, i64 0}
!14 = !{!13, !13, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


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