; LLVM IR from ncduy0303/Competitive-Programming :: Graphs/Minimum Spanning Tree/Prim.ll (Z4primi)

; 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<std::array<int, 2>, std::allocator<std::array<int, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::array<int, 2>, std::allocator<std::array<int, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::array<int, 2>, std::allocator<std::array<int, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::array<int, 2>, std::allocator<std::array<int, 2>>>::_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 }
%"class.std::priority_queue" = type <{ %"class.std::vector.0", [8 x i8] }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::array<long long, 2>, std::allocator<std::array<long long, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::array<long long, 2>, std::allocator<std::array<long long, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::array<long long, 2>, std::allocator<std::array<long long, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::array<long long, 2>, std::allocator<std::array<long long, 2>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::array" = type { [2 x i32] }
%"struct.std::array.5" = type { [2 x i64] }

@n = external dso_local global i32, align 4
@visited = external dso_local global [100001 x i32], align 16
@adj = external dso_local global [100001 x %"class.std::vector"], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4primi(i32 noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::priority_queue", align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"struct.std::array", align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"struct.std::array.5", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::array.5", align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"struct.std::array", align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca %"struct.std::array.5", align 8
  %24 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #7
  call void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100001 x i32], ptr @visited, i64 0, i64 %26
  store i32 1, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @adj, i64 0, i64 %29
  store ptr %30, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %31 = load ptr, ptr %5, align 8, !tbaa !11
  %32 = call ptr @_ZNSt6vectorISt5arrayIiLm2EESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #7
  %33 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %32, ptr %33, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %34 = load ptr, ptr %5, align 8, !tbaa !11
  %35 = call ptr @_ZNSt6vectorISt5arrayIiLm2EESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #7
  %36 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %35, ptr %36, align 8
  br label %37

37:                                               ; preds = %65, %1
  %38 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br i1 %38, label %40, label %39

39:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %67

40:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %41 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %41, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EiLm2EEOT0_OSt5arrayIS0_XT1_EE(ptr noundef nonnull align 4 dereferenceable(8) %8) #7
  store ptr %42, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EiLm2EEOT0_OSt5arrayIS0_XT1_EE(ptr noundef nonnull align 4 dereferenceable(8) %8) #7
  store ptr %43, ptr %10, align 8, !tbaa !11
  %44 = load ptr, ptr %9, align 8, !tbaa !11
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100001 x i32], ptr @visited, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %64, label %50

50:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  %51 = getelementptr inbounds %"struct.std::array.5", ptr %11, i32 0, i32 0
  %52 = load ptr, ptr %10, align 8, !tbaa !11
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  store i64 %54, ptr %51, align 8, !tbaa !9
  %55 = getelementptr inbounds i64, ptr %51, i64 1
  %56 = load ptr, ptr %9, align 8, !tbaa !11
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  store i64 %58, ptr %55, align 8, !tbaa !9
  invoke void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %59 unwind label %60

59:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  br label %64

60:                                               ; preds = %50
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %12, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %175

64:                                               ; preds = %59, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %65

65:                                               ; preds = %64
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br label %37

67:                                               ; preds = %39
  br label %68

68:                                               ; preds = %143, %67
  %69 = invoke noundef i64 @_ZNKSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
          to label %70 unwind label %103

70:                                               ; preds = %68
  %71 = icmp ne i64 %69, 0
  br i1 %71, label %72, label %146

72:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  %73 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
          to label %74 unwind label %107

74:                                               ; preds = %72
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %73, i64 16, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0ExLm2EEOT0_OSt5arrayIS0_XT1_EE(ptr noundef nonnull align 8 dereferenceable(16) %14) #7
  store ptr %75, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1ExLm2EEOT0_OSt5arrayIS0_XT1_EE(ptr noundef nonnull align 8 dereferenceable(16) %14) #7
  store ptr %76, ptr %16, align 8, !tbaa !11
  invoke void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
          to label %77 unwind label %111

77:                                               ; preds = %74
  %78 = load ptr, ptr %16, align 8, !tbaa !11
  %79 = load i64, ptr %78, align 8, !tbaa !9
  %80 = getelementptr inbounds [100001 x i32], ptr @visited, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %143, label %83

83:                                               ; preds = %77
  %84 = load ptr, ptr %15, align 8, !tbaa !11
  %85 = load i64, ptr %84, align 8, !tbaa !9
  %86 = load i64, ptr %3, align 8, !tbaa !9
  %87 = add nsw i64 %86, %85
  store i64 %87, ptr %3, align 8, !tbaa !9
  %88 = load ptr, ptr %16, align 8, !tbaa !11
  %89 = load i64, ptr %88, align 8, !tbaa !9
  %90 = getelementptr inbounds [100001 x i32], ptr @visited, i64 0, i64 %89
  store i32 1, ptr %90, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %91 = load ptr, ptr %16, align 8, !tbaa !11
  %92 = load i64, ptr %91, align 8, !tbaa !9
  %93 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @adj, i64 0, i64 %92
  store ptr %93, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %94 = load ptr, ptr %17, align 8, !tbaa !11
  %95 = call ptr @_ZNSt6vectorISt5arrayIiLm2EESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %94) #7
  %96 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %95, ptr %96, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %97 = load ptr, ptr %17, align 8, !tbaa !11
  %98 = call ptr @_ZNSt6vectorISt5arrayIiLm2EESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %97) #7
  %99 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %98, ptr %99, align 8
  br label %100

100:                                              ; preds = %140, %83
  %101 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br i1 %101, label %115, label %102

102:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %142

103:                                              ; preds = %172, %169, %68
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %12, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %13, align 4
  br label %175

107:                                              ; preds = %72
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %12, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %13, align 4
  br label %145

111:                                              ; preds = %74
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %12, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %13, align 4
  br label %144

115:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %116 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %116, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EiLm2EEOT0_OSt5arrayIS0_XT1_EE(ptr noundef nonnull align 4 dereferenceable(8) %20) #7
  store ptr %117, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %118 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EiLm2EEOT0_OSt5arrayIS0_XT1_EE(ptr noundef nonnull align 4 dereferenceable(8) %20) #7
  store ptr %118, ptr %22, align 8, !tbaa !11
  %119 = load ptr, ptr %21, align 8, !tbaa !11
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100001 x i32], ptr @visited, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %139, label %125

125:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  %126 = getelementptr inbounds %"struct.std::array.5", ptr %23, i32 0, i32 0
  %127 = load ptr, ptr %22, align 8, !tbaa !11
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  store i64 %129, ptr %126, align 8, !tbaa !9
  %130 = getelementptr inbounds i64, ptr %126, i64 1
  %131 = load ptr, ptr %21, align 8, !tbaa !11
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  store i64 %133, ptr %130, align 8, !tbaa !9
  invoke void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %134 unwind label %135

134:                                              ; preds = %125
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  br label %139

135:                                              ; preds = %125
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %12, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %144

139:                                              ; preds = %134, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %140

140:                                              ; preds = %139
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br label %100

142:                                              ; preds = %102
  br label %143

143:                                              ; preds = %142, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  br label %68, !llvm.loop !16

144:                                              ; preds = %135, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %145

145:                                              ; preds = %144, %107
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  br label %175

146:                                              ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 1, ptr %24, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %166, %146
  %148 = load i32, ptr %24, align 4, !tbaa !5
  %149 = load i32, ptr @n, align 4, !tbaa !5
  %150 = icmp sle i32 %148, %149
  br i1 %150, label %152, label %151

151:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %169

152:                                              ; preds = %147
  %153 = load i32, ptr %24, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [100001 x i32], ptr @visited, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %165, label %158

158:                                              ; preds = %152
  %159 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %160 unwind label %161

160:                                              ; preds = %158
  call void @exit(i32 noundef 0) #8
  unreachable

161:                                              ; preds = %158
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %12, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %175

165:                                              ; preds = %152
  br label %166

166:                                              ; preds = %165
  %167 = load i32, ptr %24, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %24, align 4, !tbaa !5
  br label %147, !llvm.loop !18

169:                                              ; preds = %151
  %170 = load i64, ptr %3, align 8, !tbaa !9
  %171 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %170)
          to label %172 unwind label %103

172:                                              ; preds = %169
  %173 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %171, ptr noundef @.str.2)
          to label %174 unwind label %103

174:                                              ; preds = %172
  call void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  ret void

175:                                              ; preds = %161, %145, %103, %60
  call void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %176

176:                                              ; preds = %175
  %177 = load ptr, ptr %12, align 8
  %178 = load i32, ptr %13, align 4
  %179 = insertvalue { ptr, i32 } poison, ptr %177, 0
  %180 = insertvalue { ptr, i32 } %179, i32 %178, 1
  resume { ptr, i32 } %180
}

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

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

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

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #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) #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

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

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

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

@n = external dso_local local_unnamed_addr global i32, align 4
@visited = external dso_local local_unnamed_addr global [100001 x i32], align 16
@adj = external dso_local global [100001 x %"class.std::vector"], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4primi(i32 noundef %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::priority_queue", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"struct.std::array", align 8
  %6 = alloca %"struct.std::array.5", align 8
  %7 = alloca %"struct.std::array.5", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"struct.std::array", align 8
  %11 = alloca %"struct.std::array.5", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #7
  call void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  %12 = sext i32 %0 to i64
  %13 = getelementptr inbounds [100001 x i32], ptr @visited, i64 0, i64 %12
  store i32 1, ptr %13, align 4, !tbaa !5
  %14 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @adj, i64 0, i64 %12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %15 = call ptr @_ZNSt6vectorISt5arrayIiLm2EESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  store ptr %15, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %16 = call ptr @_ZNSt6vectorISt5arrayIiLm2EESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  store ptr %16, ptr %4, align 8
  %17 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %18 = getelementptr inbounds i8, ptr %6, i64 8
  br label %21

._crit_edge:                                      ; preds = %36, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %19 = call noundef i64 @_ZNKSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  %.not40 = icmp eq i64 %19, 0
  br i1 %.not40, label %.preheader, label %.lr.ph43

.lr.ph43:                                         ; preds = %._crit_edge
  %20 = getelementptr inbounds i8, ptr %11, i64 8
  br label %41

21:                                               ; preds = %.lr.ph, %36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %22 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %23 = load i64, ptr %22, align 4, !tbaa !9
  store i64 %23, ptr %5, align 8, !tbaa !9
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EiLm2EEOT0_OSt5arrayIS0_XT1_EE(ptr noundef nonnull align 4 dereferenceable(8) %5) #7
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EiLm2EEOT0_OSt5arrayIS0_XT1_EE(ptr noundef nonnull align 4 dereferenceable(8) %5) #7
  %26 = load i32, ptr %24, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100001 x i32], ptr @visited, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %.not32 = icmp eq i32 %29, 0
  br i1 %.not32, label %30, label %36

30:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %31 = load i32, ptr %25, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  store i64 %32, ptr %6, align 8, !tbaa !10
  store i64 %27, ptr %18, align 8, !tbaa !10
  invoke void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %2, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %33 unwind label %34

33:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  br label %36

34:                                               ; preds = %30
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %92

36:                                               ; preds = %33, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %38 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %38, label %21, label %._crit_edge

.preheader:                                       ; preds = %77, %._crit_edge
  %.022.lcssa = phi i64 [ 0, %._crit_edge ], [ %.1, %77 ]
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %.not2744 = icmp slt i32 %39, 1
  br i1 %.not2744, label %._crit_edge47, label %.lr.ph46.preheader

.lr.ph46.preheader:                               ; preds = %.preheader
  %40 = add nuw i32 %39, 1
  %wide.trip.count = zext i32 %40 to i64
  br label %.lr.ph46

41:                                               ; preds = %.lr.ph43, %77
  %.02241 = phi i64 [ 0, %.lr.ph43 ], [ %.1, %77 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %42, i64 16, i1 false), !tbaa.struct !12
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0ExLm2EEOT0_OSt5arrayIS0_XT1_EE(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1ExLm2EEOT0_OSt5arrayIS0_XT1_EE(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  invoke void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
          to label %45 unwind label %58

45:                                               ; preds = %41
  %46 = load i64, ptr %44, align 8, !tbaa !10
  %47 = getelementptr inbounds [100001 x i32], ptr @visited, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %.not29 = icmp eq i32 %48, 0
  br i1 %.not29, label %49, label %77

49:                                               ; preds = %45
  %50 = load i64, ptr %43, align 8, !tbaa !10
  %51 = add nsw i64 %50, %.02241
  store i32 1, ptr %47, align 4, !tbaa !5
  %52 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @adj, i64 0, i64 %46
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %53 = call ptr @_ZNSt6vectorISt5arrayIiLm2EESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %52) #7
  store ptr %53, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %54 = call ptr @_ZNSt6vectorISt5arrayIiLm2EESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %52) #7
  store ptr %54, ptr %9, align 8
  %55 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br i1 %55, label %.lr.ph38, label %._crit_edge39

._crit_edge39:                                    ; preds = %74, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %77

56:                                               ; preds = %89, %._crit_edge47
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %92

58:                                               ; preds = %41
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %79

.lr.ph38:                                         ; preds = %49, %74
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %60 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %61 = load i64, ptr %60, align 4, !tbaa !9
  store i64 %61, ptr %10, align 8, !tbaa !9
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EiLm2EEOT0_OSt5arrayIS0_XT1_EE(ptr noundef nonnull align 4 dereferenceable(8) %10) #7
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EiLm2EEOT0_OSt5arrayIS0_XT1_EE(ptr noundef nonnull align 4 dereferenceable(8) %10) #7
  %64 = load i32, ptr %62, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100001 x i32], ptr @visited, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %.not30 = icmp eq i32 %67, 0
  br i1 %.not30, label %68, label %74

68:                                               ; preds = %.lr.ph38
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  %69 = load i32, ptr %63, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  store i64 %70, ptr %11, align 8, !tbaa !10
  store i64 %65, ptr %20, align 8, !tbaa !10
  invoke void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %2, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %71 unwind label %72

71:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  br label %74

72:                                               ; preds = %68
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %79

74:                                               ; preds = %71, %.lr.ph38
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %76 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5arrayIiLm2EESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br i1 %76, label %.lr.ph38, label %._crit_edge39

77:                                               ; preds = %._crit_edge39, %45
  %.1 = phi i64 [ %.02241, %45 ], [ %51, %._crit_edge39 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  %78 = call noundef i64 @_ZNKSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  %.not = icmp eq i64 %78, 0
  br i1 %.not, label %.preheader, label %41, !llvm.loop !13

79:                                               ; preds = %72, %58
  %.pn = phi { ptr, i32 } [ %73, %72 ], [ %59, %58 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %92

80:                                               ; preds = %.lr.ph46
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge47, label %.lr.ph46, !llvm.loop !15

._crit_edge47:                                    ; preds = %80, %.preheader
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.022.lcssa)
          to label %89 unwind label %56

.lr.ph46:                                         ; preds = %.lr.ph46.preheader, %80
  %indvars.iv = phi i64 [ 1, %.lr.ph46.preheader ], [ %indvars.iv.next, %80 ]
  %82 = getelementptr inbounds [100001 x i32], ptr @visited, i64 0, i64 %indvars.iv
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %.not28 = icmp eq i32 %83, 0
  br i1 %.not28, label %84, label %80

84:                                               ; preds = %.lr.ph46
  %85 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %86 unwind label %87

86:                                               ; preds = %84
  call void @exit(i32 noundef 0) #8
  unreachable

87:                                               ; preds = %84
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %92

89:                                               ; preds = %._crit_edge47
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef nonnull @.str.2)
          to label %91 unwind label %56

91:                                               ; preds = %89
  call void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  ret void

92:                                               ; preds = %87, %79, %56, %34
  %.pn33 = phi { ptr, i32 } [ %35, %34 ], [ %.pn, %79 ], [ %88, %87 ], [ %57, %56 ]
  call void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  resume { ptr, i32 } %.pn33
}

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

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

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

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

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

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

; Function Attrs: mustprogress 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) #4

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt5arrayIxLm2EESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) 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 #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #6

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { noreturn 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 = { noreturn 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !7, i64 0}
!12 = !{i64 0, i64 16, !9}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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