; LLVM IR from UtkarshPathrabe/Competitive-Coding :: Model Algorithms/Minimum Spanning Tree/Prims MST for Adjacency List Representation._a85f6e00 (Z4Primv)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<HeapNodes, std::allocator<HeapNodes>>::_Vector_impl" }
%"struct.std::_Vector_base<HeapNodes, std::allocator<HeapNodes>>::_Vector_impl" = type { %"struct.std::_Vector_base<HeapNodes, std::allocator<HeapNodes>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HeapNodes, std::allocator<HeapNodes>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl" }
%"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl" = type { %"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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.HeapNodes = type { i32, i32 }
%struct.Edges = type { i32, i32, i32 }

@HeapNode = external dso_local global %"class.std::vector", align 8
@Node = external dso_local global %"class.std::vector.0", align 8
@Edge = external dso_local global %"class.std::vector.5", align 8
@Key = external dso_local global %"class.std::vector.0", align 8
@Parent = external dso_local global %"class.std::vector.0", align 8
@V = external dso_local global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.7 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.8 = 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; 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 i32 @_Z6LengthRSt6vectorI9HeapNodesSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24)) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z18HeapExtractMinimumRSt6vectorI9HeapNodesSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24)) #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4Primv() #3 {
  %1 = alloca %struct.HeapNodes, align 4
  %2 = alloca %struct.HeapNodes, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  %5 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Key, i64 noundef 0) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  %6 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Key, i64 noundef 0) #6
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI9HeapNodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @HeapNode, i64 noundef 0) #6
  %9 = getelementptr inbounds %struct.HeapNodes, ptr %8, i32 0, i32 1
  store i32 %7, ptr %9, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %88, %0
  %11 = call noundef i32 @_Z6LengthRSt6vectorI9HeapNodesSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24) @HeapNode)
  %12 = icmp ne i32 %11, 0
  br i1 %12, label %13, label %89

13:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %14 = call i64 @_Z18HeapExtractMinimumRSt6vectorI9HeapNodesSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24) @HeapNode)
  store i64 %14, ptr %2, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %1, ptr align 4 %2, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %15 = getelementptr inbounds %struct.HeapNodes, ptr %1, i32 0, i32 0
  %16 = load i32, ptr %15, align 4, !tbaa !12
  %17 = sext i32 %16 to i64
  %18 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef %17) #6
  %19 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %19, ptr %3, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %82, %13
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = icmp ne i32 %21, -1
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %88

24:                                               ; preds = %20
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %26) #6
  %28 = getelementptr inbounds %struct.Edges, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 4, !tbaa !13
  %30 = call noundef zeroext i1 @_Z11IsInMinHeapRSt6vectorI9HeapNodesSaIS0_EEi(ptr noundef nonnull align 8 dereferenceable(24) @HeapNode, i32 noundef %29)
  br i1 %30, label %31, label %81

31:                                               ; preds = %24
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %33) #6
  %35 = getelementptr inbounds %struct.Edges, ptr %34, i32 0, i32 1
  %36 = load i32, ptr %35, align 4, !tbaa !15
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %38) #6
  %40 = getelementptr inbounds %struct.Edges, ptr %39, i32 0, i32 0
  %41 = load i32, ptr %40, align 4, !tbaa !13
  %42 = sext i32 %41 to i64
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Key, i64 noundef %42) #6
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = icmp slt i32 %36, %44
  br i1 %45, label %46, label %81

46:                                               ; preds = %31
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %48) #6
  %50 = getelementptr inbounds %struct.Edges, ptr %49, i32 0, i32 1
  %51 = load i32, ptr %50, align 4, !tbaa !15
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %53) #6
  %55 = getelementptr inbounds %struct.Edges, ptr %54, i32 0, i32 0
  %56 = load i32, ptr %55, align 4, !tbaa !13
  %57 = sext i32 %56 to i64
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Key, i64 noundef %57) #6
  store i32 %51, ptr %58, align 4, !tbaa !5
  %59 = getelementptr inbounds %struct.HeapNodes, ptr %1, i32 0, i32 0
  %60 = load i32, ptr %59, align 4, !tbaa !12
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %62) #6
  %64 = getelementptr inbounds %struct.Edges, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 4, !tbaa !13
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Parent, i64 noundef %66) #6
  store i32 %60, ptr %67, align 4, !tbaa !5
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %69) #6
  %71 = getelementptr inbounds %struct.Edges, ptr %70, i32 0, i32 0
  %72 = load i32, ptr %71, align 4, !tbaa !13
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %74) #6
  %76 = getelementptr inbounds %struct.Edges, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !13
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Key, i64 noundef %78) #6
  %80 = load i32, ptr %79, align 4, !tbaa !5
  call void @_Z15HeapDecreaseKeyRSt6vectorI9HeapNodesSaIS0_EEii(ptr noundef nonnull align 8 dereferenceable(24) @HeapNode, i32 noundef %72, i32 noundef %80)
  br label %81

81:                                               ; preds = %46, %31, %24
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %84) #6
  %86 = getelementptr inbounds %struct.Edges, ptr %85, i32 0, i32 2
  %87 = load i32, ptr %86, align 4, !tbaa !16
  store i32 %87, ptr %3, align 4, !tbaa !5
  br label %20, !llvm.loop !17

88:                                               ; preds = %23
  br label %10, !llvm.loop !19

89:                                               ; preds = %10
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.7)
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %115, %89
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = load i32, ptr @V, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %118

97:                                               ; preds = %92
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Parent, i64 noundef %99) #6
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %102)
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef @.str.8)
  %105 = load i32, ptr %4, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %104, i32 noundef %106)
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %107, ptr noundef @.str.8)
  %109 = load i32, ptr %4, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Key, i64 noundef %110) #6
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %108, i32 noundef %112)
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %113, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %115

115:                                              ; preds = %97
  %116 = load i32, ptr %4, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %4, align 4, !tbaa !5
  br label %92, !llvm.loop !20

118:                                              ; preds = %96
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 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) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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)) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #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 = { 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, !6, i64 4}
!10 = !{!"_ZTS9HeapNodes", !6, i64 0, !6, i64 4}
!11 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!12 = !{!10, !6, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS5Edges", !6, i64 0, !6, i64 4, !6, i64 8}
!15 = !{!14, !6, i64 4}
!16 = !{!14, !6, i64 8}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<HeapNodes, std::allocator<HeapNodes>>::_Vector_impl" }
%"struct.std::_Vector_base<HeapNodes, std::allocator<HeapNodes>>::_Vector_impl" = type { %"struct.std::_Vector_base<HeapNodes, std::allocator<HeapNodes>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HeapNodes, std::allocator<HeapNodes>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl" }
%"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl" = type { %"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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 }

@HeapNode = external dso_local global %"class.std::vector", align 8
@Node = external dso_local global %"class.std::vector.0", align 8
@Edge = external dso_local global %"class.std::vector.5", align 8
@Key = external dso_local global %"class.std::vector.0", align 8
@Parent = external dso_local global %"class.std::vector.0", align 8
@V = external dso_local local_unnamed_addr global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.7 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z11IsInMinHeapRSt6vectorI9HeapNodesSaIS0_EEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z15HeapDecreaseKeyRSt6vectorI9HeapNodesSaIS0_EEii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4Primv() local_unnamed_addr #1 {
  %1 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Key, i64 noundef 0) #4
  store i32 0, ptr %1, align 4, !tbaa !5
  %2 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Key, i64 noundef 0) #4
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI9HeapNodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @HeapNode, i64 noundef 0) #4
  %5 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 %3, ptr %5, align 4, !tbaa !9
  %6 = tail call noundef i32 @_Z6LengthRSt6vectorI9HeapNodesSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24) @HeapNode)
  %.not22 = icmp eq i32 %6, 0
  br i1 %.not22, label %._crit_edge, label %.lr.ph23

.loopexit:                                        ; preds = %44, %.lr.ph23
  %7 = tail call noundef i32 @_Z6LengthRSt6vectorI9HeapNodesSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24) @HeapNode)
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph23, !llvm.loop !11

.lr.ph23:                                         ; preds = %0, %.loopexit
  %8 = tail call i64 @_Z18HeapExtractMinimumRSt6vectorI9HeapNodesSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24) @HeapNode)
  %.sroa.015.0.extract.trunc = trunc i64 %8 to i32
  %sext = shl i64 %8, 32
  %9 = ashr exact i64 %sext, 32
  %10 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef %9) #4
  %.01719 = load i32, ptr %10, align 4, !tbaa !5
  %.not1820 = icmp eq i32 %.01719, -1
  br i1 %.not1820, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph23, %44
  %.01721 = phi i32 [ %.017, %44 ], [ %.01719, %.lr.ph23 ]
  %11 = sext i32 %.01721 to i64
  %12 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %11) #4
  %13 = load i32, ptr %12, align 4, !tbaa !13
  %14 = tail call noundef zeroext i1 @_Z11IsInMinHeapRSt6vectorI9HeapNodesSaIS0_EEi(ptr noundef nonnull align 8 dereferenceable(24) @HeapNode, i32 noundef %13)
  br i1 %14, label %15, label %44

15:                                               ; preds = %.lr.ph
  %16 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %11) #4
  %17 = getelementptr inbounds i8, ptr %16, i64 4
  %18 = load i32, ptr %17, align 4, !tbaa !15
  %19 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %11) #4
  %20 = load i32, ptr %19, align 4, !tbaa !13
  %21 = sext i32 %20 to i64
  %22 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Key, i64 noundef %21) #4
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = icmp slt i32 %18, %23
  br i1 %24, label %25, label %44

25:                                               ; preds = %15
  %26 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %11) #4
  %27 = getelementptr inbounds i8, ptr %26, i64 4
  %28 = load i32, ptr %27, align 4, !tbaa !15
  %29 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %11) #4
  %30 = load i32, ptr %29, align 4, !tbaa !13
  %31 = sext i32 %30 to i64
  %32 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Key, i64 noundef %31) #4
  store i32 %28, ptr %32, align 4, !tbaa !5
  %33 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %11) #4
  %34 = load i32, ptr %33, align 4, !tbaa !13
  %35 = sext i32 %34 to i64
  %36 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Parent, i64 noundef %35) #4
  store i32 %.sroa.015.0.extract.trunc, ptr %36, align 4, !tbaa !5
  %37 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %11) #4
  %38 = load i32, ptr %37, align 4, !tbaa !13
  %39 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %11) #4
  %40 = load i32, ptr %39, align 4, !tbaa !13
  %41 = sext i32 %40 to i64
  %42 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Key, i64 noundef %41) #4
  %43 = load i32, ptr %42, align 4, !tbaa !5
  tail call void @_Z15HeapDecreaseKeyRSt6vectorI9HeapNodesSaIS0_EEii(ptr noundef nonnull align 8 dereferenceable(24) @HeapNode, i32 noundef %38, i32 noundef %43)
  br label %44

44:                                               ; preds = %.lr.ph, %15, %25
  %45 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %11) #4
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  %.017 = load i32, ptr %46, align 4, !tbaa !5
  %.not18 = icmp eq i32 %.017, -1
  br i1 %.not18, label %.loopexit, label %.lr.ph, !llvm.loop !16

._crit_edge:                                      ; preds = %.loopexit, %0
  %47 = 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.7)
  %48 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %49 = load i32, ptr @V, align 4, !tbaa !5
  %50 = icmp sgt i32 %49, 1
  br i1 %50, label %.lr.ph26, label %._crit_edge27

._crit_edge27:                                    ; preds = %.lr.ph26, %._crit_edge
  %51 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret void

.lr.ph26:                                         ; preds = %._crit_edge, %.lr.ph26
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph26 ], [ 1, %._crit_edge ]
  %52 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Parent, i64 noundef %indvars.iv) #4
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  %55 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %54)
  %56 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull @.str.8)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %57 = trunc nuw nsw i64 %indvars.iv.next to i32
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %56, i32 noundef %57)
  %59 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull @.str.8)
  %60 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Key, i64 noundef %indvars.iv) #4
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %59, i32 noundef %61)
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %64 = load i32, ptr @V, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = icmp slt i64 %indvars.iv.next, %65
  br i1 %66, label %.lr.ph26, label %._crit_edge27, !llvm.loop !17
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 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) 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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

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


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