; LLVM IR from UtkarshPathrabe/Competitive-Coding :: Model Algorithms/Greedy Algorithms/Prims Minimum Spanning Tree for Adjacency List.l_695c7cff (Z7PrimMSTP5Graph)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%struct.Graph = type { i32, ptr }
%struct.MinHeap = type { i32, i32, ptr, ptr }
%struct.MinHeapNode = type { i32, i32 }
%struct.AdjList = type { ptr }
%struct.AdjListNode = type { i32, i32, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [21 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: 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 @_Z14newMinHeapNodeii(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z13createMinHeapi(i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7isEmptyP7MinHeap(ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z10extractMinP7MinHeap(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11decreaseKeyP7MinHeapii(ptr noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z11isInMinHeapP7MinHeapi(ptr noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8printArrPii(ptr noundef, i32 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7PrimMSTP5Graph(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.Graph, ptr %13, i32 0, i32 0
  %15 = load i32, ptr %14, align 8, !tbaa !9
  store i32 %15, ptr %3, align 4, !tbaa !12
  %16 = load i32, ptr %3, align 4, !tbaa !12
  %17 = zext i32 %16 to i64
  %18 = call ptr @llvm.stacksave.p0()
  store ptr %18, ptr %4, align 8
  %19 = alloca i32, i64 %17, align 16
  store i64 %17, ptr %5, align 8
  %20 = load i32, ptr %3, align 4, !tbaa !12
  %21 = zext i32 %20 to i64
  %22 = alloca i32, i64 %21, align 16
  store i64 %21, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %23 = load i32, ptr %3, align 4, !tbaa !12
  %24 = call noundef ptr @_Z13createMinHeapi(i32 noundef %23)
  store ptr %24, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !12
  br label %25

25:                                               ; preds = %56, %1
  %26 = load i32, ptr %8, align 4, !tbaa !12
  %27 = load i32, ptr %3, align 4, !tbaa !12
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %25
  %31 = load i32, ptr %8, align 4, !tbaa !12
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr %19, i64 %32
  store i32 -1, ptr %33, align 4, !tbaa !12
  %34 = load i32, ptr %8, align 4, !tbaa !12
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i32, ptr %22, i64 %35
  store i32 2147483647, ptr %36, align 4, !tbaa !12
  %37 = load i32, ptr %8, align 4, !tbaa !12
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.MinHeap, ptr %38, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !13
  %41 = load i32, ptr %8, align 4, !tbaa !12
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %40, i64 %42
  store i32 %37, ptr %43, align 4, !tbaa !12
  %44 = load i32, ptr %8, align 4, !tbaa !12
  %45 = load i32, ptr %8, align 4, !tbaa !12
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %22, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !12
  %49 = call noundef ptr @_Z14newMinHeapNodeii(i32 noundef %44, i32 noundef %48)
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.MinHeap, ptr %50, i32 0, i32 3
  %52 = load ptr, ptr %51, align 8, !tbaa !15
  %53 = load i32, ptr %8, align 4, !tbaa !12
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds ptr, ptr %52, i64 %54
  store ptr %49, ptr %55, align 8, !tbaa !5
  br label %56

56:                                               ; preds = %30
  %57 = load i32, ptr %8, align 4, !tbaa !12
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %8, align 4, !tbaa !12
  br label %25, !llvm.loop !16

59:                                               ; preds = %29
  %60 = getelementptr inbounds i32, ptr %22, i64 0
  store i32 0, ptr %60, align 16, !tbaa !12
  %61 = getelementptr inbounds i32, ptr %22, i64 0
  %62 = load i32, ptr %61, align 16, !tbaa !12
  %63 = call noundef ptr @_Z14newMinHeapNodeii(i32 noundef 0, i32 noundef %62)
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.MinHeap, ptr %64, i32 0, i32 3
  %66 = load ptr, ptr %65, align 8, !tbaa !15
  %67 = getelementptr inbounds ptr, ptr %66, i64 0
  store ptr %63, ptr %67, align 8, !tbaa !5
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.MinHeap, ptr %68, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !13
  %71 = getelementptr inbounds i32, ptr %70, i64 0
  store i32 0, ptr %71, align 4, !tbaa !12
  %72 = load i32, ptr %3, align 4, !tbaa !12
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.MinHeap, ptr %73, i32 0, i32 0
  store i32 %72, ptr %74, align 8, !tbaa !18
  br label %75

75:                                               ; preds = %133, %59
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = call noundef zeroext i1 @_Z7isEmptyP7MinHeap(ptr noundef %76)
  %78 = xor i1 %77, true
  br i1 %78, label %79, label %134

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = call noundef ptr @_Z10extractMinP7MinHeap(ptr noundef %80)
  store ptr %81, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.MinHeapNode, ptr %82, i32 0, i32 0
  %84 = load i32, ptr %83, align 4, !tbaa !19
  store i32 %84, ptr %10, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.Graph, ptr %85, i32 0, i32 1
  %87 = load ptr, ptr %86, align 8, !tbaa !21
  %88 = load i32, ptr %10, align 4, !tbaa !12
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds %struct.AdjList, ptr %87, i64 %89
  %91 = getelementptr inbounds %struct.AdjList, ptr %90, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !22
  store ptr %92, ptr %11, align 8, !tbaa !5
  br label %93

93:                                               ; preds = %129, %79
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = icmp ne ptr %94, null
  br i1 %95, label %96, label %133

96:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.AdjListNode, ptr %97, i32 0, i32 0
  %99 = load i32, ptr %98, align 8, !tbaa !24
  store i32 %99, ptr %12, align 4, !tbaa !12
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = load i32, ptr %12, align 4, !tbaa !12
  %102 = call noundef zeroext i1 @_Z11isInMinHeapP7MinHeapi(ptr noundef %100, i32 noundef %101)
  br i1 %102, label %103, label %129

103:                                              ; preds = %96
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.AdjListNode, ptr %104, i32 0, i32 1
  %106 = load i32, ptr %105, align 4, !tbaa !26
  %107 = load i32, ptr %12, align 4, !tbaa !12
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds i32, ptr %22, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !12
  %111 = icmp slt i32 %106, %110
  br i1 %111, label %112, label %129

112:                                              ; preds = %103
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.AdjListNode, ptr %113, i32 0, i32 1
  %115 = load i32, ptr %114, align 4, !tbaa !26
  %116 = load i32, ptr %12, align 4, !tbaa !12
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %22, i64 %117
  store i32 %115, ptr %118, align 4, !tbaa !12
  %119 = load i32, ptr %10, align 4, !tbaa !12
  %120 = load i32, ptr %12, align 4, !tbaa !12
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds i32, ptr %19, i64 %121
  store i32 %119, ptr %122, align 4, !tbaa !12
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = load i32, ptr %12, align 4, !tbaa !12
  %125 = load i32, ptr %12, align 4, !tbaa !12
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %22, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !12
  call void @_Z11decreaseKeyP7MinHeapii(ptr noundef %123, i32 noundef %124, i32 noundef %128)
  br label %129

129:                                              ; preds = %112, %103, %96
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.AdjListNode, ptr %130, i32 0, i32 2
  %132 = load ptr, ptr %131, align 8, !tbaa !27
  store ptr %132, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %93, !llvm.loop !28

133:                                              ; preds = %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %75, !llvm.loop !29

134:                                              ; preds = %75
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %135, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %137 = load i32, ptr %3, align 4, !tbaa !12
  call void @_Z8printArrPii(ptr noundef %19, i32 noundef %137)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %138 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %138)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { inlinehint 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 = { nocallback nofree nosync nounwind willreturn }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS5Graph", !11, i64 0, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !6, i64 8}
!14 = !{!"_ZTS7MinHeap", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!15 = !{!14, !6, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!14, !11, i64 0}
!19 = !{!20, !11, i64 0}
!20 = !{!"_ZTS11MinHeapNode", !11, i64 0, !11, i64 4}
!21 = !{!10, !6, i64 8}
!22 = !{!23, !6, i64 0}
!23 = !{!"_ZTS7AdjList", !6, i64 0}
!24 = !{!25, !11, i64 0}
!25 = !{!"_ZTS11AdjListNode", !11, i64 0, !11, i64 4, !6, i64 8}
!26 = !{!25, !11, i64 4}
!27 = !{!25, !6, i64 8}
!28 = distinct !{!28, !17}
!29 = distinct !{!29, !17}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%struct.AdjList = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z14newMinHeapNodeii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z13createMinHeapi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7isEmptyP7MinHeap(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z10extractMinP7MinHeap(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11decreaseKeyP7MinHeapii(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z11isInMinHeapP7MinHeapi(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8printArrPii(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7PrimMSTP5Graph(ptr nocapture noundef readonly %0) local_unnamed_addr #1 {
  %2 = load i32, ptr %0, align 8, !tbaa !5
  %3 = zext i32 %2 to i64
  %4 = alloca i32, i64 %3, align 16
  %5 = alloca i32, i64 %3, align 16
  %6 = tail call noundef ptr @_Z13createMinHeapi(i32 noundef %2)
  %7 = icmp sgt i32 %2, 1
  br i1 %7, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %8 = getelementptr inbounds i8, ptr %6, i64 8
  %9 = getelementptr inbounds i8, ptr %6, i64 16
  br label %17

._crit_edge:                                      ; preds = %17, %1
  store i32 0, ptr %5, align 16, !tbaa !11
  %10 = tail call noundef ptr @_Z14newMinHeapNodeii(i32 noundef 0, i32 noundef 0)
  %11 = getelementptr inbounds i8, ptr %6, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !12
  store ptr %10, ptr %12, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %6, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  store i32 0, ptr %14, align 4, !tbaa !11
  store i32 %2, ptr %6, align 8, !tbaa !16
  %15 = tail call noundef zeroext i1 @_Z7isEmptyP7MinHeap(ptr noundef nonnull %6)
  br i1 %15, label %._crit_edge51, label %.lr.ph50

.lr.ph50:                                         ; preds = %._crit_edge
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  br label %27

17:                                               ; preds = %.lr.ph, %17
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %17 ]
  %18 = getelementptr inbounds i32, ptr %4, i64 %indvars.iv
  store i32 -1, ptr %18, align 4, !tbaa !11
  %19 = getelementptr inbounds i32, ptr %5, i64 %indvars.iv
  store i32 2147483647, ptr %19, align 4, !tbaa !11
  %20 = load ptr, ptr %8, align 8, !tbaa !15
  %21 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv
  %22 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %22, ptr %21, align 4, !tbaa !11
  %23 = tail call noundef ptr @_Z14newMinHeapNodeii(i32 noundef %22, i32 noundef 2147483647)
  %24 = load ptr, ptr %9, align 8, !tbaa !12
  %25 = getelementptr inbounds ptr, ptr %24, i64 %indvars.iv
  store ptr %23, ptr %25, align 8, !tbaa !14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %3
  br i1 %exitcond.not, label %._crit_edge, label %17, !llvm.loop !17

.loopexit:                                        ; preds = %44, %27
  %26 = tail call noundef zeroext i1 @_Z7isEmptyP7MinHeap(ptr noundef nonnull %6)
  br i1 %26, label %._crit_edge51, label %27, !llvm.loop !19

27:                                               ; preds = %.lr.ph50, %.loopexit
  %28 = tail call noundef ptr @_Z10extractMinP7MinHeap(ptr noundef nonnull %6)
  %29 = load i32, ptr %28, align 4, !tbaa !20
  %30 = load ptr, ptr %16, align 8, !tbaa !22
  %31 = sext i32 %29 to i64
  %32 = getelementptr inbounds %struct.AdjList, ptr %30, i64 %31
  %.04044 = load ptr, ptr %32, align 8, !tbaa !14
  %.not45 = icmp eq ptr %.04044, null
  br i1 %.not45, label %.loopexit, label %.lr.ph48

.lr.ph48:                                         ; preds = %27, %44
  %.04046 = phi ptr [ %.040, %44 ], [ %.04044, %27 ]
  %33 = load i32, ptr %.04046, align 8, !tbaa !23
  %34 = tail call noundef zeroext i1 @_Z11isInMinHeapP7MinHeapi(ptr noundef nonnull %6, i32 noundef %33)
  br i1 %34, label %35, label %44

35:                                               ; preds = %.lr.ph48
  %36 = getelementptr inbounds i8, ptr %.04046, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !25
  %38 = sext i32 %33 to i64
  %39 = getelementptr inbounds i32, ptr %5, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !11
  %41 = icmp slt i32 %37, %40
  br i1 %41, label %42, label %44

42:                                               ; preds = %35
  store i32 %37, ptr %39, align 4, !tbaa !11
  %43 = getelementptr inbounds i32, ptr %4, i64 %38
  store i32 %29, ptr %43, align 4, !tbaa !11
  tail call void @_Z11decreaseKeyP7MinHeapii(ptr noundef nonnull %6, i32 noundef %33, i32 noundef %37)
  br label %44

44:                                               ; preds = %42, %35, %.lr.ph48
  %45 = getelementptr inbounds i8, ptr %.04046, i64 8
  %.040 = load ptr, ptr %45, align 8, !tbaa !14
  %.not = icmp eq ptr %.040, null
  br i1 %.not, label %.loopexit, label %.lr.ph48, !llvm.loop !26

._crit_edge51:                                    ; preds = %.loopexit, %._crit_edge
  %46 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %47 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @_Z8printArrPii(ptr noundef nonnull %4, i32 noundef %2)
  ret void
}

attributes #0 = { 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 #1 = { 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 #2 = { inlinehint 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" }

!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}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !10, i64 16}
!13 = !{!"_ZTS7MinHeap", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16}
!14 = !{!10, !10, i64 0}
!15 = !{!13, !10, i64 8}
!16 = !{!13, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!21, !7, i64 0}
!21 = !{!"_ZTS11MinHeapNode", !7, i64 0, !7, i64 4}
!22 = !{!6, !10, i64 8}
!23 = !{!24, !7, i64 0}
!24 = !{!"_ZTS11AdjListNode", !7, i64 0, !7, i64 4, !10, i64 8}
!25 = !{!24, !7, i64 4}
!26 = distinct !{!26, !18}


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