; LLVM IR from sunkafei/xcpc-algorithm-templates :: 算法/动态规划 (斯坦纳树（点权）)

; 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"

%struct.SteinerTree = type { i32, i32, [130 x [11000 x i32]], [130 x i32], [130 x i32], [130 x i32], [2200 x i32], [2200 x i32], i32, [130 x [11000 x %"struct.std::pair"]], [130 x [11000 x i8]], [130 x i8], %"class.std::queue" }
%"struct.std::pair" = type { i32, i32 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"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 }

@tree = external dso_local global %struct.SteinerTree, align 8
@A = external dso_local global [130 x [130 x i32]], align 16
@weight = external dso_local global [130 x i32], align 16
@dr = external dso_local global [4 x i32], align 16
@dc = external dso_local global [4 x i32], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::vector", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 -1, ptr %4, align 4, !tbaa !5
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %96, %0
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %99

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

27:                                               ; preds = %91, %26
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

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

32:                                               ; preds = %27
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [130 x [130 x i32]], ptr @A, i64 0, i64 %34
  %36 = load i32, ptr %8, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [130 x i32], ptr %35, i64 0, i64 %37
  %39 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %38)
          to label %40 unwind label %81

40:                                               ; preds = %32
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [130 x [130 x i32]], ptr @A, i64 0, i64 %42
  %44 = load i32, ptr %8, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [130 x i32], ptr %43, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = mul nsw i32 %48, %49
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = add nsw i32 %50, %51
  %53 = add nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [130 x i32], ptr @weight, i64 0, i64 %54
  store i32 %47, ptr %55, align 4, !tbaa !5
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [130 x [130 x i32]], ptr @A, i64 0, i64 %57
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [130 x i32], ptr %58, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %90

64:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = mul nsw i32 %65, %66
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = add nsw i32 %67, %68
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %11, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %71 unwind label %85

71:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = icmp eq i32 %72, -1
  br i1 %73, label %74, label %89

74:                                               ; preds = %71
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = mul nsw i32 %75, %76
  %78 = load i32, ptr %8, align 4, !tbaa !5
  %79 = add nsw i32 %77, %78
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %4, align 4, !tbaa !5
  br label %89

81:                                               ; preds = %32
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %9, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %10, align 4
  br label %94

85:                                               ; preds = %64
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %9, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %94

89:                                               ; preds = %74, %71
  br label %90

90:                                               ; preds = %89, %40
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %8, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %8, align 4, !tbaa !5
  br label %27, !llvm.loop !9

94:                                               ; preds = %85, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %271

95:                                               ; preds = %31
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %6, align 4, !tbaa !5
  br label %21, !llvm.loop !11

99:                                               ; preds = %25
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = mul nsw i32 %100, %101
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %103 unwind label %110

103:                                              ; preds = %99
  invoke void @_ZN11SteinerTree4initEiPiSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(18609384) @tree, i32 noundef %102, ptr noundef @weight, ptr noundef %12)
          to label %104 unwind label %114

104:                                              ; preds = %103
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %185, %104
  %106 = load i32, ptr %13, align 4, !tbaa !5
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %118, label %109

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

110:                                              ; preds = %201, %189, %188, %99
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %9, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %10, align 4
  br label %271

114:                                              ; preds = %103
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %9, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %10, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  br label %271

118:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %181, %118
  %120 = load i32, ptr %14, align 4, !tbaa !5
  %121 = load i32, ptr %3, align 4, !tbaa !5
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %184

124:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %173, %124
  %126 = load i32, ptr %15, align 4, !tbaa !5
  %127 = icmp slt i32 %126, 4
  br i1 %127, label %129, label %128

128:                                              ; preds = %125
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %180

129:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %130 = load i32, ptr %13, align 4, !tbaa !5
  %131 = load i32, ptr %15, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [4 x i32], ptr @dr, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = add nsw i32 %130, %134
  store i32 %135, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %136 = load i32, ptr %14, align 4, !tbaa !5
  %137 = load i32, ptr %15, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [4 x i32], ptr @dc, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = add nsw i32 %136, %140
  store i32 %141, ptr %17, align 4, !tbaa !5
  %142 = load i32, ptr %16, align 4, !tbaa !5
  %143 = icmp slt i32 %142, 0
  br i1 %143, label %155, label %144

144:                                              ; preds = %129
  %145 = load i32, ptr %17, align 4, !tbaa !5
  %146 = icmp slt i32 %145, 0
  br i1 %146, label %155, label %147

147:                                              ; preds = %144
  %148 = load i32, ptr %16, align 4, !tbaa !5
  %149 = load i32, ptr %2, align 4, !tbaa !5
  %150 = icmp sge i32 %148, %149
  br i1 %150, label %155, label %151

151:                                              ; preds = %147
  %152 = load i32, ptr %17, align 4, !tbaa !5
  %153 = load i32, ptr %3, align 4, !tbaa !5
  %154 = icmp sge i32 %152, %153
  br i1 %154, label %155, label %156

155:                                              ; preds = %151, %147, %144, %129
  store i32 16, ptr %7, align 4
  br label %170

156:                                              ; preds = %151
  %157 = load i32, ptr %13, align 4, !tbaa !5
  %158 = load i32, ptr %3, align 4, !tbaa !5
  %159 = mul nsw i32 %157, %158
  %160 = load i32, ptr %14, align 4, !tbaa !5
  %161 = add nsw i32 %159, %160
  %162 = add nsw i32 %161, 1
  %163 = load i32, ptr %16, align 4, !tbaa !5
  %164 = load i32, ptr %3, align 4, !tbaa !5
  %165 = mul nsw i32 %163, %164
  %166 = load i32, ptr %17, align 4, !tbaa !5
  %167 = add nsw i32 %165, %166
  %168 = add nsw i32 %167, 1
  invoke void @_ZN11SteinerTree8add_edgeEii(ptr noundef nonnull align 8 dereferenceable(18609384) @tree, i32 noundef %162, i32 noundef %168)
          to label %169 unwind label %176

169:                                              ; preds = %156
  store i32 0, ptr %7, align 4
  br label %170

170:                                              ; preds = %169, %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %171 = load i32, ptr %7, align 4
  switch i32 %171, label %277 [
    i32 0, label %172
    i32 16, label %173
  ]

172:                                              ; preds = %170
  br label %173

173:                                              ; preds = %172, %170
  %174 = load i32, ptr %15, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %15, align 4, !tbaa !5
  br label %125, !llvm.loop !12

176:                                              ; preds = %156
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %9, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %271

180:                                              ; preds = %128
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %14, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %14, align 4, !tbaa !5
  br label %119, !llvm.loop !13

184:                                              ; preds = %123
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %13, align 4, !tbaa !5
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %13, align 4, !tbaa !5
  br label %105, !llvm.loop !14

188:                                              ; preds = %109
  invoke void @_ZN11SteinerTree5solveEv(ptr noundef nonnull align 8 dereferenceable(18609384) @tree)
          to label %189 unwind label %110

189:                                              ; preds = %188
  %190 = load i32, ptr %4, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [130 x [11000 x i32]], ptr getelementptr inbounds (%struct.SteinerTree, ptr @tree, i32 0, i32 2), i64 0, i64 %191
  %193 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %194 = trunc i64 %193 to i32
  %195 = shl i32 1, %194
  %196 = sub nsw i32 %195, 1
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [11000 x i32], ptr %192, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %199)
          to label %201 unwind label %110

201:                                              ; preds = %189
  %202 = load i32, ptr %4, align 4, !tbaa !5
  %203 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %204 = trunc i64 %203 to i32
  %205 = shl i32 1, %204
  %206 = sub nsw i32 %205, 1
  invoke void @_ZN11SteinerTree3dfsEii(ptr noundef nonnull align 8 dereferenceable(18609384) @tree, i32 noundef %202, i32 noundef %206)
          to label %207 unwind label %110

207:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %208

208:                                              ; preds = %266, %207
  %209 = load i32, ptr %18, align 4, !tbaa !5
  %210 = load i32, ptr %2, align 4, !tbaa !5
  %211 = icmp slt i32 %209, %210
  br i1 %211, label %213, label %212

212:                                              ; preds = %208
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %269

213:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %214

214:                                              ; preds = %262, %213
  %215 = load i32, ptr %19, align 4, !tbaa !5
  %216 = load i32, ptr %3, align 4, !tbaa !5
  %217 = icmp slt i32 %215, %216
  br i1 %217, label %219, label %218

218:                                              ; preds = %214
  store i32 20, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %265

219:                                              ; preds = %214
  %220 = load i32, ptr %18, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [130 x [130 x i32]], ptr @A, i64 0, i64 %221
  %223 = load i32, ptr %19, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [130 x i32], ptr %222, i64 0, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !5
  %227 = icmp ne i32 %226, 0
  br i1 %227, label %235, label %228

228:                                              ; preds = %219
  %229 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4)
          to label %230 unwind label %231

230:                                              ; preds = %228
  br label %253

231:                                              ; preds = %258, %249, %246, %228
  %232 = landingpad { ptr, i32 }
          cleanup
  %233 = extractvalue { ptr, i32 } %232, 0
  store ptr %233, ptr %9, align 8
  %234 = extractvalue { ptr, i32 } %232, 1
  store i32 %234, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %271

235:                                              ; preds = %219
  %236 = load i32, ptr %18, align 4, !tbaa !5
  %237 = load i32, ptr %3, align 4, !tbaa !5
  %238 = mul nsw i32 %236, %237
  %239 = load i32, ptr %19, align 4, !tbaa !5
  %240 = add nsw i32 %238, %239
  %241 = add nsw i32 %240, 1
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [130 x i8], ptr getelementptr inbounds (%struct.SteinerTree, ptr @tree, i32 0, i32 11), i64 0, i64 %242
  %244 = load i8, ptr %243, align 1, !tbaa !15, !range !17, !noundef !18
  %245 = trunc i8 %244 to i1
  br i1 %245, label %246, label %249

246:                                              ; preds = %235
  %247 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5)
          to label %248 unwind label %231

248:                                              ; preds = %246
  br label %252

249:                                              ; preds = %235
  %250 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.6)
          to label %251 unwind label %231

251:                                              ; preds = %249
  br label %252

252:                                              ; preds = %251, %248
  br label %253

253:                                              ; preds = %252, %230
  %254 = load i32, ptr %19, align 4, !tbaa !5
  %255 = load i32, ptr %3, align 4, !tbaa !5
  %256 = sub nsw i32 %255, 1
  %257 = icmp eq i32 %254, %256
  br i1 %257, label %258, label %261

258:                                              ; preds = %253
  %259 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.7)
          to label %260 unwind label %231

260:                                              ; preds = %258
  br label %261

261:                                              ; preds = %260, %253
  br label %262

262:                                              ; preds = %261
  %263 = load i32, ptr %19, align 4, !tbaa !5
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr %19, align 4, !tbaa !5
  br label %214, !llvm.loop !19

265:                                              ; preds = %218
  br label %266

266:                                              ; preds = %265
  %267 = load i32, ptr %18, align 4, !tbaa !5
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %18, align 4, !tbaa !5
  br label %208, !llvm.loop !20

269:                                              ; preds = %212
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %270 = load i32, ptr %1, align 4
  ret i32 %270

271:                                              ; preds = %231, %176, %114, %110, %94
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %272

272:                                              ; preds = %271
  %273 = load ptr, ptr %9, align 8
  %274 = load i32, ptr %10, align 4
  %275 = insertvalue { ptr, i32 } poison, ptr %273, 0
  %276 = insertvalue { ptr, i32 } %275, i32 %274, 1
  resume { ptr, i32 } %276

277:                                              ; preds = %170
  unreachable
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 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 uwtable
declare dso_local void @_ZN11SteinerTree4initEiPiSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(18609384), i32 noundef, ptr noundef, ptr noundef) #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11SteinerTree8add_edgeEii(ptr noundef nonnull align 8 dereferenceable(18609384), i32 noundef, i32 noundef) #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11SteinerTree3dfsEii(ptr noundef nonnull align 8 dereferenceable(18609384), i32 noundef, i32 noundef) #4 align 2

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

%struct.SteinerTree = type { i32, i32, [130 x [11000 x i32]], [130 x i32], [130 x i32], [130 x i32], [2200 x i32], [2200 x i32], i32, [130 x [11000 x %"struct.std::pair"]], [130 x [11000 x i8]], [130 x i8], %"class.std::queue" }
%"struct.std::pair" = type { i32, i32 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"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 }

@tree = external dso_local global %struct.SteinerTree, align 8
@A = external dso_local global [130 x [130 x i32]], align 16
@weight = external dso_local global [130 x i32], align 16
@dr = external dso_local local_unnamed_addr global [4 x i32], align 16
@dc = external dso_local local_unnamed_addr global [4 x i32], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  %.pre114 = load i32, ptr %2, align 4, !tbaa !5
  %9 = icmp sgt i32 %.pre114, 0
  %or.cond = select i1 %8, i1 %9, i1 false
  br i1 %or.cond, label %.preheader74, label %._crit_edge82

.preheader74:                                     ; preds = %0, %._crit_edge
  %10 = phi i32 [ %15, %._crit_edge ], [ %7, %0 ]
  %11 = phi i32 [ %16, %._crit_edge ], [ %.pre114, %0 ]
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %._crit_edge ], [ 0, %0 ]
  %.05081 = phi i32 [ %.1.lcssa, %._crit_edge ], [ -1, %0 ]
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader74
  %13 = trunc nuw nsw i64 %indvars.iv101 to i32
  br label %19

._crit_edge82:                                    ; preds = %._crit_edge, %0
  %14 = phi i32 [ %.pre114, %0 ], [ %16, %._crit_edge ]
  %.050.lcssa = phi i32 [ -1, %0 ], [ %.1.lcssa, %._crit_edge ]
  %.lcssa = phi i32 [ %7, %0 ], [ %15, %._crit_edge ]
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %42 unwind label %52

._crit_edge.loopexit:                             ; preds = %38
  %.pre113 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader74
  %15 = phi i32 [ %10, %.preheader74 ], [ %.pre113, %._crit_edge.loopexit ]
  %16 = phi i32 [ %11, %.preheader74 ], [ %39, %._crit_edge.loopexit ]
  %.1.lcssa = phi i32 [ %.05081, %.preheader74 ], [ %.2, %._crit_edge.loopexit ]
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %17 = sext i32 %15 to i64
  %18 = icmp slt i64 %indvars.iv.next102, %17
  br i1 %18, label %.preheader74, label %._crit_edge82, !llvm.loop !9

19:                                               ; preds = %.lr.ph, %38
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %38 ]
  %.179 = phi i32 [ %.05081, %.lr.ph ], [ %.2, %38 ]
  %20 = getelementptr inbounds [130 x [130 x i32]], ptr @A, i64 0, i64 %indvars.iv101, i64 %indvars.iv
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %20)
  %22 = load i32, ptr %20, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = mul nsw i32 %23, %13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = trunc nuw nsw i64 %indvars.iv.next to i32
  %26 = add i32 %24, %25
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [130 x i32], ptr @weight, i64 0, i64 %27
  store i32 %22, ptr %28, align 4, !tbaa !5
  %29 = icmp eq i32 %22, 0
  br i1 %29, label %30, label %38

30:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  store i32 %26, ptr %4, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %31 unwind label %36

31:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %32 = icmp eq i32 %.179, -1
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br i1 %32, label %33, label %38

33:                                               ; preds = %31
  %34 = mul nsw i32 %.pre, %13
  %35 = add i32 %34, %25
  br label %38

36:                                               ; preds = %30
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  br label %168

38:                                               ; preds = %19, %33, %31
  %39 = phi i32 [ %.pre, %33 ], [ %.pre, %31 ], [ %23, %19 ]
  %.2 = phi i32 [ %35, %33 ], [ %.179, %31 ], [ %.179, %19 ]
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next, %40
  br i1 %41, label %19, label %._crit_edge.loopexit, !llvm.loop !12

42:                                               ; preds = %._crit_edge82
  %43 = mul nsw i32 %14, %.lcssa
  invoke void @_ZN11SteinerTree4initEiPiSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(18609384) @tree, i32 noundef %43, ptr noundef nonnull @weight, ptr noundef nonnull %5)
          to label %44 unwind label %54

44:                                               ; preds = %42
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %45 = load i32, ptr %1, align 4, !tbaa !5
  %46 = icmp sgt i32 %45, 0
  %47 = load i32, ptr %2, align 4
  %48 = icmp sgt i32 %47, 0
  %or.cond143 = select i1 %46, i1 %48, i1 false
  br i1 %or.cond143, label %.preheader73, label %._crit_edge90

.preheader73:                                     ; preds = %44, %._crit_edge88
  %.pre119.pre123.pre125127 = phi i32 [ %.pre119.pre123.pre125128, %._crit_edge88 ], [ %47, %44 ]
  %49 = phi i32 [ %65, %._crit_edge88 ], [ %45, %44 ]
  %50 = phi i32 [ %66, %._crit_edge88 ], [ %47, %44 ]
  %.05389 = phi i32 [ %67, %._crit_edge88 ], [ 0, %44 ]
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.preheader72, label %._crit_edge88

._crit_edge90:                                    ; preds = %._crit_edge88, %44
  invoke void @_ZN11SteinerTree5solveEv(ptr noundef nonnull align 8 dereferenceable(18609384) @tree)
          to label %119 unwind label %52

52:                                               ; preds = %119, %._crit_edge90, %._crit_edge82
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %168

54:                                               ; preds = %42
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %168

.preheader72:                                     ; preds = %.preheader73, %117
  %.pre119.pre123.pre125129 = phi i32 [ %.pre119.pre123.pre125130, %117 ], [ %.pre119.pre123.pre125127, %.preheader73 ]
  %56 = phi i32 [ %.pre119.pre123.pre125130, %117 ], [ %50, %.preheader73 ]
  %.05287 = phi i32 [ %57, %117 ], [ 0, %.preheader73 ]
  %57 = add nuw nsw i32 %.05287, 1
  %58 = load i32, ptr @dr, align 16, !tbaa !5
  %59 = add nsw i32 %58, %.05389
  %60 = load i32, ptr @dc, align 16, !tbaa !5
  %61 = add nsw i32 %60, %.05287
  %62 = icmp sgt i32 %59, -1
  %63 = icmp sgt i32 %61, -1
  %or.cond.not70 = select i1 %62, i1 %63, i1 false
  %64 = load i32, ptr %1, align 4
  %.not64 = icmp slt i32 %59, %64
  %or.cond67 = select i1 %or.cond.not70, i1 %.not64, i1 false
  %.not65 = icmp slt i32 %61, %56
  %or.cond138 = select i1 %or.cond67, i1 %.not65, i1 false
  br i1 %or.cond138, label %69, label %75

._crit_edge88.loopexit:                           ; preds = %117
  %.pre120 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge88

._crit_edge88:                                    ; preds = %._crit_edge88.loopexit, %.preheader73
  %.pre119.pre123.pre125128 = phi i32 [ %.pre119.pre123.pre125130, %._crit_edge88.loopexit ], [ %.pre119.pre123.pre125127, %.preheader73 ]
  %65 = phi i32 [ %.pre120, %._crit_edge88.loopexit ], [ %49, %.preheader73 ]
  %66 = phi i32 [ %.pre119.pre123.pre125130, %._crit_edge88.loopexit ], [ %50, %.preheader73 ]
  %67 = add nuw nsw i32 %.05389, 1
  %68 = icmp slt i32 %67, %65
  br i1 %68, label %.preheader73, label %._crit_edge90, !llvm.loop !13

69:                                               ; preds = %.preheader72
  %70 = mul nsw i32 %56, %.05389
  %71 = add i32 %57, %70
  %72 = mul nsw i32 %56, %59
  %73 = add nuw nsw i32 %61, 1
  %74 = add nuw nsw i32 %73, %72
  call void @_ZN11SteinerTree8add_edgeEii(ptr noundef nonnull align 8 dereferenceable(18609384) @tree, i32 noundef %71, i32 noundef %74)
  %.pre115 = load i32, ptr %1, align 4
  %.pre119.pre123.pre125.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %.preheader72, %69
  %.pre119.pre123.pre125 = phi i32 [ %.pre119.pre123.pre125129, %.preheader72 ], [ %.pre119.pre123.pre125.pre, %69 ]
  %76 = phi i32 [ %64, %.preheader72 ], [ %.pre115, %69 ]
  %77 = load i32, ptr getelementptr inbounds (i8, ptr @dr, i64 4), align 4, !tbaa !5
  %78 = add nsw i32 %77, %.05389
  %79 = load i32, ptr getelementptr inbounds (i8, ptr @dc, i64 4), align 4, !tbaa !5
  %80 = add nsw i32 %79, %.05287
  %81 = icmp sgt i32 %78, -1
  %82 = icmp sgt i32 %80, -1
  %or.cond.not70.1 = select i1 %81, i1 %82, i1 false
  %.not64.1 = icmp slt i32 %78, %76
  %or.cond67.1 = select i1 %or.cond.not70.1, i1 %.not64.1, i1 false
  %.not65.1 = icmp slt i32 %80, %.pre119.pre123.pre125
  %or.cond139 = select i1 %or.cond67.1, i1 %.not65.1, i1 false
  br i1 %or.cond139, label %83, label %89

83:                                               ; preds = %75
  %84 = mul nsw i32 %.pre119.pre123.pre125, %.05389
  %85 = add i32 %57, %84
  %86 = mul nsw i32 %.pre119.pre123.pre125, %78
  %87 = add nuw nsw i32 %80, 1
  %88 = add nuw nsw i32 %87, %86
  call void @_ZN11SteinerTree8add_edgeEii(ptr noundef nonnull align 8 dereferenceable(18609384) @tree, i32 noundef %85, i32 noundef %88)
  %.pre116 = load i32, ptr %1, align 4
  %.pre119.pre123.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %83, %75
  %.pre119.pre123.pre125132 = phi i32 [ %.pre119.pre123.pre, %83 ], [ %.pre119.pre123.pre125, %75 ]
  %90 = phi i32 [ %.pre116, %83 ], [ %76, %75 ]
  %91 = load i32, ptr getelementptr inbounds (i8, ptr @dr, i64 8), align 8, !tbaa !5
  %92 = add nsw i32 %91, %.05389
  %93 = load i32, ptr getelementptr inbounds (i8, ptr @dc, i64 8), align 8, !tbaa !5
  %94 = add nsw i32 %93, %.05287
  %95 = icmp sgt i32 %92, -1
  %96 = icmp sgt i32 %94, -1
  %or.cond.not70.2 = select i1 %95, i1 %96, i1 false
  %.not64.2 = icmp slt i32 %92, %90
  %or.cond67.2 = select i1 %or.cond.not70.2, i1 %.not64.2, i1 false
  %.not65.2 = icmp slt i32 %94, %.pre119.pre123.pre125132
  %or.cond140 = select i1 %or.cond67.2, i1 %.not65.2, i1 false
  br i1 %or.cond140, label %97, label %103

97:                                               ; preds = %89
  %98 = mul nsw i32 %.pre119.pre123.pre125132, %.05389
  %99 = add i32 %57, %98
  %100 = mul nsw i32 %.pre119.pre123.pre125132, %92
  %101 = add nuw nsw i32 %94, 1
  %102 = add nuw nsw i32 %101, %100
  call void @_ZN11SteinerTree8add_edgeEii(ptr noundef nonnull align 8 dereferenceable(18609384) @tree, i32 noundef %99, i32 noundef %102)
  %.pre117 = load i32, ptr %1, align 4
  %.pre119.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %97, %89
  %.pre119.pre123.pre125131 = phi i32 [ %.pre119.pre, %97 ], [ %.pre119.pre123.pre125132, %89 ]
  %104 = phi i32 [ %.pre117, %97 ], [ %90, %89 ]
  %105 = load i32, ptr getelementptr inbounds (i8, ptr @dr, i64 12), align 4, !tbaa !5
  %106 = add nsw i32 %105, %.05389
  %107 = load i32, ptr getelementptr inbounds (i8, ptr @dc, i64 12), align 4, !tbaa !5
  %108 = add nsw i32 %107, %.05287
  %109 = icmp sgt i32 %106, -1
  %110 = icmp sgt i32 %108, -1
  %or.cond.not70.3 = select i1 %109, i1 %110, i1 false
  %.not64.3 = icmp slt i32 %106, %104
  %or.cond67.3 = select i1 %or.cond.not70.3, i1 %.not64.3, i1 false
  %.not65.3 = icmp slt i32 %108, %.pre119.pre123.pre125131
  %or.cond141 = select i1 %or.cond67.3, i1 %.not65.3, i1 false
  br i1 %or.cond141, label %111, label %117

111:                                              ; preds = %103
  %112 = mul nsw i32 %.pre119.pre123.pre125131, %.05389
  %113 = add i32 %57, %112
  %114 = mul nsw i32 %.pre119.pre123.pre125131, %106
  %115 = add nuw nsw i32 %108, 1
  %116 = add nuw nsw i32 %115, %114
  call void @_ZN11SteinerTree8add_edgeEii(ptr noundef nonnull align 8 dereferenceable(18609384) @tree, i32 noundef %113, i32 noundef %116)
  %.pre118 = load i32, ptr %2, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %111, %103
  %.pre119.pre123.pre125130 = phi i32 [ %.pre118, %111 ], [ %.pre119.pre123.pre125131, %103 ]
  %118 = icmp slt i32 %57, %.pre119.pre123.pre125130
  br i1 %118, label %.preheader72, label %._crit_edge88.loopexit, !llvm.loop !14

119:                                              ; preds = %._crit_edge90
  %120 = sext i32 %.050.lcssa to i64
  %121 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %122 = trunc i64 %121 to i32
  %notmask = shl nsw i32 -1, %122
  %123 = xor i32 %notmask, -1
  %124 = zext nneg i32 %123 to i64
  %125 = getelementptr inbounds [130 x [11000 x i32]], ptr getelementptr inbounds (i8, ptr @tree, i64 8), i64 0, i64 %120, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %126)
  %128 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %129 = trunc i64 %128 to i32
  %notmask63 = shl nsw i32 -1, %129
  %130 = xor i32 %notmask63, -1
  invoke void @_ZN11SteinerTree3dfsEii(ptr noundef nonnull align 8 dereferenceable(18609384) @tree, i32 noundef %.050.lcssa, i32 noundef %130)
          to label %.preheader71 unwind label %52

.preheader71:                                     ; preds = %119
  %131 = load i32, ptr %1, align 4, !tbaa !5
  %132 = icmp sgt i32 %131, 0
  %133 = load i32, ptr %2, align 4
  %134 = icmp sgt i32 %133, 0
  %or.cond145 = select i1 %132, i1 %134, i1 false
  br i1 %or.cond145, label %.preheader, label %._crit_edge95

.preheader:                                       ; preds = %.preheader71, %._crit_edge93
  %135 = phi i32 [ %139, %._crit_edge93 ], [ %131, %.preheader71 ]
  %136 = phi i32 [ %140, %._crit_edge93 ], [ %133, %.preheader71 ]
  %indvars.iv110 = phi i64 [ %indvars.iv.next111, %._crit_edge93 ], [ 0, %.preheader71 ]
  %137 = icmp sgt i32 %136, 0
  br i1 %137, label %.lr.ph92, label %._crit_edge93

.lr.ph92:                                         ; preds = %.preheader
  %138 = trunc nuw nsw i64 %indvars.iv110 to i32
  br label %143

._crit_edge95:                                    ; preds = %._crit_edge93, %.preheader71
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

._crit_edge93.loopexit:                           ; preds = %164
  %.pre122 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge93

._crit_edge93:                                    ; preds = %._crit_edge93.loopexit, %.preheader
  %139 = phi i32 [ %.pre122, %._crit_edge93.loopexit ], [ %135, %.preheader ]
  %140 = phi i32 [ %165, %._crit_edge93.loopexit ], [ %136, %.preheader ]
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %141 = sext i32 %139 to i64
  %142 = icmp slt i64 %indvars.iv.next111, %141
  br i1 %142, label %.preheader, label %._crit_edge95, !llvm.loop !15

143:                                              ; preds = %.lr.ph92, %164
  %indvars.iv107 = phi i64 [ 0, %.lr.ph92 ], [ %indvars.iv.next108, %164 ]
  %144 = phi i32 [ %136, %.lr.ph92 ], [ %165, %164 ]
  %145 = getelementptr inbounds [130 x [130 x i32]], ptr @A, i64 0, i64 %indvars.iv110, i64 %indvars.iv107
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %.not = icmp eq i32 %146, 0
  br i1 %.not, label %156, label %147

147:                                              ; preds = %143
  %148 = mul nsw i32 %144, %138
  %149 = trunc i64 %indvars.iv107 to i32
  %150 = add i32 %149, 1
  %151 = add i32 %150, %148
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [130 x i8], ptr getelementptr inbounds (i8, ptr @tree, i64 18609172), i64 0, i64 %152
  %154 = load i8, ptr %153, align 1, !tbaa !16, !range !18, !noundef !19
  %155 = trunc nuw i8 %154 to i1
  %.str.5..str.6 = select i1 %155, ptr @.str.5, ptr @.str.6
  br label %156

156:                                              ; preds = %147, %143
  %.str.5.sink = phi ptr [ @.str.4, %143 ], [ %.str.5..str.6, %147 ]
  %157 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink)
  %158 = load i32, ptr %2, align 4, !tbaa !5
  %159 = add nsw i32 %158, -1
  %160 = zext i32 %159 to i64
  %161 = icmp eq i64 %indvars.iv107, %160
  br i1 %161, label %162, label %164

162:                                              ; preds = %156
  %163 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %.pre121 = load i32, ptr %2, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %156, %162
  %165 = phi i32 [ %158, %156 ], [ %.pre121, %162 ]
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %166 = sext i32 %165 to i64
  %167 = icmp slt i64 %indvars.iv.next108, %166
  br i1 %167, label %143, label %._crit_edge93.loopexit, !llvm.loop !20

168:                                              ; preds = %54, %52, %36
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %53, %52 ], [ %55, %54 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn
}

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 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 uwtable
declare dso_local void @_ZN11SteinerTree4initEiPiSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(18609384), i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11SteinerTree8add_edgeEii(ptr noundef nonnull align 8 dereferenceable(18609384), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11SteinerTree3dfsEii(ptr noundef nonnull align 8 dereferenceable(18609384), i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

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


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