; LLVM IR from ShahjalalShohag/code-library :: Graph Theory (Minimum Cost Vertex Cover General Graph)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@g = external dso_local global [42 x [42 x i32]], align 16
@c = external dso_local global [42 x i32], align 16
@cost = external dso_local global [1048576 x i32], align 16
@dp = external dso_local global [1048576 x i32], align 16
@need = external dso_local global [1048576 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %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 i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %24 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %25 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %26 = getelementptr i8, ptr %25, i64 -24
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %27
  %29 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %28, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %32

32:                                               ; preds = %79, %0
  %33 = load i32, ptr %5, align 4, !tbaa !8
  %34 = load i32, ptr %2, align 4, !tbaa !8
  %35 = icmp sle i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %82

37:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %39 = load i32, ptr %6, align 4, !tbaa !8
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %6, align 4, !tbaa !8
  %41 = load i32, ptr %5, align 4, !tbaa !8
  %42 = icmp eq i32 %41, 1
  br i1 %42, label %43, label %50

43:                                               ; preds = %37
  %44 = load i32, ptr %6, align 4, !tbaa !8
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %45
  %47 = load i32, ptr %6, align 4, !tbaa !8
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [42 x i32], ptr %46, i64 0, i64 %48
  store i32 1, ptr %49, align 4, !tbaa !8
  br label %50

50:                                               ; preds = %43, %37
  %51 = load i32, ptr %5, align 4, !tbaa !8
  %52 = load i32, ptr %2, align 4, !tbaa !8
  %53 = icmp eq i32 %51, %52
  br i1 %53, label %54, label %61

54:                                               ; preds = %50
  %55 = load i32, ptr %6, align 4, !tbaa !8
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %56
  %58 = load i32, ptr %6, align 4, !tbaa !8
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [42 x i32], ptr %57, i64 0, i64 %59
  store i32 1, ptr %60, align 4, !tbaa !8
  br label %61

61:                                               ; preds = %54, %50
  %62 = load i32, ptr %5, align 4, !tbaa !8
  %63 = icmp sgt i32 %62, 1
  br i1 %63, label %64, label %77

64:                                               ; preds = %61
  %65 = load i32, ptr %4, align 4, !tbaa !8
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %66
  %68 = load i32, ptr %6, align 4, !tbaa !8
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [42 x i32], ptr %67, i64 0, i64 %69
  store i32 1, ptr %70, align 4, !tbaa !8
  %71 = load i32, ptr %6, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %72
  %74 = load i32, ptr %4, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [42 x i32], ptr %73, i64 0, i64 %75
  store i32 1, ptr %76, align 4, !tbaa !8
  br label %77

77:                                               ; preds = %64, %61
  %78 = load i32, ptr %6, align 4, !tbaa !8
  store i32 %78, ptr %4, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %79

79:                                               ; preds = %77
  %80 = load i32, ptr %5, align 4, !tbaa !8
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %5, align 4, !tbaa !8
  br label %32, !llvm.loop !11

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

83:                                               ; preds = %93, %82
  %84 = load i32, ptr %7, align 4, !tbaa !8
  %85 = load i32, ptr %3, align 4, !tbaa !8
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %88, label %87

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

88:                                               ; preds = %83
  %89 = load i32, ptr %7, align 4, !tbaa !8
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [42 x i32], ptr @c, i64 0, i64 %90
  %92 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %91)
  br label %93

93:                                               ; preds = %88
  %94 = load i32, ptr %7, align 4, !tbaa !8
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %7, align 4, !tbaa !8
  br label %83, !llvm.loop !13

96:                                               ; preds = %87
  %97 = load i32, ptr %3, align 4, !tbaa !8
  %98 = icmp eq i32 %97, 1
  br i1 %98, label %99, label %103

99:                                               ; preds = %96
  %100 = load i32, ptr @c, align 16, !tbaa !8
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %100)
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %101, i8 noundef signext 10)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %368

103:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %104 = load i32, ptr %3, align 4, !tbaa !8
  %105 = sdiv i32 %104, 2
  store i32 %105, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %106 = load i32, ptr %3, align 4, !tbaa !8
  %107 = load i32, ptr %3, align 4, !tbaa !8
  %108 = sdiv i32 %107, 2
  %109 = sub nsw i32 %106, %108
  store i32 %109, ptr %10, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !8
  br label %110

110:                                              ; preds = %208, %103
  %111 = load i32, ptr %11, align 4, !tbaa !8
  %112 = load i32, ptr %9, align 4, !tbaa !8
  %113 = shl i32 1, %112
  %114 = icmp slt i32 %111, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %110
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %211

116:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  store i8 1, ptr %12, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %117

117:                                              ; preds = %197, %116
  %118 = load i32, ptr %13, align 4, !tbaa !8
  %119 = load i32, ptr %9, align 4, !tbaa !8
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %117
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %200

122:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !8
  br label %123

123:                                              ; preds = %177, %122
  %124 = load i32, ptr %14, align 4, !tbaa !8
  %125 = load i32, ptr %3, align 4, !tbaa !8
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %180

128:                                              ; preds = %123
  %129 = load i32, ptr %13, align 4, !tbaa !8
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %130
  %132 = load i32, ptr %14, align 4, !tbaa !8
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [42 x i32], ptr %131, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !8
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %176

137:                                              ; preds = %128
  %138 = load i32, ptr %14, align 4, !tbaa !8
  %139 = load i32, ptr %9, align 4, !tbaa !8
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %141, label %157

141:                                              ; preds = %137
  %142 = load i32, ptr %11, align 4, !tbaa !8
  %143 = xor i32 %142, -1
  %144 = load i32, ptr %13, align 4, !tbaa !8
  %145 = ashr i32 %143, %144
  %146 = and i32 %145, 1
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %148, label %156

148:                                              ; preds = %141
  %149 = load i32, ptr %11, align 4, !tbaa !8
  %150 = xor i32 %149, -1
  %151 = load i32, ptr %14, align 4, !tbaa !8
  %152 = ashr i32 %150, %151
  %153 = and i32 %152, 1
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %155, label %156

155:                                              ; preds = %148
  store i8 0, ptr %12, align 1, !tbaa !14
  br label %156

156:                                              ; preds = %155, %148, %141
  br label %175

157:                                              ; preds = %137
  %158 = load i32, ptr %11, align 4, !tbaa !8
  %159 = xor i32 %158, -1
  %160 = load i32, ptr %13, align 4, !tbaa !8
  %161 = ashr i32 %159, %160
  %162 = and i32 %161, 1
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %164, label %174

164:                                              ; preds = %157
  %165 = load i32, ptr %14, align 4, !tbaa !8
  %166 = load i32, ptr %9, align 4, !tbaa !8
  %167 = sub nsw i32 %165, %166
  %168 = shl i32 1, %167
  %169 = load i32, ptr %11, align 4, !tbaa !8
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [1048576 x i32], ptr @need, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !8
  %173 = or i32 %172, %168
  store i32 %173, ptr %171, align 4, !tbaa !8
  br label %174

174:                                              ; preds = %164, %157
  br label %175

175:                                              ; preds = %174, %156
  br label %176

176:                                              ; preds = %175, %128
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %14, align 4, !tbaa !8
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %14, align 4, !tbaa !8
  br label %123, !llvm.loop !16

180:                                              ; preds = %127
  %181 = load i32, ptr %11, align 4, !tbaa !8
  %182 = load i32, ptr %13, align 4, !tbaa !8
  %183 = ashr i32 %181, %182
  %184 = and i32 %183, 1
  %185 = icmp ne i32 %184, 0
  br i1 %185, label %186, label %196

186:                                              ; preds = %180
  %187 = load i32, ptr %13, align 4, !tbaa !8
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [42 x i32], ptr @c, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !8
  %191 = load i32, ptr %11, align 4, !tbaa !8
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [1048576 x i32], ptr @cost, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !8
  %195 = add nsw i32 %194, %190
  store i32 %195, ptr %193, align 4, !tbaa !8
  br label %196

196:                                              ; preds = %186, %180
  br label %197

197:                                              ; preds = %196
  %198 = load i32, ptr %13, align 4, !tbaa !8
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %13, align 4, !tbaa !8
  br label %117, !llvm.loop !17

200:                                              ; preds = %121
  %201 = load i8, ptr %12, align 1, !tbaa !14, !range !18, !noundef !19
  %202 = trunc i8 %201 to i1
  br i1 %202, label %207, label %203

203:                                              ; preds = %200
  %204 = load i32, ptr %11, align 4, !tbaa !8
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [1048576 x i32], ptr @cost, i64 0, i64 %205
  store i32 1000000000, ptr %206, align 4, !tbaa !8
  br label %207

207:                                              ; preds = %203, %200
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  br label %208

208:                                              ; preds = %207
  %209 = load i32, ptr %11, align 4, !tbaa !8
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %11, align 4, !tbaa !8
  br label %110, !llvm.loop !20

211:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !8
  br label %212

212:                                              ; preds = %293, %211
  %213 = load i32, ptr %15, align 4, !tbaa !8
  %214 = load i32, ptr %10, align 4, !tbaa !8
  %215 = shl i32 1, %214
  %216 = icmp slt i32 %213, %215
  br i1 %216, label %218, label %217

217:                                              ; preds = %212
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %296

218:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #6
  store i8 1, ptr %16, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !8
  br label %219

219:                                              ; preds = %282, %218
  %220 = load i32, ptr %17, align 4, !tbaa !8
  %221 = load i32, ptr %10, align 4, !tbaa !8
  %222 = icmp slt i32 %220, %221
  br i1 %222, label %224, label %223

223:                                              ; preds = %219
  store i32 20, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %285

224:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !8
  br label %225

225:                                              ; preds = %260, %224
  %226 = load i32, ptr %18, align 4, !tbaa !8
  %227 = load i32, ptr %10, align 4, !tbaa !8
  %228 = icmp slt i32 %226, %227
  br i1 %228, label %230, label %229

229:                                              ; preds = %225
  store i32 23, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %263

230:                                              ; preds = %225
  %231 = load i32, ptr %17, align 4, !tbaa !8
  %232 = load i32, ptr %9, align 4, !tbaa !8
  %233 = add nsw i32 %231, %232
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %234
  %236 = load i32, ptr %18, align 4, !tbaa !8
  %237 = load i32, ptr %9, align 4, !tbaa !8
  %238 = add nsw i32 %236, %237
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [42 x i32], ptr %235, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !8
  %242 = icmp ne i32 %241, 0
  br i1 %242, label %243, label %259

243:                                              ; preds = %230
  %244 = load i32, ptr %15, align 4, !tbaa !8
  %245 = xor i32 %244, -1
  %246 = load i32, ptr %17, align 4, !tbaa !8
  %247 = ashr i32 %245, %246
  %248 = and i32 %247, 1
  %249 = icmp ne i32 %248, 0
  br i1 %249, label %250, label %258

250:                                              ; preds = %243
  %251 = load i32, ptr %15, align 4, !tbaa !8
  %252 = xor i32 %251, -1
  %253 = load i32, ptr %18, align 4, !tbaa !8
  %254 = ashr i32 %252, %253
  %255 = and i32 %254, 1
  %256 = icmp ne i32 %255, 0
  br i1 %256, label %257, label %258

257:                                              ; preds = %250
  store i8 0, ptr %16, align 1, !tbaa !14
  br label %258

258:                                              ; preds = %257, %250, %243
  br label %259

259:                                              ; preds = %258, %230
  br label %260

260:                                              ; preds = %259
  %261 = load i32, ptr %18, align 4, !tbaa !8
  %262 = add nsw i32 %261, 1
  store i32 %262, ptr %18, align 4, !tbaa !8
  br label %225, !llvm.loop !21

263:                                              ; preds = %229
  %264 = load i32, ptr %15, align 4, !tbaa !8
  %265 = load i32, ptr %17, align 4, !tbaa !8
  %266 = ashr i32 %264, %265
  %267 = and i32 %266, 1
  %268 = icmp ne i32 %267, 0
  br i1 %268, label %269, label %281

269:                                              ; preds = %263
  %270 = load i32, ptr %17, align 4, !tbaa !8
  %271 = load i32, ptr %9, align 4, !tbaa !8
  %272 = add nsw i32 %270, %271
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [42 x i32], ptr @c, i64 0, i64 %273
  %275 = load i32, ptr %274, align 4, !tbaa !8
  %276 = load i32, ptr %15, align 4, !tbaa !8
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [1048576 x i32], ptr @dp, i64 0, i64 %277
  %279 = load i32, ptr %278, align 4, !tbaa !8
  %280 = add nsw i32 %279, %275
  store i32 %280, ptr %278, align 4, !tbaa !8
  br label %281

281:                                              ; preds = %269, %263
  br label %282

282:                                              ; preds = %281
  %283 = load i32, ptr %17, align 4, !tbaa !8
  %284 = add nsw i32 %283, 1
  store i32 %284, ptr %17, align 4, !tbaa !8
  br label %219, !llvm.loop !22

285:                                              ; preds = %223
  %286 = load i8, ptr %16, align 1, !tbaa !14, !range !18, !noundef !19
  %287 = trunc i8 %286 to i1
  br i1 %287, label %292, label %288

288:                                              ; preds = %285
  %289 = load i32, ptr %15, align 4, !tbaa !8
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [1048576 x i32], ptr @dp, i64 0, i64 %290
  store i32 1000000000, ptr %291, align 4, !tbaa !8
  br label %292

292:                                              ; preds = %288, %285
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  br label %293

293:                                              ; preds = %292
  %294 = load i32, ptr %15, align 4, !tbaa !8
  %295 = add nsw i32 %294, 1
  store i32 %295, ptr %15, align 4, !tbaa !8
  br label %212, !llvm.loop !23

296:                                              ; preds = %217
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !8
  br label %297

297:                                              ; preds = %336, %296
  %298 = load i32, ptr %19, align 4, !tbaa !8
  %299 = load i32, ptr %10, align 4, !tbaa !8
  %300 = icmp slt i32 %298, %299
  br i1 %300, label %302, label %301

301:                                              ; preds = %297
  store i32 26, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %339

302:                                              ; preds = %297
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %303 = load i32, ptr %10, align 4, !tbaa !8
  %304 = shl i32 1, %303
  %305 = sub nsw i32 %304, 1
  store i32 %305, ptr %20, align 4, !tbaa !8
  br label %306

306:                                              ; preds = %332, %302
  %307 = load i32, ptr %20, align 4, !tbaa !8
  %308 = icmp sge i32 %307, 0
  br i1 %308, label %310, label %309

309:                                              ; preds = %306
  store i32 29, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %335

310:                                              ; preds = %306
  %311 = load i32, ptr %20, align 4, !tbaa !8
  %312 = load i32, ptr %19, align 4, !tbaa !8
  %313 = shl i32 1, %312
  %314 = and i32 %311, %313
  %315 = icmp eq i32 %314, 0
  br i1 %315, label %316, label %331

316:                                              ; preds = %310
  %317 = load i32, ptr %20, align 4, !tbaa !8
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [1048576 x i32], ptr @dp, i64 0, i64 %318
  %320 = load i32, ptr %20, align 4, !tbaa !8
  %321 = load i32, ptr %19, align 4, !tbaa !8
  %322 = shl i32 1, %321
  %323 = xor i32 %320, %322
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [1048576 x i32], ptr @dp, i64 0, i64 %324
  %326 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %319, ptr noundef nonnull align 4 dereferenceable(4) %325)
  %327 = load i32, ptr %326, align 4, !tbaa !8
  %328 = load i32, ptr %20, align 4, !tbaa !8
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [1048576 x i32], ptr @dp, i64 0, i64 %329
  store i32 %327, ptr %330, align 4, !tbaa !8
  br label %331

331:                                              ; preds = %316, %310
  br label %332

332:                                              ; preds = %331
  %333 = load i32, ptr %20, align 4, !tbaa !8
  %334 = add nsw i32 %333, -1
  store i32 %334, ptr %20, align 4, !tbaa !8
  br label %306, !llvm.loop !24

335:                                              ; preds = %309
  br label %336

336:                                              ; preds = %335
  %337 = load i32, ptr %19, align 4, !tbaa !8
  %338 = add nsw i32 %337, 1
  store i32 %338, ptr %19, align 4, !tbaa !8
  br label %297, !llvm.loop !25

339:                                              ; preds = %301
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 1000000000, ptr %21, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !8
  br label %340

340:                                              ; preds = %361, %339
  %341 = load i32, ptr %22, align 4, !tbaa !8
  %342 = load i32, ptr %9, align 4, !tbaa !8
  %343 = shl i32 1, %342
  %344 = icmp slt i32 %341, %343
  br i1 %344, label %346, label %345

345:                                              ; preds = %340
  store i32 32, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %364

346:                                              ; preds = %340
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %347 = load i32, ptr %22, align 4, !tbaa !8
  %348 = sext i32 %347 to i64
  %349 = getelementptr inbounds [1048576 x i32], ptr @cost, i64 0, i64 %348
  %350 = load i32, ptr %349, align 4, !tbaa !8
  %351 = load i32, ptr %22, align 4, !tbaa !8
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [1048576 x i32], ptr @need, i64 0, i64 %352
  %354 = load i32, ptr %353, align 4, !tbaa !8
  %355 = sext i32 %354 to i64
  %356 = getelementptr inbounds [1048576 x i32], ptr @dp, i64 0, i64 %355
  %357 = load i32, ptr %356, align 4, !tbaa !8
  %358 = add nsw i32 %350, %357
  store i32 %358, ptr %23, align 4, !tbaa !8
  %359 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %23)
  %360 = load i32, ptr %359, align 4, !tbaa !8
  store i32 %360, ptr %21, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %361

361:                                              ; preds = %346
  %362 = load i32, ptr %22, align 4, !tbaa !8
  %363 = add nsw i32 %362, 1
  store i32 %363, ptr %22, align 4, !tbaa !8
  br label %340, !llvm.loop !26

364:                                              ; preds = %345
  %365 = load i32, ptr %21, align 4, !tbaa !8
  %366 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %365)
  %367 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %366, i8 noundef signext 10)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %368

368:                                              ; preds = %364, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %369 = load i32, ptr %1, align 4
  ret i32 %369
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

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

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !10, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@g = external dso_local local_unnamed_addr global [42 x [42 x i32]], align 16
@c = external dso_local global [42 x i32], align 16
@cost = external dso_local local_unnamed_addr global [1048576 x i32], align 16
@dp = external dso_local global [1048576 x i32], align 16
@need = external dso_local local_unnamed_addr global [1048576 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %14 = load i32, ptr %1, align 4, !tbaa !8
  %.not122 = icmp slt i32 %14, 1
  br i1 %.not122, label %.preheader119, label %15

15:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %17 = load i32, ptr %3, align 4, !tbaa !8
  %18 = add nsw i32 %17, -1
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %19, i64 %19
  store i32 1, ptr %20, align 4, !tbaa !8
  %21 = load i32, ptr %1, align 4, !tbaa !8
  %22 = icmp eq i32 %21, 1
  br i1 %22, label %.thread, label %25

.thread:                                          ; preds = %15
  %23 = sext i32 %18 to i64
  %24 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %23, i64 %23
  store i32 1, ptr %24, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %.preheader119

25:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %.not.not.peel = icmp sgt i32 %21, 1
  br i1 %.not.not.peel, label %.lr.ph.peel.next, label %.preheader119

.preheader119:                                    ; preds = %36, %25, %.thread, %0
  %26 = load i32, ptr %2, align 4, !tbaa !8
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph126, label %._crit_edge.thread

.lr.ph.peel.next:                                 ; preds = %25, %36
  %.092124 = phi i32 [ %30, %36 ], [ %18, %25 ]
  %.094123 = phi i32 [ %41, %36 ], [ 2, %25 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %29 = load i32, ptr %3, align 4, !tbaa !8
  %30 = add nsw i32 %29, -1
  %31 = load i32, ptr %1, align 4, !tbaa !8
  %32 = icmp eq i32 %.094123, %31
  br i1 %32, label %33, label %36

33:                                               ; preds = %.lr.ph.peel.next
  %34 = sext i32 %30 to i64
  %35 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %34, i64 %34
  store i32 1, ptr %35, align 4, !tbaa !8
  br label %36

36:                                               ; preds = %33, %.lr.ph.peel.next
  %37 = sext i32 %.092124 to i64
  %38 = sext i32 %30 to i64
  %39 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %37, i64 %38
  store i32 1, ptr %39, align 4, !tbaa !8
  %40 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %38, i64 %37
  store i32 1, ptr %40, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %41 = add nuw nsw i32 %.094123, 1
  %.not.not = icmp slt i32 %.094123, %31
  br i1 %.not.not, label %.lr.ph.peel.next, label %.preheader119, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph126
  %42 = icmp eq i32 %45, 1
  br i1 %42, label %48, label %._crit_edge.thread

.lr.ph126:                                        ; preds = %.preheader119, %.lr.ph126
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph126 ], [ 0, %.preheader119 ]
  %43 = getelementptr inbounds [42 x i32], ptr @c, i64 0, i64 %indvars.iv
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %43)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %45 = load i32, ptr %2, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next, %46
  br i1 %47, label %.lr.ph126, label %._crit_edge, !llvm.loop !14

48:                                               ; preds = %._crit_edge
  %49 = load i32, ptr @c, align 16, !tbaa !8
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %49)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %50, i8 noundef signext 10)
  br label %153

._crit_edge.thread:                               ; preds = %.preheader119, %._crit_edge
  %.lcssa121246 = phi i32 [ %45, %._crit_edge ], [ %26, %.preheader119 ]
  %52 = sdiv i32 %.lcssa121246, 2
  %53 = sub i32 %.lcssa121246, %52
  %54 = shl nuw i32 1, %52
  %55 = and i32 %.lcssa121246, -2
  %.not = icmp ne i32 %55, 62
  %56 = icmp sgt i32 %.lcssa121246, 1
  %or.cond = and i1 %.not, %56
  br i1 %or.cond, label %.preheader118.us.us.preheader, label %.preheader116

.preheader118.us.us.preheader:                    ; preds = %._crit_edge.thread
  %57 = zext nneg i32 %52 to i64
  %smax = call i32 @llvm.smax.i32(i32 %54, i32 1)
  %wide.trip.count215 = zext nneg i32 %smax to i64
  %wide.trip.count210 = zext nneg i32 %52 to i64
  %wide.trip.count206 = zext nneg i32 %.lcssa121246 to i64
  br label %.preheader118.us.us

.preheader118.us.us:                              ; preds = %.preheader118.us.us.preheader, %62
  %indvars.iv212 = phi i64 [ 0, %.preheader118.us.us.preheader ], [ %indvars.iv.next213, %62 ]
  %58 = getelementptr inbounds [1048576 x i32], ptr @need, i64 0, i64 %indvars.iv212
  %59 = getelementptr inbounds [1048576 x i32], ptr @cost, i64 0, i64 %indvars.iv212
  %60 = trunc nuw nsw i64 %indvars.iv212 to i32
  br label %.preheader117.us.us.us

61:                                               ; preds = %._crit_edge142.split.us.us.us
  store i32 1000000000, ptr %59, align 4, !tbaa !8
  br label %62

62:                                               ; preds = %._crit_edge142.split.us.us.us, %61
  %indvars.iv.next213 = add nuw nsw i64 %indvars.iv212, 1
  %exitcond216.not = icmp eq i64 %indvars.iv.next213, %wide.trip.count215
  br i1 %exitcond216.not, label %.preheader116, label %.preheader118.us.us, !llvm.loop !15

.preheader117.us.us.us:                           ; preds = %._crit_edge130.us.us.us, %.preheader118.us.us
  %indvars.iv208 = phi i64 [ %indvars.iv.next209, %._crit_edge130.us.us.us ], [ 0, %.preheader118.us.us ]
  %.087140.us.us.us = phi i1 [ %.us-phi.us.us.us250, %._crit_edge130.us.us.us ], [ true, %.preheader118.us.us ]
  %63 = trunc nuw nsw i64 %indvars.iv208 to i32
  %64 = shl nuw i32 1, %63
  %65 = and i32 %64, %60
  %.fr = freeze i32 %65
  %.not108.not.us.us.us = icmp eq i32 %.fr, 0
  br i1 %.not108.not.us.us.us, label %.lr.ph129.split.us.us.us.us, label %._crit_edge130.us.us.us.thread

._crit_edge130.us.us.us.thread:                   ; preds = %.preheader117.us.us.us
  %66 = getelementptr inbounds [42 x i32], ptr @c, i64 0, i64 %indvars.iv208
  %67 = load i32, ptr %66, align 4, !tbaa !8
  %68 = load i32, ptr %59, align 4, !tbaa !8
  %69 = add nsw i32 %68, %67
  store i32 %69, ptr %59, align 4, !tbaa !8
  br label %._crit_edge130.us.us.us

._crit_edge130.us.us.us:                          ; preds = %83, %._crit_edge130.us.us.us.thread
  %.us-phi.us.us.us250 = phi i1 [ %.087140.us.us.us, %._crit_edge130.us.us.us.thread ], [ %.289.us.us.us.us, %83 ]
  %indvars.iv.next209 = add nuw nsw i64 %indvars.iv208, 1
  %exitcond211.not = icmp eq i64 %indvars.iv.next209, %wide.trip.count210
  br i1 %exitcond211.not, label %._crit_edge142.split.us.us.us, label %.preheader117.us.us.us, !llvm.loop !16

.lr.ph129.split.us.us.us.us:                      ; preds = %.preheader117.us.us.us, %83
  %indvars.iv204 = phi i64 [ %indvars.iv.next205, %83 ], [ 0, %.preheader117.us.us.us ]
  %.188127.us.us.us.us = phi i1 [ %.289.us.us.us.us, %83 ], [ %.087140.us.us.us, %.preheader117.us.us.us ]
  %70 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %indvars.iv208, i64 %indvars.iv204
  %71 = load i32, ptr %70, align 4, !tbaa !8
  %.not106.us.us.us.us = icmp eq i32 %71, 0
  br i1 %.not106.us.us.us.us, label %83, label %72

72:                                               ; preds = %.lr.ph129.split.us.us.us.us
  %73 = icmp ult i64 %indvars.iv204, %57
  %74 = trunc i64 %indvars.iv204 to i32
  br i1 %73, label %80, label %75

75:                                               ; preds = %72
  %76 = sub i32 %74, %52
  %77 = shl nuw i32 1, %76
  %78 = load i32, ptr %58, align 4, !tbaa !8
  %79 = or i32 %78, %77
  store i32 %79, ptr %58, align 4, !tbaa !8
  br label %83

80:                                               ; preds = %72
  %81 = shl nuw i32 1, %74
  %82 = and i32 %81, %60
  %.not111.not.us.us.us.us = icmp ne i32 %82, 0
  %spec.select.us.us.us.us = select i1 %.not111.not.us.us.us.us, i1 %.188127.us.us.us.us, i1 false
  br label %83

83:                                               ; preds = %80, %75, %.lr.ph129.split.us.us.us.us
  %.289.us.us.us.us = phi i1 [ %.188127.us.us.us.us, %75 ], [ %.188127.us.us.us.us, %.lr.ph129.split.us.us.us.us ], [ %spec.select.us.us.us.us, %80 ]
  %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1
  %exitcond207.not = icmp eq i64 %indvars.iv.next205, %wide.trip.count206
  br i1 %exitcond207.not, label %._crit_edge130.us.us.us, label %.lr.ph129.split.us.us.us.us, !llvm.loop !17

._crit_edge142.split.us.us.us:                    ; preds = %._crit_edge130.us.us.us
  br i1 %.us-phi.us.us.us250, label %62, label %61

.preheader116:                                    ; preds = %62, %._crit_edge.thread
  %84 = shl nuw i32 1, %53
  %.not189 = icmp eq i32 %53, 31
  %85 = icmp sgt i32 %53, 0
  %or.cond258 = xor i1 %.not189, %85
  br i1 %or.cond258, label %.preheader115.us.preheader, label %._crit_edge183

.preheader115.us.preheader:                       ; preds = %.preheader116
  %86 = sext i32 %52 to i64
  %smax228 = call i32 @llvm.smax.i32(i32 %84, i32 1)
  %wide.trip.count229 = zext nneg i32 %smax228 to i64
  %wide.trip.count223 = zext i32 %53 to i64
  %xtraiter = and i64 %wide.trip.count223, 1
  %87 = icmp eq i32 %53, 1
  %unroll_iter = and i64 %wide.trip.count223, 4294967294
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader115.us

.preheader115.us:                                 ; preds = %.preheader115.us.preheader, %91
  %indvars.iv225 = phi i64 [ 0, %.preheader115.us.preheader ], [ %indvars.iv.next226, %91 ]
  %88 = getelementptr inbounds [1048576 x i32], ptr @dp, i64 0, i64 %indvars.iv225
  %89 = trunc nuw nsw i64 %indvars.iv225 to i32
  br label %.preheader114.us.us

90:                                               ; preds = %._crit_edge168.split.us.us
  store i32 1000000000, ptr %88, align 4, !tbaa !8
  br label %91

91:                                               ; preds = %90, %._crit_edge168.split.us.us
  %indvars.iv.next226 = add nuw nsw i64 %indvars.iv225, 1
  %exitcond230.not = icmp eq i64 %indvars.iv.next226, %wide.trip.count229
  br i1 %exitcond230.not, label %.preheader113, label %.preheader115.us, !llvm.loop !18

.preheader114.us.us:                              ; preds = %._crit_edge163.us.us, %.preheader115.us
  %indvars.iv221 = phi i64 [ %indvars.iv.next222, %._crit_edge163.us.us ], [ 0, %.preheader115.us ]
  %.083166.us.us = phi i1 [ %.us-phi165.us.us254, %._crit_edge163.us.us ], [ true, %.preheader115.us ]
  %92 = add nsw i64 %indvars.iv221, %86
  %93 = trunc nuw nsw i64 %indvars.iv221 to i32
  %94 = shl nuw i32 1, %93
  %95 = and i32 %94, %89
  %.fr190 = freeze i32 %95
  %.not102.not.us.us = icmp eq i32 %.fr190, 0
  br i1 %.not102.not.us.us, label %.lr.ph162.split.us.us.us.preheader, label %._crit_edge163.us.us.thread

.lr.ph162.split.us.us.us.preheader:               ; preds = %.preheader114.us.us
  br i1 %87, label %._crit_edge163.us.us.loopexit.unr-lcssa, label %.lr.ph162.split.us.us.us

._crit_edge163.us.us.thread:                      ; preds = %.preheader114.us.us
  %96 = getelementptr inbounds [42 x i32], ptr @c, i64 0, i64 %92
  %97 = load i32, ptr %96, align 4, !tbaa !8
  %98 = load i32, ptr %88, align 4, !tbaa !8
  %99 = add nsw i32 %98, %97
  store i32 %99, ptr %88, align 4, !tbaa !8
  br label %._crit_edge163.us.us

._crit_edge163.us.us.loopexit.unr-lcssa:          ; preds = %121, %.lr.ph162.split.us.us.us.preheader
  %.2.us.us.us.lcssa.ph = phi i1 [ poison, %.lr.ph162.split.us.us.us.preheader ], [ %.2.us.us.us.1, %121 ]
  %indvars.iv217.unr = phi i64 [ 0, %.lr.ph162.split.us.us.us.preheader ], [ %indvars.iv.next218.1, %121 ]
  %.1160.us.us.us.unr = phi i1 [ %.083166.us.us, %.lr.ph162.split.us.us.us.preheader ], [ %.2.us.us.us.1, %121 ]
  br i1 %lcmp.mod.not, label %._crit_edge163.us.us, label %.lr.ph162.split.us.us.us.epil

.lr.ph162.split.us.us.us.epil:                    ; preds = %._crit_edge163.us.us.loopexit.unr-lcssa
  %100 = add nsw i64 %indvars.iv217.unr, %86
  %101 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %92, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !8
  %.not101.us.us.us.epil = icmp eq i32 %102, 0
  br i1 %.not101.us.us.us.epil, label %._crit_edge163.us.us, label %103

103:                                              ; preds = %.lr.ph162.split.us.us.us.epil
  %104 = trunc nuw nsw i64 %indvars.iv217.unr to i32
  %105 = shl nuw i32 1, %104
  %106 = and i32 %105, %89
  %.not104.not.us.us.us.epil = icmp ne i32 %106, 0
  %spec.select112.us.us.us.epil = select i1 %.not104.not.us.us.us.epil, i1 %.1160.us.us.us.unr, i1 false
  br label %._crit_edge163.us.us

._crit_edge163.us.us:                             ; preds = %._crit_edge163.us.us.loopexit.unr-lcssa, %103, %.lr.ph162.split.us.us.us.epil, %._crit_edge163.us.us.thread
  %.us-phi165.us.us254 = phi i1 [ %.083166.us.us, %._crit_edge163.us.us.thread ], [ %.2.us.us.us.lcssa.ph, %._crit_edge163.us.us.loopexit.unr-lcssa ], [ %.1160.us.us.us.unr, %.lr.ph162.split.us.us.us.epil ], [ %spec.select112.us.us.us.epil, %103 ]
  %indvars.iv.next222 = add nuw nsw i64 %indvars.iv221, 1
  %exitcond224.not = icmp eq i64 %indvars.iv.next222, %wide.trip.count223
  br i1 %exitcond224.not, label %._crit_edge168.split.us.us, label %.preheader114.us.us, !llvm.loop !19

.lr.ph162.split.us.us.us:                         ; preds = %.lr.ph162.split.us.us.us.preheader, %121
  %indvars.iv217 = phi i64 [ %indvars.iv.next218.1, %121 ], [ 0, %.lr.ph162.split.us.us.us.preheader ]
  %.1160.us.us.us = phi i1 [ %.2.us.us.us.1, %121 ], [ %.083166.us.us, %.lr.ph162.split.us.us.us.preheader ]
  %niter = phi i64 [ %niter.next.1, %121 ], [ 0, %.lr.ph162.split.us.us.us.preheader ]
  %107 = add nsw i64 %indvars.iv217, %86
  %108 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %92, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !8
  %.not101.us.us.us = icmp eq i32 %109, 0
  br i1 %.not101.us.us.us, label %.lr.ph162.split.us.us.us.1, label %110

110:                                              ; preds = %.lr.ph162.split.us.us.us
  %111 = trunc nuw nsw i64 %indvars.iv217 to i32
  %112 = shl nuw i32 1, %111
  %113 = and i32 %112, %89
  %.not104.not.us.us.us = icmp ne i32 %113, 0
  %spec.select112.us.us.us = select i1 %.not104.not.us.us.us, i1 %.1160.us.us.us, i1 false
  br label %.lr.ph162.split.us.us.us.1

.lr.ph162.split.us.us.us.1:                       ; preds = %110, %.lr.ph162.split.us.us.us
  %.2.us.us.us = phi i1 [ %.1160.us.us.us, %.lr.ph162.split.us.us.us ], [ %spec.select112.us.us.us, %110 ]
  %indvars.iv.next218 = or disjoint i64 %indvars.iv217, 1
  %114 = add nsw i64 %indvars.iv.next218, %86
  %115 = getelementptr inbounds [42 x [42 x i32]], ptr @g, i64 0, i64 %92, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !8
  %.not101.us.us.us.1 = icmp eq i32 %116, 0
  br i1 %.not101.us.us.us.1, label %121, label %117

117:                                              ; preds = %.lr.ph162.split.us.us.us.1
  %118 = trunc nuw nsw i64 %indvars.iv.next218 to i32
  %119 = shl nuw i32 1, %118
  %120 = and i32 %119, %89
  %.not104.not.us.us.us.1 = icmp ne i32 %120, 0
  %spec.select112.us.us.us.1 = select i1 %.not104.not.us.us.us.1, i1 %.2.us.us.us, i1 false
  br label %121

121:                                              ; preds = %117, %.lr.ph162.split.us.us.us.1
  %.2.us.us.us.1 = phi i1 [ %.2.us.us.us, %.lr.ph162.split.us.us.us.1 ], [ %spec.select112.us.us.us.1, %117 ]
  %indvars.iv.next218.1 = add nuw nsw i64 %indvars.iv217, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge163.us.us.loopexit.unr-lcssa, label %.lr.ph162.split.us.us.us, !llvm.loop !20

._crit_edge168.split.us.us:                       ; preds = %._crit_edge163.us.us
  br i1 %.us-phi165.us.us254, label %91, label %90

.preheader113:                                    ; preds = %91
  %122 = icmp slt i32 %53, 1
  %brmerge = or i1 %122, %.not189
  br i1 %brmerge, label %._crit_edge183, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.preheader113
  %123 = zext i32 %84 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge181.us
  %.080182.us = phi i32 [ %139, %._crit_edge181.us ], [ 0, %.preheader.us.preheader ]
  %124 = shl nuw i32 1, %.080182.us
  br label %125

125:                                              ; preds = %.preheader.us, %136
  %indvars.iv231 = phi i64 [ %123, %.preheader.us ], [ %indvars.iv.next232, %136 ]
  %indvars.iv.next232 = add nsw i64 %indvars.iv231, -1
  %indvars = trunc i64 %indvars.iv.next232 to i32
  %126 = and i32 %124, %indvars
  %127 = icmp eq i32 %126, 0
  br i1 %127, label %128, label %136

128:                                              ; preds = %125
  %129 = and i64 %indvars.iv.next232, 4294967295
  %130 = getelementptr inbounds [1048576 x i32], ptr @dp, i64 0, i64 %129
  %131 = xor i32 %124, %indvars
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1048576 x i32], ptr @dp, i64 0, i64 %132
  %134 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %130, ptr noundef nonnull align 4 dereferenceable(4) %133)
  %135 = load i32, ptr %134, align 4, !tbaa !8
  store i32 %135, ptr %130, align 4, !tbaa !8
  br label %136

136:                                              ; preds = %128, %125
  %137 = trunc nuw i64 %indvars.iv231 to i32
  %138 = icmp sgt i32 %137, 1
  br i1 %138, label %125, label %._crit_edge181.us, !llvm.loop !21

._crit_edge181.us:                                ; preds = %136
  %139 = add nuw nsw i32 %.080182.us, 1
  %exitcond234.not = icmp eq i32 %139, %53
  br i1 %exitcond234.not, label %._crit_edge183, label %.preheader.us, !llvm.loop !22

._crit_edge183:                                   ; preds = %._crit_edge181.us, %.preheader113, %.preheader116
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 1000000000, ptr %4, align 4, !tbaa !8
  br i1 %.not, label %.lr.ph186.preheader, label %._crit_edge187

.lr.ph186.preheader:                              ; preds = %._crit_edge183
  %smax239 = call i32 @llvm.smax.i32(i32 %54, i32 1)
  %wide.trip.count240 = zext nneg i32 %smax239 to i64
  br label %.lr.ph186

._crit_edge187:                                   ; preds = %.lr.ph186, %._crit_edge183
  %140 = phi i32 [ 1000000000, %._crit_edge183 ], [ %152, %.lr.ph186 ]
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %140)
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %141, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %153

.lr.ph186:                                        ; preds = %.lr.ph186.preheader, %.lr.ph186
  %indvars.iv235 = phi i64 [ 0, %.lr.ph186.preheader ], [ %indvars.iv.next236, %.lr.ph186 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %143 = getelementptr inbounds [1048576 x i32], ptr @cost, i64 0, i64 %indvars.iv235
  %144 = load i32, ptr %143, align 4, !tbaa !8
  %145 = getelementptr inbounds [1048576 x i32], ptr @need, i64 0, i64 %indvars.iv235
  %146 = load i32, ptr %145, align 4, !tbaa !8
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [1048576 x i32], ptr @dp, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !8
  %150 = add nsw i32 %149, %144
  store i32 %150, ptr %5, align 4, !tbaa !8
  %151 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %152 = load i32, ptr %151, align 4, !tbaa !8
  store i32 %152, ptr %4, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %indvars.iv.next236 = add nuw nsw i64 %indvars.iv235, 1
  %exitcond241.not = icmp eq i64 %indvars.iv.next236, %wide.trip.count240
  br i1 %exitcond241.not, label %._crit_edge187, label %.lr.ph186, !llvm.loop !23

153:                                              ; preds = %._crit_edge187, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #4

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}


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