; LLVM IR from AnneLivia/Competitive-Programming :: Algorithms/Knapsack Problem 1 or 0/main.ll (Z8knapsackPiS_ii)

; 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_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::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 }
%"struct.std::_Setw" = type { i32 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z8knapsackPiS_ii(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %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 %"class.std::vector", align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %"struct.std::_Setw", align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = add nsw i32 %28, 1
  %30 = zext i32 %29 to i64
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  %33 = zext i32 %32 to i64
  %34 = call ptr @llvm.stacksave.p0()
  store ptr %34, ptr %9, align 8
  %35 = mul nuw i64 %30, %33
  %36 = alloca i32, i64 %35, align 16
  store i64 %30, ptr %10, align 8
  store i64 %33, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %49, %4
  %38 = load i32, ptr %12, align 4, !tbaa !9
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  %41 = icmp slt i32 %38, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %52

43:                                               ; preds = %37
  %44 = mul nsw i64 0, %33
  %45 = getelementptr inbounds i32, ptr %36, i64 %44
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr %45, i64 %47
  store i32 0, ptr %48, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %43
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %12, align 4, !tbaa !9
  br label %37, !llvm.loop !11

52:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %65, %52
  %54 = load i32, ptr %13, align 4, !tbaa !9
  %55 = load i32, ptr %7, align 4, !tbaa !9
  %56 = add nsw i32 %55, 1
  %57 = icmp slt i32 %54, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %68

59:                                               ; preds = %53
  %60 = load i32, ptr %13, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = mul nsw i64 %61, %33
  %63 = getelementptr inbounds i32, ptr %36, i64 %62
  %64 = getelementptr inbounds i32, ptr %63, i64 0
  store i32 0, ptr %64, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %59
  %66 = load i32, ptr %13, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %13, align 4, !tbaa !9
  br label %53, !llvm.loop !13

68:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %143, %68
  %70 = load i32, ptr %15, align 4, !tbaa !9
  %71 = load i32, ptr %7, align 4, !tbaa !9
  %72 = add nsw i32 %71, 1
  %73 = icmp slt i32 %70, %72
  br i1 %73, label %75, label %74

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

75:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %139, %75
  %77 = load i32, ptr %17, align 4, !tbaa !9
  %78 = load i32, ptr %8, align 4, !tbaa !9
  %79 = add nsw i32 %78, 1
  %80 = icmp slt i32 %77, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %76
  store i32 11, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %142

82:                                               ; preds = %76
  %83 = load i32, ptr %15, align 4, !tbaa !9
  %84 = sub nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = mul nsw i64 %85, %33
  %87 = getelementptr inbounds i32, ptr %36, i64 %86
  %88 = load i32, ptr %17, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %87, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !9
  store i32 %91, ptr %14, align 4, !tbaa !9
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = load i32, ptr %15, align 4, !tbaa !9
  %94 = sub nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %92, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !9
  %98 = load i32, ptr %17, align 4, !tbaa !9
  %99 = icmp sle i32 %97, %98
  br i1 %99, label %100, label %130

100:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %101 = load i32, ptr %15, align 4, !tbaa !9
  %102 = sub nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = mul nsw i64 %103, %33
  %105 = getelementptr inbounds i32, ptr %36, i64 %104
  %106 = load i32, ptr %17, align 4, !tbaa !9
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = load i32, ptr %15, align 4, !tbaa !9
  %109 = sub nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds i32, ptr %107, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = sub nsw i32 %106, %112
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %105, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !9
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = load i32, ptr %15, align 4, !tbaa !9
  %119 = sub nsw i32 %118, 1
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i32, ptr %117, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = add nsw i32 %116, %122
  store i32 %123, ptr %18, align 4, !tbaa !9
  %124 = load i32, ptr %18, align 4, !tbaa !9
  %125 = load i32, ptr %14, align 4, !tbaa !9
  %126 = icmp sgt i32 %124, %125
  br i1 %126, label %127, label %129

127:                                              ; preds = %100
  %128 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %128, ptr %14, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %127, %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %130

130:                                              ; preds = %129, %82
  %131 = load i32, ptr %14, align 4, !tbaa !9
  %132 = load i32, ptr %15, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = mul nsw i64 %133, %33
  %135 = getelementptr inbounds i32, ptr %36, i64 %134
  %136 = load i32, ptr %17, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds i32, ptr %135, i64 %137
  store i32 %131, ptr %138, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %130
  %140 = load i32, ptr %17, align 4, !tbaa !9
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %17, align 4, !tbaa !9
  br label %76, !llvm.loop !14

142:                                              ; preds = %81
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %15, align 4, !tbaa !9
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %15, align 4, !tbaa !9
  br label %69, !llvm.loop !15

146:                                              ; preds = %74
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %147 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %147, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %148 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %148, ptr %21, align 4, !tbaa !9
  br label %149

149:                                              ; preds = %197, %146
  %150 = load i32, ptr %20, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = mul nsw i64 %151, %33
  %153 = getelementptr inbounds i32, ptr %36, i64 %152
  %154 = load i32, ptr %21, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds i32, ptr %153, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !9
  %158 = icmp ne i32 %157, 0
  br i1 %158, label %159, label %200

159:                                              ; preds = %149
  %160 = load i32, ptr %20, align 4, !tbaa !9
  %161 = sub nsw i32 %160, 1
  %162 = sext i32 %161 to i64
  %163 = mul nsw i64 %162, %33
  %164 = getelementptr inbounds i32, ptr %36, i64 %163
  %165 = load i32, ptr %21, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds i32, ptr %164, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !9
  %169 = load i32, ptr %20, align 4, !tbaa !9
  %170 = sext i32 %169 to i64
  %171 = mul nsw i64 %170, %33
  %172 = getelementptr inbounds i32, ptr %36, i64 %171
  %173 = load i32, ptr %21, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i32, ptr %172, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !9
  %177 = icmp ne i32 %168, %176
  br i1 %177, label %178, label %197

178:                                              ; preds = %159
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = load i32, ptr %20, align 4, !tbaa !9
  %181 = sub nsw i32 %180, 1
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds i32, ptr %179, i64 %182
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 4 dereferenceable(4) %183)
          to label %184 unwind label %193

184:                                              ; preds = %178
  %185 = load i32, ptr %21, align 4, !tbaa !9
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = load i32, ptr %20, align 4, !tbaa !9
  %188 = sub nsw i32 %187, 1
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %186, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !9
  %192 = sub nsw i32 %185, %191
  store i32 %192, ptr %21, align 4, !tbaa !9
  br label %197

193:                                              ; preds = %281, %229, %227, %225, %200, %178
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %22, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %23, align 4
  br label %295

197:                                              ; preds = %184, %159
  %198 = load i32, ptr %20, align 4, !tbaa !9
  %199 = add nsw i32 %198, -1
  store i32 %199, ptr %20, align 4, !tbaa !9
  br label %149, !llvm.loop !16

200:                                              ; preds = %149
  %201 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %202 unwind label %193

202:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %203

203:                                              ; preds = %218, %202
  %204 = load i32, ptr %24, align 4, !tbaa !9
  %205 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  %206 = trunc i64 %205 to i32
  %207 = icmp slt i32 %204, %206
  br i1 %207, label %209, label %208

208:                                              ; preds = %203
  store i32 16, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %225

209:                                              ; preds = %203
  %210 = load i32, ptr %24, align 4, !tbaa !9
  %211 = sext i32 %210 to i64
  %212 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %211) #7
  %213 = load i32, ptr %212, align 4, !tbaa !9
  %214 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %213)
          to label %215 unwind label %221

215:                                              ; preds = %209
  %216 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %214, ptr noundef @.str.1)
          to label %217 unwind label %221

217:                                              ; preds = %215
  br label %218

218:                                              ; preds = %217
  %219 = load i32, ptr %24, align 4, !tbaa !9
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %24, align 4, !tbaa !9
  br label %203, !llvm.loop !17

221:                                              ; preds = %215, %209
  %222 = landingpad { ptr, i32 }
          cleanup
  %223 = extractvalue { ptr, i32 } %222, 0
  store ptr %223, ptr %22, align 8
  %224 = extractvalue { ptr, i32 } %222, 1
  store i32 %224, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %295

225:                                              ; preds = %208
  %226 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %227 unwind label %193

227:                                              ; preds = %225
  %228 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %226, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %229 unwind label %193

229:                                              ; preds = %227
  %230 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
          to label %231 unwind label %193

231:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %232

232:                                              ; preds = %273, %231
  %233 = load i32, ptr %25, align 4, !tbaa !9
  %234 = load i32, ptr %7, align 4, !tbaa !9
  %235 = add nsw i32 %234, 1
  %236 = icmp slt i32 %233, %235
  br i1 %236, label %238, label %237

237:                                              ; preds = %232
  store i32 19, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %281

238:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %239

239:                                              ; preds = %263, %238
  %240 = load i32, ptr %26, align 4, !tbaa !9
  %241 = load i32, ptr %8, align 4, !tbaa !9
  %242 = add nsw i32 %241, 1
  %243 = icmp slt i32 %240, %242
  br i1 %243, label %245, label %244

244:                                              ; preds = %239
  store i32 22, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %270

245:                                              ; preds = %239
  %246 = invoke i32 @_ZSt4setwi(i32 noundef 5)
          to label %247 unwind label %266

247:                                              ; preds = %245
  %248 = getelementptr inbounds %"struct.std::_Setw", ptr %27, i32 0, i32 0
  store i32 %246, ptr %248, align 4
  %249 = getelementptr inbounds %"struct.std::_Setw", ptr %27, i32 0, i32 0
  %250 = load i32, ptr %249, align 4
  %251 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St5_Setw(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %250)
          to label %252 unwind label %266

252:                                              ; preds = %247
  %253 = load i32, ptr %25, align 4, !tbaa !9
  %254 = sext i32 %253 to i64
  %255 = mul nsw i64 %254, %33
  %256 = getelementptr inbounds i32, ptr %36, i64 %255
  %257 = load i32, ptr %26, align 4, !tbaa !9
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds i32, ptr %256, i64 %258
  %260 = load i32, ptr %259, align 4, !tbaa !9
  %261 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %251, i32 noundef %260)
          to label %262 unwind label %266

262:                                              ; preds = %252
  br label %263

263:                                              ; preds = %262
  %264 = load i32, ptr %26, align 4, !tbaa !9
  %265 = add nsw i32 %264, 1
  store i32 %265, ptr %26, align 4, !tbaa !9
  br label %239, !llvm.loop !18

266:                                              ; preds = %252, %247, %245
  %267 = landingpad { ptr, i32 }
          cleanup
  %268 = extractvalue { ptr, i32 } %267, 0
  store ptr %268, ptr %22, align 8
  %269 = extractvalue { ptr, i32 } %267, 1
  store i32 %269, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %280

270:                                              ; preds = %244
  %271 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %272 unwind label %276

272:                                              ; preds = %270
  br label %273

273:                                              ; preds = %272
  %274 = load i32, ptr %25, align 4, !tbaa !9
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr %25, align 4, !tbaa !9
  br label %232, !llvm.loop !19

276:                                              ; preds = %270
  %277 = landingpad { ptr, i32 }
          cleanup
  %278 = extractvalue { ptr, i32 } %277, 0
  store ptr %278, ptr %22, align 8
  %279 = extractvalue { ptr, i32 } %277, 1
  store i32 %279, ptr %23, align 4
  br label %280

280:                                              ; preds = %276, %266
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %295

281:                                              ; preds = %237
  %282 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %283 unwind label %193

283:                                              ; preds = %281
  %284 = load i32, ptr %7, align 4, !tbaa !9
  %285 = sub nsw i32 %284, 1
  %286 = sext i32 %285 to i64
  %287 = mul nsw i64 %286, %33
  %288 = getelementptr inbounds i32, ptr %36, i64 %287
  %289 = load i32, ptr %8, align 4, !tbaa !9
  %290 = sub nsw i32 %289, 1
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds i32, ptr %288, i64 %291
  %293 = load i32, ptr %292, align 4, !tbaa !9
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  %294 = load ptr, ptr %9, align 8
  call void @llvm.stackrestore.p0(ptr %294)
  ret i32 %293

295:                                              ; preds = %280, %221, %193
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %296

296:                                              ; preds = %295
  %297 = load ptr, ptr %22, align 8
  %298 = load i32, ptr %23, align 4
  %299 = insertvalue { ptr, i32 } poison, ptr %297, 0
  %300 = insertvalue { ptr, i32 } %299, i32 %298, 1
  resume { ptr, i32 } %300
}

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #1

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt4setwi(i32 noundef) #6

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #1

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !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_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::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 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z8knapsackPiS_ii(ptr noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::vector", align 8
  %6 = add i32 %2, 1
  %7 = zext i32 %6 to i64
  %8 = add i32 %3, 1
  %9 = zext i32 %8 to i64
  %10 = mul nuw i64 %9, %7
  %11 = alloca i32, i64 %10, align 16
  %.not98 = icmp slt i32 %3, 0
  br i1 %.not98, label %.preheader97, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %4
  %12 = shl nuw nsw i64 %9, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %11, i8 0, i64 %12, i1 false), !tbaa !5
  br label %.preheader97

.preheader97:                                     ; preds = %.lr.ph.preheader, %4
  %.not82100 = icmp slt i32 %2, 0
  br i1 %.not82100, label %._crit_edge108, label %.lr.ph102.preheader

.lr.ph102.preheader:                              ; preds = %.preheader97
  %xtraiter = and i64 %7, 3
  %13 = icmp ult i32 %6, 4
  br i1 %13, label %.preheader96.unr-lcssa, label %.lr.ph102.preheader.new

.lr.ph102.preheader.new:                          ; preds = %.lr.ph102.preheader
  %unroll_iter = and i64 %7, 4294967292
  br label %.lr.ph102

.preheader96.unr-lcssa:                           ; preds = %.lr.ph102, %.lr.ph102.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph102.preheader ], [ %indvars.iv.next.3, %.lr.ph102 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader96, label %.lr.ph102.epil

.lr.ph102.epil:                                   ; preds = %.preheader96.unr-lcssa, %.lr.ph102.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph102.epil ], [ %indvars.iv.unr, %.preheader96.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph102.epil ], [ 0, %.preheader96.unr-lcssa ]
  %14 = mul nuw nsw i64 %indvars.iv.epil, %9
  %15 = getelementptr inbounds i32, ptr %11, i64 %14
  store i32 0, ptr %15, align 4, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader96, label %.lr.ph102.epil, !llvm.loop !9

.preheader96:                                     ; preds = %.lr.ph102.epil, %.preheader96.unr-lcssa
  %.not83106 = icmp eq i32 %2, 0
  %.not91103 = icmp slt i32 %3, 1
  %or.cond = or i1 %.not83106, %.not91103
  br i1 %or.cond, label %._crit_edge108, label %.preheader95.preheader

.preheader95.preheader:                           ; preds = %.preheader96
  %16 = add nsw i64 %9, -1
  %xtraiter160 = and i64 %16, 1
  %17 = icmp eq i32 %8, 2
  %unroll_iter163 = and i64 %16, -2
  %lcmp.mod162.not = icmp eq i64 %xtraiter160, 0
  br label %.preheader95

.lr.ph102:                                        ; preds = %.lr.ph102, %.lr.ph102.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph102.preheader.new ], [ %indvars.iv.next.3, %.lr.ph102 ]
  %niter = phi i64 [ 0, %.lr.ph102.preheader.new ], [ %niter.next.3, %.lr.ph102 ]
  %18 = mul nuw nsw i64 %indvars.iv, %9
  %19 = getelementptr inbounds i32, ptr %11, i64 %18
  store i32 0, ptr %19, align 16, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %20 = mul nuw nsw i64 %indvars.iv.next, %9
  %21 = getelementptr inbounds i32, ptr %11, i64 %20
  store i32 0, ptr %21, align 4, !tbaa !5
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %22 = mul nuw nsw i64 %indvars.iv.next.1, %9
  %23 = getelementptr inbounds i32, ptr %11, i64 %22
  store i32 0, ptr %23, align 8, !tbaa !5
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %24 = mul nuw nsw i64 %indvars.iv.next.2, %9
  %25 = getelementptr inbounds i32, ptr %11, i64 %24
  store i32 0, ptr %25, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader96.unr-lcssa, label %.lr.ph102, !llvm.loop !11

.preheader95:                                     ; preds = %.preheader95.preheader, %._crit_edge
  %indvars.iv134 = phi i64 [ %indvars.iv.next135, %._crit_edge ], [ 1, %.preheader95.preheader ]
  %26 = add nsw i64 %indvars.iv134, -1
  %27 = mul nuw nsw i64 %26, %9
  %28 = getelementptr inbounds i32, ptr %11, i64 %27
  %29 = getelementptr inbounds i32, ptr %0, i64 %26
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = getelementptr inbounds i32, ptr %1, i64 %26
  %32 = mul nuw nsw i64 %indvars.iv134, %9
  %33 = getelementptr inbounds i32, ptr %11, i64 %32
  %34 = sext i32 %30 to i64
  br i1 %17, label %._crit_edge.unr-lcssa, label %.preheader95.new

._crit_edge108:                                   ; preds = %._crit_edge, %.preheader97, %.preheader96
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #8
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  %35 = sext i32 %2 to i64
  %36 = mul nsw i64 %35, %9
  %37 = getelementptr inbounds i32, ptr %11, i64 %36
  %38 = sext i32 %3 to i64
  %39 = getelementptr inbounds i32, ptr %37, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %.not84109 = icmp eq i32 %40, 0
  br i1 %.not84109, label %._crit_edge114, label %.lr.ph113

._crit_edge.unr-lcssa:                            ; preds = %68, %.preheader95
  %indvars.iv129.unr = phi i64 [ 1, %.preheader95 ], [ %indvars.iv.next130.1, %68 ]
  br i1 %lcmp.mod162.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.unr-lcssa
  %41 = getelementptr inbounds i32, ptr %28, i64 %indvars.iv129.unr
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %.not92.epil = icmp slt i64 %indvars.iv129.unr, %34
  br i1 %.not92.epil, label %._crit_edge.epilog-lcssa, label %43

43:                                               ; preds = %.epil.preheader
  %44 = sub nsw i64 %indvars.iv129.unr, %34
  %45 = getelementptr inbounds i32, ptr %28, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = load i32, ptr %31, align 4, !tbaa !5
  %48 = add nsw i32 %47, %46
  %spec.select.epil = tail call i32 @llvm.smax.i32(i32 %48, i32 %42)
  br label %._crit_edge.epilog-lcssa

._crit_edge.epilog-lcssa:                         ; preds = %43, %.epil.preheader
  %.175.epil = phi i32 [ %spec.select.epil, %43 ], [ %42, %.epil.preheader ]
  %49 = getelementptr inbounds i32, ptr %33, i64 %indvars.iv129.unr
  store i32 %.175.epil, ptr %49, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.unr-lcssa, %._crit_edge.epilog-lcssa
  %indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1
  %exitcond138.not = icmp eq i64 %indvars.iv.next135, %7
  br i1 %exitcond138.not, label %._crit_edge108, label %.preheader95, !llvm.loop !13

.preheader95.new:                                 ; preds = %.preheader95, %68
  %indvars.iv129 = phi i64 [ %indvars.iv.next130.1, %68 ], [ 1, %.preheader95 ]
  %niter164 = phi i64 [ %niter164.next.1, %68 ], [ 0, %.preheader95 ]
  %50 = getelementptr inbounds i32, ptr %28, i64 %indvars.iv129
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %.not92 = icmp slt i64 %indvars.iv129, %34
  br i1 %.not92, label %58, label %52

52:                                               ; preds = %.preheader95.new
  %53 = sub nsw i64 %indvars.iv129, %34
  %54 = getelementptr inbounds i32, ptr %28, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr %31, align 4, !tbaa !5
  %57 = add nsw i32 %56, %55
  %spec.select = tail call i32 @llvm.smax.i32(i32 %57, i32 %51)
  br label %58

58:                                               ; preds = %52, %.preheader95.new
  %.175 = phi i32 [ %spec.select, %52 ], [ %51, %.preheader95.new ]
  %59 = getelementptr inbounds i32, ptr %33, i64 %indvars.iv129
  store i32 %.175, ptr %59, align 4, !tbaa !5
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %60 = getelementptr inbounds i32, ptr %28, i64 %indvars.iv.next130
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %.not92.1 = icmp slt i64 %indvars.iv.next130, %34
  br i1 %.not92.1, label %68, label %62

62:                                               ; preds = %58
  %63 = sub nsw i64 %indvars.iv.next130, %34
  %64 = getelementptr inbounds i32, ptr %28, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load i32, ptr %31, align 4, !tbaa !5
  %67 = add nsw i32 %66, %65
  %spec.select.1 = tail call i32 @llvm.smax.i32(i32 %67, i32 %61)
  br label %68

68:                                               ; preds = %62, %58
  %.175.1 = phi i32 [ %spec.select.1, %62 ], [ %61, %58 ]
  %69 = getelementptr inbounds i32, ptr %33, i64 %indvars.iv.next130
  store i32 %.175.1, ptr %69, align 4, !tbaa !5
  %indvars.iv.next130.1 = add nuw nsw i64 %indvars.iv129, 2
  %niter164.next.1 = add i64 %niter164, 2
  %niter164.ncmp.1 = icmp eq i64 %niter164.next.1, %unroll_iter163
  br i1 %niter164.ncmp.1, label %._crit_edge.unr-lcssa, label %.preheader95.new, !llvm.loop !14

.lr.ph113:                                        ; preds = %._crit_edge108, %81
  %indvars.iv139 = phi i64 [ %indvars.iv.next140, %81 ], [ %35, %._crit_edge108 ]
  %70 = phi i32 [ %84, %81 ], [ %40, %._crit_edge108 ]
  %71 = phi i64 [ %82, %81 ], [ %38, %._crit_edge108 ]
  %.068111 = phi i32 [ %.169, %81 ], [ %3, %._crit_edge108 ]
  %indvars.iv.next140 = add nsw i64 %indvars.iv139, -1
  %72 = mul nsw i64 %indvars.iv.next140, %9
  %73 = getelementptr inbounds i32, ptr %11, i64 %72
  %74 = getelementptr inbounds i32, ptr %73, i64 %71
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %.not88 = icmp eq i32 %75, %70
  br i1 %.not88, label %81, label %76

76:                                               ; preds = %.lr.ph113
  %77 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next140
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %77)
          to label %78 unwind label %.loopexit

78:                                               ; preds = %76
  %79 = load i32, ptr %77, align 4, !tbaa !5
  %80 = sub nsw i32 %.068111, %79
  br label %81

.loopexit:                                        ; preds = %76
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %133

.loopexit.split-lp:                               ; preds = %._crit_edge114, %._crit_edge117, %101, %103, %._crit_edge124
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %133

81:                                               ; preds = %78, %.lr.ph113
  %.169 = phi i32 [ %80, %78 ], [ %.068111, %.lr.ph113 ]
  %82 = sext i32 %.169 to i64
  %83 = getelementptr inbounds i32, ptr %73, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %.not84 = icmp eq i32 %84, 0
  br i1 %.not84, label %._crit_edge114, label %.lr.ph113, !llvm.loop !15

._crit_edge114:                                   ; preds = %81, %._crit_edge108
  %85 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %.preheader94 unwind label %.loopexit.split-lp

.preheader94:                                     ; preds = %._crit_edge114
  %86 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  %87 = trunc i64 %86 to i32
  %88 = icmp sgt i32 %87, 0
  br i1 %88, label %.lr.ph116, label %._crit_edge117

._crit_edge117:                                   ; preds = %95, %.preheader94
  %89 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %101 unwind label %.loopexit.split-lp

.lr.ph116:                                        ; preds = %.preheader94, %95
  %indvars.iv142 = phi i64 [ %indvars.iv.next143, %95 ], [ 0, %.preheader94 ]
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv142) #8
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %91)
          to label %93 unwind label %99

93:                                               ; preds = %.lr.ph116
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull @.str.1)
          to label %95 unwind label %99

95:                                               ; preds = %93
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %96 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  %sext = shl i64 %96, 32
  %97 = ashr exact i64 %sext, 32
  %98 = icmp slt i64 %indvars.iv.next143, %97
  br i1 %98, label %.lr.ph116, label %._crit_edge117, !llvm.loop !16

99:                                               ; preds = %93, %.lr.ph116
  %100 = landingpad { ptr, i32 }
          cleanup
  br label %133

101:                                              ; preds = %._crit_edge117
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %103 unwind label %.loopexit.split-lp

103:                                              ; preds = %101
  %104 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
          to label %.preheader93 unwind label %.loopexit.split-lp

.preheader93:                                     ; preds = %103
  br i1 %.not82100, label %._crit_edge124, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader93
  br i1 %.not98, label %.preheader.us, label %.preheader

.preheader.us:                                    ; preds = %.preheader.lr.ph, %106
  %.063123.us = phi i32 [ %107, %106 ], [ 0, %.preheader.lr.ph ]
  %105 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %106 unwind label %.split.us

106:                                              ; preds = %.preheader.us
  %107 = add nuw i32 %.063123.us, 1
  %exitcond155.not = icmp eq i32 %.063123.us, %2
  br i1 %exitcond155.not, label %._crit_edge124, label %.preheader.us, !llvm.loop !17

.split.us:                                        ; preds = %.preheader.us
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %133

.preheader:                                       ; preds = %.preheader.lr.ph, %123
  %indvars.iv150 = phi i64 [ %indvars.iv.next151, %123 ], [ 0, %.preheader.lr.ph ]
  %109 = mul nuw nsw i64 %indvars.iv150, %9
  %110 = getelementptr inbounds i32, ptr %11, i64 %109
  br label %113

._crit_edge124:                                   ; preds = %123, %106, %.preheader93
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %125 unwind label %.loopexit.split-lp

._crit_edge121:                                   ; preds = %120
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %123 unwind label %.split

113:                                              ; preds = %.preheader, %120
  %indvars.iv145 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next146, %120 ]
  %114 = call i32 @_ZSt4setwi(i32 noundef 5)
  %115 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St5_Setw(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %114)
          to label %116 unwind label %121

116:                                              ; preds = %113
  %117 = getelementptr inbounds i32, ptr %110, i64 %indvars.iv145
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %115, i32 noundef %118)
          to label %120 unwind label %121

120:                                              ; preds = %116
  %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
  %exitcond149.not = icmp eq i64 %indvars.iv.next146, %9
  br i1 %exitcond149.not, label %._crit_edge121, label %113, !llvm.loop !18

121:                                              ; preds = %116, %113
  %122 = landingpad { ptr, i32 }
          cleanup
  br label %133

123:                                              ; preds = %._crit_edge121
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %exitcond154.not = icmp eq i64 %indvars.iv.next151, %7
  br i1 %exitcond154.not, label %._crit_edge124, label %.preheader, !llvm.loop !17

.split:                                           ; preds = %._crit_edge121
  %124 = landingpad { ptr, i32 }
          cleanup
  br label %133

125:                                              ; preds = %._crit_edge124
  %126 = add nsw i32 %2, -1
  %127 = sext i32 %126 to i64
  %128 = mul nsw i64 %9, %127
  %129 = getelementptr inbounds i32, ptr %11, i64 %128
  %130 = getelementptr i32, ptr %129, i64 %38
  %131 = getelementptr i8, ptr %130, i64 -4
  %132 = load i32, ptr %131, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  ret i32 %132

133:                                              ; preds = %.split, %.split.us, %.loopexit, %.loopexit.split-lp, %121, %99
  %.pn89 = phi { ptr, i32 } [ %100, %99 ], [ %122, %121 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %124, %.split ], [ %108, %.split.us ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  resume { ptr, i32 } %.pn89
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St5_Setw(ptr noundef nonnull align 8 dereferenceable(8), i32) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt4setwi(i32 noundef) local_unnamed_addr #5

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

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

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

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


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