; LLVM IR from ShahjalalShohag/code-library :: Graph Theory/Steiner Tree Problem.ll (Z3MSTv)

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

@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@imp = external dso_local global %"class.std::vector", align 8
@g = external dso_local global [100009 x %"class.std::vector.0"], align 16
@d = external dso_local global [32 x [100009 x i64]], align 16
@vis = external dso_local global [100009 x i8], align 16
@_ZL3inf = external hidden constant i64, align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z3MSTv() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::priority_queue", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"struct.std::pair.10", align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %40, %0
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = load i32, ptr @k, align 4, !tbaa !5
  %27 = shl i32 1, %26
  %28 = icmp slt i32 %25, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %24
  %31 = load i32, ptr %1, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %32
  %34 = getelementptr inbounds [100009 x i64], ptr %33, i64 0, i64 0
  %35 = load i32, ptr %1, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %36
  %38 = getelementptr inbounds [100009 x i64], ptr %37, i64 0, i64 0
  %39 = getelementptr inbounds i64, ptr %38, i64 100009
  call void @_ZSt4fillIPxxEvT_S1_RKT0_(ptr noundef %34, ptr noundef %39, ptr noundef nonnull align 8 dereferenceable(8) @_ZL3inf)
  br label %40

40:                                               ; preds = %30
  %41 = load i32, ptr %1, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %1, align 4, !tbaa !5
  br label %24, !llvm.loop !9

43:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %60, %43
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = load i32, ptr @k, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %63

49:                                               ; preds = %44
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = shl i32 1, %50
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %52
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @imp, i64 noundef %55) #7
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100009 x i64], ptr %53, i64 0, i64 %58
  store i64 0, ptr %59, align 8, !tbaa !11
  br label %60

60:                                               ; preds = %49
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %2, align 4, !tbaa !5
  br label %44, !llvm.loop !13

63:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #7
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %268, %63
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = load i32, ptr @k, align 4, !tbaa !5
  %67 = shl i32 1, %66
  %68 = icmp slt i32 %65, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %64
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %272

70:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %139, %70
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %142

76:                                               ; preds = %71
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = or i32 %77, %78
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = icmp ne i32 %79, %80
  br i1 %81, label %82, label %83

82:                                               ; preds = %76
  br label %139

83:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = xor i32 %84, %85
  store i32 %86, ptr %7, align 4, !tbaa !5
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = icmp sgt i32 %87, %88
  br i1 %89, label %90, label %91

90:                                               ; preds = %83
  store i32 13, ptr %5, align 4
  br label %136

91:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %128, %91
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %135

97:                                               ; preds = %92
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %99
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100009 x i64], ptr %100, i64 0, i64 %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %105
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100009 x i64], ptr %106, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !11
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %112
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100009 x i64], ptr %113, i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !11
  %118 = add nsw i64 %110, %117
  store i64 %118, ptr %9, align 8, !tbaa !11
  %119 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %120 unwind label %131

120:                                              ; preds = %97
  %121 = load i64, ptr %119, align 8, !tbaa !11
  %122 = load i32, ptr %4, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %123
  %125 = load i32, ptr %8, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100009 x i64], ptr %124, i64 0, i64 %126
  store i64 %121, ptr %127, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %128

128:                                              ; preds = %120
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %8, align 4, !tbaa !5
  br label %92, !llvm.loop !14

131:                                              ; preds = %97
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %10, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %271

135:                                              ; preds = %96
  store i32 0, ptr %5, align 4
  br label %136

136:                                              ; preds = %135, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  %137 = load i32, ptr %5, align 4
  switch i32 %137, label %305 [
    i32 0, label %138
    i32 13, label %139
  ]

138:                                              ; preds = %136
  br label %139

139:                                              ; preds = %138, %136, %82
  %140 = load i32, ptr %6, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %6, align 4, !tbaa !5
  br label %71, !llvm.loop !15

142:                                              ; preds = %75
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 100009, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %168, %142
  %144 = load i32, ptr %12, align 4, !tbaa !5
  %145 = load i32, ptr @n, align 4, !tbaa !5
  %146 = icmp slt i32 %144, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %143
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %175

148:                                              ; preds = %143
  %149 = load i32, ptr %4, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %150
  %152 = load i32, ptr %12, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [100009 x i64], ptr %151, i64 0, i64 %153
  %155 = load i64, ptr %154, align 8, !tbaa !11
  %156 = icmp eq i64 %155, 3074457345618258602
  br i1 %156, label %157, label %158

157:                                              ; preds = %148
  br label %168

158:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %159 = load i32, ptr %4, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %160
  %162 = load i32, ptr %12, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [100009 x i64], ptr %161, i64 0, i64 %163
  %165 = load i64, ptr %164, align 8, !tbaa !11
  %166 = sub nsw i64 0, %165
  store i64 %166, ptr %13, align 8, !tbaa !11
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJxRiEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %3, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %167 unwind label %171

167:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %168

168:                                              ; preds = %167, %157
  %169 = load i32, ptr %12, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %12, align 4, !tbaa !5
  br label %143, !llvm.loop !16

171:                                              ; preds = %158
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %10, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %271

175:                                              ; preds = %147
  br label %176

176:                                              ; preds = %264, %262, %175
  %177 = invoke noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %178 unwind label %197

178:                                              ; preds = %176
  %179 = xor i1 %177, true
  br i1 %179, label %180, label %267

180:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %181 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %182 unwind label %201

182:                                              ; preds = %180
  %183 = getelementptr inbounds %"struct.std::pair", ptr %181, i32 0, i32 0
  %184 = load i64, ptr %183, align 8, !tbaa !17
  %185 = sub nsw i64 0, %184
  store i64 %185, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %186 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %187 unwind label %205

187:                                              ; preds = %182
  %188 = getelementptr inbounds %"struct.std::pair", ptr %186, i32 0, i32 1
  %189 = load i32, ptr %188, align 8, !tbaa !19
  store i32 %189, ptr %15, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %190 unwind label %205

190:                                              ; preds = %187
  %191 = load i32, ptr %15, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [100009 x i8], ptr @vis, i64 0, i64 %192
  %194 = load i8, ptr %193, align 1, !tbaa !20, !range !22, !noundef !23
  %195 = trunc i8 %194 to i1
  br i1 %195, label %196, label %209

196:                                              ; preds = %190
  store i32 20, ptr %5, align 4
  br label %262, !llvm.loop !24

197:                                              ; preds = %176
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %10, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %11, align 4
  br label %271

201:                                              ; preds = %180
  %202 = landingpad { ptr, i32 }
          cleanup
  %203 = extractvalue { ptr, i32 } %202, 0
  store ptr %203, ptr %10, align 8
  %204 = extractvalue { ptr, i32 } %202, 1
  store i32 %204, ptr %11, align 4
  br label %266

205:                                              ; preds = %187, %182
  %206 = landingpad { ptr, i32 }
          cleanup
  %207 = extractvalue { ptr, i32 } %206, 0
  store ptr %207, ptr %10, align 8
  %208 = extractvalue { ptr, i32 } %206, 1
  store i32 %208, ptr %11, align 4
  br label %265

209:                                              ; preds = %190
  %210 = load i32, ptr %15, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [100009 x i8], ptr @vis, i64 0, i64 %211
  store i8 1, ptr %212, align 1, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %213 = load i32, ptr %15, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [100009 x %"class.std::vector.0"], ptr @g, i64 0, i64 %214
  store ptr %215, ptr %16, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %216 = load ptr, ptr %16, align 8, !tbaa !25
  %217 = call ptr @_ZNSt6vectorISt4pairIixESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %216) #7
  %218 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %217, ptr %218, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %219 = load ptr, ptr %16, align 8, !tbaa !25
  %220 = call ptr @_ZNSt6vectorISt4pairIixESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %219) #7
  %221 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %220, ptr %221, align 8
  br label %222

222:                                              ; preds = %259, %209
  %223 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIixESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br i1 %223, label %225, label %224

224:                                              ; preds = %222
  store i32 22, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %261

225:                                              ; preds = %222
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  %226 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIixESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %226, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %227 = load i64, ptr %14, align 8, !tbaa !11
  %228 = getelementptr inbounds %"struct.std::pair.10", ptr %19, i32 0, i32 1
  %229 = load i64, ptr %228, align 8, !tbaa !27
  %230 = add nsw i64 %227, %229
  store i64 %230, ptr %20, align 8, !tbaa !11
  %231 = load i64, ptr %20, align 8, !tbaa !11
  %232 = load i32, ptr %4, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %233
  %235 = getelementptr inbounds %"struct.std::pair.10", ptr %19, i32 0, i32 0
  %236 = load i32, ptr %235, align 8, !tbaa !29
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [100009 x i64], ptr %234, i64 0, i64 %237
  %239 = load i64, ptr %238, align 8, !tbaa !11
  %240 = icmp slt i64 %231, %239
  br i1 %240, label %241, label %258

241:                                              ; preds = %225
  %242 = load i64, ptr %20, align 8, !tbaa !11
  %243 = load i32, ptr %4, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %244
  %246 = getelementptr inbounds %"struct.std::pair.10", ptr %19, i32 0, i32 0
  %247 = load i32, ptr %246, align 8, !tbaa !29
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [100009 x i64], ptr %245, i64 0, i64 %248
  store i64 %242, ptr %249, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %250 = load i64, ptr %20, align 8, !tbaa !11
  %251 = sub nsw i64 0, %250
  store i64 %251, ptr %21, align 8, !tbaa !11
  %252 = getelementptr inbounds %"struct.std::pair.10", ptr %19, i32 0, i32 0
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJxRiEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %3, ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(4) %252)
          to label %253 unwind label %254

253:                                              ; preds = %241
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %258

254:                                              ; preds = %241
  %255 = landingpad { ptr, i32 }
          cleanup
  %256 = extractvalue { ptr, i32 } %255, 0
  store ptr %256, ptr %10, align 8
  %257 = extractvalue { ptr, i32 } %255, 1
  store i32 %257, ptr %11, align 4
  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 16, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %265

258:                                              ; preds = %253, %225
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  br label %259

259:                                              ; preds = %258
  %260 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIixESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br label %222

261:                                              ; preds = %224
  store i32 0, ptr %5, align 4
  br label %262

262:                                              ; preds = %261, %196
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %263 = load i32, ptr %5, align 4
  switch i32 %263, label %305 [
    i32 0, label %264
    i32 20, label %176
  ]

264:                                              ; preds = %262
  br label %176, !llvm.loop !24

265:                                              ; preds = %254, %205
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %266

266:                                              ; preds = %265, %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %271

267:                                              ; preds = %178
  br label %268

268:                                              ; preds = %267
  %269 = load i32, ptr %4, align 4, !tbaa !5
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %4, align 4, !tbaa !5
  br label %64, !llvm.loop !30

271:                                              ; preds = %266, %197, %171, %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %299

272:                                              ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 3074457345618258602, ptr %22, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %273

273:                                              ; preds = %290, %272
  %274 = load i32, ptr %23, align 4, !tbaa !5
  %275 = load i32, ptr @n, align 4, !tbaa !5
  %276 = icmp slt i32 %274, %275
  br i1 %276, label %278, label %277

277:                                              ; preds = %273
  store i32 24, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %297

278:                                              ; preds = %273
  %279 = load i32, ptr @k, align 4, !tbaa !5
  %280 = shl i32 1, %279
  %281 = sub nsw i32 %280, 1
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %282
  %284 = load i32, ptr %23, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [100009 x i64], ptr %283, i64 0, i64 %285
  %287 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %286)
          to label %288 unwind label %293

288:                                              ; preds = %278
  %289 = load i64, ptr %287, align 8, !tbaa !11
  store i64 %289, ptr %22, align 8, !tbaa !11
  br label %290

290:                                              ; preds = %288
  %291 = load i32, ptr %23, align 4, !tbaa !5
  %292 = add nsw i32 %291, 1
  store i32 %292, ptr %23, align 4, !tbaa !5
  br label %273, !llvm.loop !31

293:                                              ; preds = %278
  %294 = landingpad { ptr, i32 }
          cleanup
  %295 = extractvalue { ptr, i32 } %294, 0
  store ptr %295, ptr %10, align 8
  %296 = extractvalue { ptr, i32 } %294, 1
  store i32 %296, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %299

297:                                              ; preds = %277
  %298 = load i64, ptr %22, align 8, !tbaa !11
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #7
  ret i64 %298

299:                                              ; preds = %293, %271
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #7
  br label %300

300:                                              ; preds = %299
  %301 = load ptr, ptr %10, align 8
  %302 = load i32, ptr %11, align 4
  %303 = insertvalue { ptr, i32 } poison, ptr %301, 0
  %304 = insertvalue { ptr, i32 } %303, i32 %302, 1
  resume { ptr, i32 } %304

305:                                              ; preds = %262, %136
  unreachable
}

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

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

; 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 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIixESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 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) #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #4 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 = { 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 = { 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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!18, !12, i64 0}
!18 = !{!"_ZTSSt4pairIxiE", !12, i64 0, !6, i64 8}
!19 = !{!18, !6, i64 8}
!20 = !{!21, !21, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !10}
!25 = !{!26, !26, i64 0}
!26 = !{!"any pointer", !7, i64 0}
!27 = !{!28, !12, i64 8}
!28 = !{!"_ZTSSt4pairIixE", !6, i64 0, !12, i64 8}
!29 = !{!28, !6, i64 0}
!30 = distinct !{!30, !10}
!31 = distinct !{!31, !10}


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

@n = external dso_local local_unnamed_addr global i32, align 4
@k = external dso_local local_unnamed_addr global i32, align 4
@imp = external dso_local global %"class.std::vector", align 8
@g = external dso_local global [100009 x %"class.std::vector.0"], align 16
@d = external dso_local global [32 x [100009 x i64]], align 16
@vis = external dso_local local_unnamed_addr global [100009 x i8], align 16
@_ZL3inf = external hidden constant i64, align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z3MSTv() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::priority_queue", align 8
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"struct.std::pair.10", align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = load i32, ptr @k, align 4, !tbaa !5
  %.not87 = icmp eq i32 %10, 31
  br i1 %.not87, label %.lr.ph65.preheader, label %.lr.ph

.preheader62:                                     ; preds = %.lr.ph
  %11 = icmp sgt i32 %14, 0
  br i1 %11, label %.lr.ph65.preheader, label %._crit_edge

.lr.ph65.preheader:                               ; preds = %0, %.preheader62
  br label %.lr.ph65

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %indvars.iv
  %13 = getelementptr inbounds i8, ptr %12, i64 800072
  tail call void @_ZSt4fillIPxxEvT_S1_RKT0_(ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull align 8 dereferenceable(8) @_ZL3inf)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i32, ptr @k, align 4, !tbaa !5
  %15 = shl nuw i32 1, %14
  %16 = sext i32 %15 to i64
  %17 = icmp slt i64 %indvars.iv.next, %16
  br i1 %17, label %.lr.ph, label %.preheader62, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph65, %.preheader62
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #7
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %18 = load i32, ptr @k, align 4, !tbaa !5
  %19 = shl nuw i32 1, %18
  %20 = icmp sgt i32 %19, 1
  br i1 %20, label %.preheader61.lr.ph, label %._crit_edge81

.preheader61.lr.ph:                               ; preds = %._crit_edge
  %21 = getelementptr inbounds i8, ptr %7, i64 8
  br label %.preheader61

.lr.ph65:                                         ; preds = %.lr.ph65.preheader, %.lr.ph65
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %.lr.ph65 ], [ 0, %.lr.ph65.preheader ]
  %22 = trunc nuw nsw i64 %indvars.iv89 to i32
  %23 = shl nuw i32 1, %22
  %24 = sext i32 %23 to i64
  %25 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @imp, i64 noundef %indvars.iv89) #7
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %24, i64 %27
  store i64 0, ptr %28, align 8, !tbaa !11
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %29 = load i32, ptr @k, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next90, %30
  br i1 %31, label %.lr.ph65, label %._crit_edge, !llvm.loop !13

.preheader61:                                     ; preds = %.preheader61.lr.ph, %._crit_edge79
  %indvars.iv98 = phi i64 [ 1, %.preheader61.lr.ph ], [ %indvars.iv.next99, %._crit_edge79 ]
  br label %37

._crit_edge81:                                    ; preds = %._crit_edge79, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  store i64 3074457345618258602, ptr %9, align 8, !tbaa !11
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph84, label %._crit_edge85

34:                                               ; preds = %.loopexit
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100009) @vis, i8 0, i64 100009, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph72, label %._crit_edge73

37:                                               ; preds = %.preheader61, %.loopexit
  %indvars.iv95 = phi i64 [ 0, %.preheader61 ], [ %indvars.iv.next96, %.loopexit ]
  %38 = or i64 %indvars.iv95, %indvars.iv98
  %39 = and i64 %38, 4294967295
  %.not = icmp eq i64 %39, %indvars.iv98
  br i1 %.not, label %40, label %.loopexit

40:                                               ; preds = %37
  %41 = xor i64 %indvars.iv95, %indvars.iv98
  %42 = and i64 %41, 4294967295
  %43 = icmp ult i64 %42, %indvars.iv95
  %44 = load i32, ptr @n, align 4
  %45 = icmp sgt i32 %44, 0
  %or.cond = select i1 %43, i1 %45, i1 false
  br i1 %or.cond, label %.lr.ph67, label %.loopexit

.lr.ph67:                                         ; preds = %40, %.lr.ph67
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %.lr.ph67 ], [ 0, %40 ]
  %46 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %indvars.iv98, i64 %indvars.iv92
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %47 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %indvars.iv95, i64 %indvars.iv92
  %48 = load i64, ptr %47, align 8, !tbaa !11
  %49 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %42, i64 %indvars.iv92
  %50 = load i64, ptr %49, align 8, !tbaa !11
  %51 = add nsw i64 %50, %48
  store i64 %51, ptr %2, align 8, !tbaa !11
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %53 = load i64, ptr %52, align 8, !tbaa !11
  store i64 %53, ptr %46, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = icmp slt i64 %indvars.iv.next93, %55
  br i1 %56, label %.lr.ph67, label %.loopexit, !llvm.loop !14

.loopexit:                                        ; preds = %.lr.ph67, %40, %37
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next96, %indvars.iv98
  br i1 %exitcond.not, label %34, label %37, !llvm.loop !15

._crit_edge73:                                    ; preds = %66, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %57 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  br i1 %57, label %._crit_edge79, label %.lr.ph78

.lr.ph72:                                         ; preds = %34, %66
  %58 = phi i32 [ %67, %66 ], [ %35, %34 ]
  %storemerge70 = phi i32 [ %69, %66 ], [ 0, %34 ]
  %59 = sext i32 %storemerge70 to i64
  %60 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %indvars.iv98, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !11
  %62 = icmp eq i64 %61, 3074457345618258602
  br i1 %62, label %66, label %63

63:                                               ; preds = %.lr.ph72
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %64 = sub nsw i64 0, %61
  store i64 %64, ptr %4, align 8, !tbaa !11
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJxRiEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %1, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %65 unwind label %71

65:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  %.pre104 = load i32, ptr @n, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %.lr.ph72, %65
  %67 = phi i32 [ %58, %.lr.ph72 ], [ %.pre104, %65 ]
  %68 = phi i32 [ %storemerge70, %.lr.ph72 ], [ %.pre, %65 ]
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %3, align 4, !tbaa !5
  %70 = icmp slt i32 %69, %67
  br i1 %70, label %.lr.ph72, label %._crit_edge73, !llvm.loop !16

71:                                               ; preds = %63
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %112

.lr.ph78:                                         ; preds = %._crit_edge73, %106
  %73 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %74 = load i64, ptr %73, align 8, !tbaa !17
  %75 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  %77 = load i32, ptr %76, align 8, !tbaa !19
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
          to label %78 unwind label %83

78:                                               ; preds = %.lr.ph78
  %79 = sext i32 %77 to i64
  %80 = getelementptr inbounds [100009 x i8], ptr @vis, i64 0, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !20, !range !22, !noundef !23
  %82 = trunc nuw i8 %81 to i1
  br i1 %82, label %106, label %85, !llvm.loop !24

83:                                               ; preds = %.lr.ph78
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %112

85:                                               ; preds = %78
  store i8 1, ptr %80, align 1, !tbaa !20
  %86 = getelementptr inbounds [100009 x %"class.std::vector.0"], ptr @g, i64 0, i64 %79
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %87 = call ptr @_ZNSt6vectorISt4pairIixESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %86) #7
  store ptr %87, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %88 = call ptr @_ZNSt6vectorISt4pairIixESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %86) #7
  store ptr %88, ptr %6, align 8
  %89 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIixESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br i1 %89, label %.lr.ph75, label %._crit_edge76

._crit_edge76:                                    ; preds = %103, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %106

.lr.ph75:                                         ; preds = %85, %103
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  %90 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIixESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %90, i64 16, i1 false)
  %91 = load i64, ptr %21, align 8, !tbaa !25
  %92 = sub i64 %91, %74
  %93 = load i32, ptr %7, align 8, !tbaa !27
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %indvars.iv98, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !11
  %97 = icmp slt i64 %92, %96
  br i1 %97, label %98, label %103

98:                                               ; preds = %.lr.ph75
  store i64 %92, ptr %95, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %99 = sub nsw i64 0, %92
  store i64 %99, ptr %8, align 8, !tbaa !11
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJxRiEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %1, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %100 unwind label %101

100:                                              ; preds = %98
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %103

101:                                              ; preds = %98
  %102 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %112

103:                                              ; preds = %100, %.lr.ph75
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIixESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %105 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIixESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br i1 %105, label %.lr.ph75, label %._crit_edge76

106:                                              ; preds = %78, %._crit_edge76
  %107 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  br i1 %107, label %._crit_edge79, label %.lr.ph78

._crit_edge79:                                    ; preds = %106, %._crit_edge73
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %108 = load i32, ptr @k, align 4, !tbaa !5
  %109 = shl nuw i32 1, %108
  %110 = sext i32 %109 to i64
  %111 = icmp slt i64 %indvars.iv.next99, %110
  br i1 %111, label %.preheader61, label %._crit_edge81, !llvm.loop !28

112:                                              ; preds = %83, %101, %71
  %.pn59 = phi { ptr, i32 } [ %72, %71 ], [ %102, %101 ], [ %84, %83 ]
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn59

._crit_edge85:                                    ; preds = %.lr.ph84, %._crit_edge81
  %113 = phi i64 [ 3074457345618258602, %._crit_edge81 ], [ %119, %.lr.ph84 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  ret i64 %113

.lr.ph84:                                         ; preds = %._crit_edge81, %.lr.ph84
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %.lr.ph84 ], [ 0, %._crit_edge81 ]
  %114 = load i32, ptr @k, align 4, !tbaa !5
  %notmask = shl nsw i32 -1, %114
  %115 = xor i32 %notmask, -1
  %116 = zext nneg i32 %115 to i64
  %117 = getelementptr inbounds [32 x [100009 x i64]], ptr @d, i64 0, i64 %116, i64 %indvars.iv101
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %117)
  %119 = load i64, ptr %118, align 8, !tbaa !11
  store i64 %119, ptr %9, align 8, !tbaa !11
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %120 = load i32, ptr @n, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = icmp slt i64 %indvars.iv.next102, %121
  br i1 %122, label %.lr.ph84, label %._crit_edge85, !llvm.loop !29
}

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

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

; 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 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIixESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 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) #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #4 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 = { 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 = { 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 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!18, !12, i64 0}
!18 = !{!"_ZTSSt4pairIxiE", !12, i64 0, !6, i64 8}
!19 = !{!18, !6, i64 8}
!20 = !{!21, !21, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !10}
!25 = !{!26, !12, i64 8}
!26 = !{!"_ZTSSt4pairIixE", !6, i64 0, !12, i64 8}
!27 = !{!26, !6, i64 0}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}


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