; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/272 Division 2/Problem E (E)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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" }

@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z1pB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@dp = external dso_local global [2001 x [2001 x i32]], align 16
@j = external dso_local global [2001 x i32], align 16
@k = external dso_local global [2001 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; 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 i8, align 1
  %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 i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %17 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %19
  %21 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  %22 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %23 = getelementptr i8, ptr %22, i64 -24
  %24 = load i64, ptr %23, align 8
  %25 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %24
  %26 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %25, ptr noundef null)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(32) @_Z1pB5cxx11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %29 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #7
  %30 = trunc i64 %29 to i32
  store i32 %30, ptr %2, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %31 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1pB5cxx11) #7
  %32 = trunc i64 %31 to i32
  store i32 %32, ptr %3, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %33

33:                                               ; preds = %126, %0
  %34 = load i32, ptr %4, align 4, !tbaa !8
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %33
  %39 = load i32, ptr %4, align 4, !tbaa !8
  %40 = sext i32 %39 to i64
  %41 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %40)
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %43 = sext i8 %42 to i32
  %44 = load i32, ptr %3, align 4, !tbaa !8
  %45 = sub nsw i32 %44, 1
  %46 = sext i32 %45 to i64
  %47 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1pB5cxx11, i64 noundef %46)
  %48 = load i8, ptr %47, align 1, !tbaa !11
  %49 = sext i8 %48 to i32
  %50 = icmp eq i32 %43, %49
  br i1 %50, label %51, label %116

51:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #7
  store i8 0, ptr %6, align 1, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %52 = load i32, ptr %3, align 4, !tbaa !8
  %53 = sub nsw i32 %52, 1
  store i32 %53, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %54 = load i32, ptr %4, align 4, !tbaa !8
  store i32 %54, ptr %8, align 4, !tbaa !8
  br label %55

55:                                               ; preds = %100, %51
  %56 = load i32, ptr %7, align 4, !tbaa !8
  %57 = icmp sge i32 %56, 0
  br i1 %57, label %58, label %65

58:                                               ; preds = %55
  %59 = load i32, ptr %8, align 4, !tbaa !8
  %60 = icmp sge i32 %59, 0
  br i1 %60, label %61, label %65

61:                                               ; preds = %58
  %62 = load i8, ptr %6, align 1, !tbaa !12, !range !14, !noundef !15
  %63 = trunc i8 %62 to i1
  %64 = xor i1 %63, true
  br label %65

65:                                               ; preds = %61, %58, %55
  %66 = phi i1 [ false, %58 ], [ false, %55 ], [ %64, %61 ]
  br i1 %66, label %68, label %67

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

68:                                               ; preds = %65
  %69 = load i32, ptr %8, align 4, !tbaa !8
  %70 = sext i32 %69 to i64
  %71 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %70)
  %72 = load i8, ptr %71, align 1, !tbaa !11
  %73 = sext i8 %72 to i32
  %74 = load i32, ptr %7, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1pB5cxx11, i64 noundef %75)
  %77 = load i8, ptr %76, align 1, !tbaa !11
  %78 = sext i8 %77 to i32
  %79 = icmp eq i32 %73, %78
  br i1 %79, label %80, label %83

80:                                               ; preds = %68
  %81 = load i32, ptr %7, align 4, !tbaa !8
  %82 = add nsw i32 %81, -1
  store i32 %82, ptr %7, align 4, !tbaa !8
  br label %90

83:                                               ; preds = %68
  %84 = load i32, ptr %4, align 4, !tbaa !8
  %85 = add nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [2001 x i32], ptr @k, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !8
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %87, align 4, !tbaa !8
  br label %90

90:                                               ; preds = %83, %80
  %91 = load i32, ptr %7, align 4, !tbaa !8
  %92 = icmp slt i32 %91, 0
  br i1 %92, label %93, label %99

93:                                               ; preds = %90
  %94 = load i32, ptr %8, align 4, !tbaa !8
  %95 = load i32, ptr %4, align 4, !tbaa !8
  %96 = add nsw i32 %95, 1
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [2001 x i32], ptr @j, i64 0, i64 %97
  store i32 %94, ptr %98, align 4, !tbaa !8
  store i8 1, ptr %6, align 1, !tbaa !12
  br label %99

99:                                               ; preds = %93, %90
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %8, align 4, !tbaa !8
  %102 = add nsw i32 %101, -1
  store i32 %102, ptr %8, align 4, !tbaa !8
  br label %55, !llvm.loop !16

103:                                              ; preds = %67
  %104 = load i8, ptr %6, align 1, !tbaa !12, !range !14, !noundef !15
  %105 = trunc i8 %104 to i1
  br i1 %105, label %115, label %106

106:                                              ; preds = %103
  %107 = load i32, ptr %4, align 4, !tbaa !8
  %108 = add nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [2001 x i32], ptr @j, i64 0, i64 %109
  store i32 -1, ptr %110, align 4, !tbaa !8
  %111 = load i32, ptr %4, align 4, !tbaa !8
  %112 = add nsw i32 %111, 1
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [2001 x i32], ptr @k, i64 0, i64 %113
  store i32 -1, ptr %114, align 4, !tbaa !8
  br label %115

115:                                              ; preds = %106, %103
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  br label %125

116:                                              ; preds = %38
  %117 = load i32, ptr %4, align 4, !tbaa !8
  %118 = add nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [2001 x i32], ptr @j, i64 0, i64 %119
  store i32 -1, ptr %120, align 4, !tbaa !8
  %121 = load i32, ptr %4, align 4, !tbaa !8
  %122 = add nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [2001 x i32], ptr @k, i64 0, i64 %123
  store i32 -1, ptr %124, align 4, !tbaa !8
  br label %125

125:                                              ; preds = %116, %115
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %4, align 4, !tbaa !8
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %4, align 4, !tbaa !8
  br label %33, !llvm.loop !18

129:                                              ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !8
  br label %130

130:                                              ; preds = %172, %129
  %131 = load i32, ptr %9, align 4, !tbaa !8
  %132 = load i32, ptr %2, align 4, !tbaa !8
  %133 = icmp sle i32 %131, %132
  br i1 %133, label %135, label %134

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

135:                                              ; preds = %130
  %136 = load i32, ptr %9, align 4, !tbaa !8
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [2001 x i32], ptr @j, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !8
  %140 = icmp ne i32 %139, -1
  br i1 %140, label %141, label %159

141:                                              ; preds = %135
  %142 = load i32, ptr %9, align 4, !tbaa !8
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [2001 x i32], ptr @k, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !8
  %146 = icmp eq i32 %145, 0
  br i1 %146, label %147, label %159

147:                                              ; preds = %141
  %148 = load i32, ptr %9, align 4, !tbaa !8
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [2001 x i32], ptr @j, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !8
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [2001 x i32], ptr @dp, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !8
  %155 = add nsw i32 %154, 1
  %156 = load i32, ptr %9, align 4, !tbaa !8
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [2001 x i32], ptr @dp, i64 0, i64 %157
  store i32 %155, ptr %158, align 4, !tbaa !8
  br label %159

159:                                              ; preds = %147, %141, %135
  %160 = load i32, ptr %9, align 4, !tbaa !8
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [2001 x i32], ptr @dp, i64 0, i64 %161
  %163 = load i32, ptr %9, align 4, !tbaa !8
  %164 = sub nsw i32 %163, 1
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [2001 x i32], ptr @dp, i64 0, i64 %165
  %167 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %162, ptr noundef nonnull align 4 dereferenceable(4) %166)
  %168 = load i32, ptr %167, align 4, !tbaa !8
  %169 = load i32, ptr %9, align 4, !tbaa !8
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [2001 x i32], ptr @dp, i64 0, i64 %170
  store i32 %168, ptr %171, align 4, !tbaa !8
  br label %172

172:                                              ; preds = %159
  %173 = load i32, ptr %9, align 4, !tbaa !8
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %9, align 4, !tbaa !8
  br label %130, !llvm.loop !19

175:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !8
  br label %176

176:                                              ; preds = %290, %175
  %177 = load i32, ptr %10, align 4, !tbaa !8
  %178 = load i32, ptr %2, align 4, !tbaa !8
  %179 = icmp sle i32 %177, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %176
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %293

181:                                              ; preds = %176
  %182 = load i32, ptr %10, align 4, !tbaa !8
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %183
  %185 = getelementptr inbounds [2001 x i32], ptr %184, i64 0, i64 0
  store i32 -10000, ptr %185, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !8
  br label %186

186:                                              ; preds = %286, %181
  %187 = load i32, ptr %11, align 4, !tbaa !8
  %188 = load i32, ptr %2, align 4, !tbaa !8
  %189 = icmp sle i32 %187, %188
  br i1 %189, label %191, label %190

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

191:                                              ; preds = %186
  %192 = load i32, ptr %11, align 4, !tbaa !8
  %193 = load i32, ptr %10, align 4, !tbaa !8
  %194 = icmp slt i32 %192, %193
  br i1 %194, label %195, label %202

195:                                              ; preds = %191
  %196 = load i32, ptr %10, align 4, !tbaa !8
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %197
  %199 = load i32, ptr %11, align 4, !tbaa !8
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [2001 x i32], ptr %198, i64 0, i64 %200
  store i32 -10000, ptr %201, align 4, !tbaa !8
  br label %285

202:                                              ; preds = %191
  %203 = load i32, ptr %11, align 4, !tbaa !8
  %204 = load i32, ptr %10, align 4, !tbaa !8
  %205 = icmp sgt i32 %203, %204
  br i1 %205, label %206, label %260

206:                                              ; preds = %202
  %207 = load i32, ptr %11, align 4, !tbaa !8
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [2001 x i32], ptr @j, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !8
  %211 = icmp ne i32 %210, -1
  br i1 %211, label %212, label %260

212:                                              ; preds = %206
  %213 = load i32, ptr %11, align 4, !tbaa !8
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [2001 x i32], ptr @k, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !8
  %217 = load i32, ptr %10, align 4, !tbaa !8
  %218 = icmp sle i32 %216, %217
  br i1 %218, label %219, label %260

219:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %220 = load i32, ptr %10, align 4, !tbaa !8
  %221 = load i32, ptr %11, align 4, !tbaa !8
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [2001 x i32], ptr @k, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !8
  %225 = sub nsw i32 %220, %224
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %226
  %228 = load i32, ptr %11, align 4, !tbaa !8
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [2001 x i32], ptr @j, i64 0, i64 %229
  %231 = load i32, ptr %230, align 4, !tbaa !8
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [2001 x i32], ptr %227, i64 0, i64 %232
  %234 = load i32, ptr %233, align 4, !tbaa !8
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr %12, align 4, !tbaa !8
  %236 = load i32, ptr %10, align 4, !tbaa !8
  %237 = sub nsw i32 %236, 1
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %238
  %240 = load i32, ptr %11, align 4, !tbaa !8
  %241 = sub nsw i32 %240, 1
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [2001 x i32], ptr %239, i64 0, i64 %242
  %244 = load i32, ptr %10, align 4, !tbaa !8
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %245
  %247 = load i32, ptr %11, align 4, !tbaa !8
  %248 = sub nsw i32 %247, 1
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [2001 x i32], ptr %246, i64 0, i64 %249
  %251 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %243, ptr noundef nonnull align 4 dereferenceable(4) %250)
  %252 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %251)
  %253 = load i32, ptr %252, align 4, !tbaa !8
  %254 = load i32, ptr %10, align 4, !tbaa !8
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %255
  %257 = load i32, ptr %11, align 4, !tbaa !8
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [2001 x i32], ptr %256, i64 0, i64 %258
  store i32 %253, ptr %259, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %284

260:                                              ; preds = %212, %206, %202
  %261 = load i32, ptr %10, align 4, !tbaa !8
  %262 = sub nsw i32 %261, 1
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %263
  %265 = load i32, ptr %11, align 4, !tbaa !8
  %266 = sub nsw i32 %265, 1
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [2001 x i32], ptr %264, i64 0, i64 %267
  %269 = load i32, ptr %10, align 4, !tbaa !8
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %270
  %272 = load i32, ptr %11, align 4, !tbaa !8
  %273 = sub nsw i32 %272, 1
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [2001 x i32], ptr %271, i64 0, i64 %274
  %276 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %268, ptr noundef nonnull align 4 dereferenceable(4) %275)
  %277 = load i32, ptr %276, align 4, !tbaa !8
  %278 = load i32, ptr %10, align 4, !tbaa !8
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %279
  %281 = load i32, ptr %11, align 4, !tbaa !8
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [2001 x i32], ptr %280, i64 0, i64 %282
  store i32 %277, ptr %283, align 4, !tbaa !8
  br label %284

284:                                              ; preds = %260, %219
  br label %285

285:                                              ; preds = %284, %195
  br label %286

286:                                              ; preds = %285
  %287 = load i32, ptr %11, align 4, !tbaa !8
  %288 = add nsw i32 %287, 1
  store i32 %288, ptr %11, align 4, !tbaa !8
  br label %186, !llvm.loop !20

289:                                              ; preds = %190
  br label %290

290:                                              ; preds = %289
  %291 = load i32, ptr %10, align 4, !tbaa !8
  %292 = add nsw i32 %291, 1
  store i32 %292, ptr %10, align 4, !tbaa !8
  br label %176, !llvm.loop !21

293:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %294

294:                                              ; preds = %321, %293
  %295 = load i32, ptr %13, align 4, !tbaa !8
  %296 = load i32, ptr %2, align 4, !tbaa !8
  %297 = icmp sle i32 %295, %296
  br i1 %297, label %299, label %298

298:                                              ; preds = %294
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %324

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

300:                                              ; preds = %314, %299
  %301 = load i32, ptr %15, align 4, !tbaa !8
  %302 = load i32, ptr %2, align 4, !tbaa !8
  %303 = icmp sle i32 %301, %302
  br i1 %303, label %305, label %304

304:                                              ; preds = %300
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %317

305:                                              ; preds = %300
  %306 = load i32, ptr %13, align 4, !tbaa !8
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %307
  %309 = load i32, ptr %15, align 4, !tbaa !8
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [2001 x i32], ptr %308, i64 0, i64 %310
  %312 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %311)
  %313 = load i32, ptr %312, align 4, !tbaa !8
  store i32 %313, ptr %14, align 4, !tbaa !8
  br label %314

314:                                              ; preds = %305
  %315 = load i32, ptr %15, align 4, !tbaa !8
  %316 = add nsw i32 %315, 1
  store i32 %316, ptr %15, align 4, !tbaa !8
  br label %300, !llvm.loop !22

317:                                              ; preds = %304
  %318 = load i32, ptr %14, align 4, !tbaa !8
  %319 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %318)
  %320 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %319, ptr noundef @.str)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %321

321:                                              ; preds = %317
  %322 = load i32, ptr %13, align 4, !tbaa !8
  %323 = add nsw i32 %322, 1
  store i32 %323, ptr %13, align 4, !tbaa !8
  br label %294, !llvm.loop !23

324:                                              ; preds = %298
  %325 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %326 = load i32, ptr %1, align 4
  ret i32 %326
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2 align 2

; 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 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)) #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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #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 = !{!10, !10, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !10, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !17}


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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" }

@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z1pB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@dp = external dso_local global [2001 x [2001 x i32]], align 16
@j = external dso_local local_unnamed_addr global [2001 x i32], align 16
@k = external dso_local local_unnamed_addr global [2001 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  %9 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(32) @_Z1pB5cxx11)
  %16 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #7
  %17 = trunc i64 %16 to i32
  %18 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1pB5cxx11) #7
  %19 = icmp sgt i32 %17, 0
  br i1 %19, label %.lr.ph106, label %.preheader

.lr.ph106:                                        ; preds = %0
  %20 = trunc i64 %18 to i32
  %21 = add nsw i32 %20, -1
  %22 = sext i32 %21 to i64
  %23 = icmp slt i32 %20, 1
  %wide.trip.count = and i64 %16, 2147483647
  br label %25

.lr.ph109.preheader:                              ; preds = %54
  %24 = add nuw nsw i64 %16, 1
  %wide.trip.count134 = and i64 %24, 4294967295
  br label %.lr.ph109

25:                                               ; preds = %.lr.ph106, %54
  %indvars.iv = phi i64 [ 0, %.lr.ph106 ], [ %.pre, %54 ]
  %26 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv)
  %27 = load i8, ptr %26, align 1, !tbaa !8
  %28 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1pB5cxx11, i64 noundef %22)
  %29 = load i8, ptr %28, align 1, !tbaa !8
  %30 = icmp eq i8 %27, %29
  %.pre = add nuw nsw i64 %indvars.iv, 1
  br i1 %30, label %.preheader100, label %51

.preheader100:                                    ; preds = %25
  br i1 %23, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader100
  %31 = getelementptr inbounds [2001 x i32], ptr @k, i64 0, i64 %.pre
  %32 = getelementptr inbounds [2001 x i32], ptr @j, i64 0, i64 %.pre
  br label %33

33:                                               ; preds = %.lr.ph, %45
  %indvars.iv128 = phi i64 [ %indvars.iv, %.lr.ph ], [ %indvars.iv.next129, %45 ]
  %.079102 = phi i32 [ %21, %.lr.ph ], [ %.197, %45 ]
  %34 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv128)
  %35 = load i8, ptr %34, align 1, !tbaa !8
  %36 = zext nneg i32 %.079102 to i64
  %37 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1pB5cxx11, i64 noundef %36)
  %38 = load i8, ptr %37, align 1, !tbaa !8
  %39 = icmp eq i8 %35, %38
  br i1 %39, label %42, label %.thread

.thread:                                          ; preds = %33
  %40 = load i32, ptr %31, align 4, !tbaa !10
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %31, align 4, !tbaa !10
  br label %45

42:                                               ; preds = %33
  %43 = add nsw i32 %.079102, -1
  %44 = icmp slt i32 %.079102, 1
  br i1 %44, label %._crit_edge.thread, label %45

45:                                               ; preds = %.thread, %42
  %.197 = phi i32 [ %43, %42 ], [ %.079102, %.thread ]
  %46 = icmp slt i32 %.197, 0
  %47 = icmp slt i64 %indvars.iv128, 1
  %or.cond.not95 = or i1 %46, %47
  %indvars.iv.next129 = add nsw i64 %indvars.iv128, -1
  br i1 %or.cond.not95, label %.critedge, label %33, !llvm.loop !12

._crit_edge.thread:                               ; preds = %42
  %48 = trunc nuw i64 %indvars.iv128 to i32
  store i32 %48, ptr %32, align 4, !tbaa !10
  br label %54

.critedge:                                        ; preds = %45, %.preheader100
  %49 = getelementptr inbounds [2001 x i32], ptr @j, i64 0, i64 %.pre
  store i32 -1, ptr %49, align 4, !tbaa !10
  %50 = getelementptr inbounds [2001 x i32], ptr @k, i64 0, i64 %.pre
  store i32 -1, ptr %50, align 4, !tbaa !10
  br label %54

51:                                               ; preds = %25
  %52 = getelementptr inbounds [2001 x i32], ptr @j, i64 0, i64 %.pre
  store i32 -1, ptr %52, align 4, !tbaa !10
  %53 = getelementptr inbounds [2001 x i32], ptr @k, i64 0, i64 %.pre
  store i32 -1, ptr %53, align 4, !tbaa !10
  br label %54

54:                                               ; preds = %._crit_edge.thread, %.critedge, %51
  %exitcond.not = icmp eq i64 %.pre, %wide.trip.count
  br i1 %exitcond.not, label %.lr.ph109.preheader, label %25, !llvm.loop !14

.lr.ph113.preheader:                              ; preds = %68
  %55 = add nuw nsw i64 %16, 1
  %wide.trip.count144 = and i64 %55, 4294967295
  br label %.lr.ph113

.lr.ph109:                                        ; preds = %.lr.ph109.preheader, %68
  %indvars.iv131 = phi i64 [ 1, %.lr.ph109.preheader ], [ %indvars.iv.next132, %68 ]
  %56 = getelementptr inbounds [2001 x i32], ptr @j, i64 0, i64 %indvars.iv131
  %57 = load i32, ptr %56, align 4, !tbaa !10
  %.not91 = icmp eq i32 %57, -1
  br i1 %.not91, label %68, label %58

58:                                               ; preds = %.lr.ph109
  %59 = getelementptr inbounds [2001 x i32], ptr @k, i64 0, i64 %indvars.iv131
  %60 = load i32, ptr %59, align 4, !tbaa !10
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %68

62:                                               ; preds = %58
  %63 = sext i32 %57 to i64
  %64 = getelementptr inbounds [2001 x i32], ptr @dp, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !10
  %66 = add nsw i32 %65, 1
  %67 = getelementptr inbounds [2001 x i32], ptr @dp, i64 0, i64 %indvars.iv131
  store i32 %66, ptr %67, align 4, !tbaa !10
  br label %68

68:                                               ; preds = %62, %58, %.lr.ph109
  %69 = getelementptr inbounds [2001 x i32], ptr @dp, i64 0, i64 %indvars.iv131
  %70 = add nsw i64 %indvars.iv131, -1
  %71 = getelementptr inbounds [2001 x i32], ptr @dp, i64 0, i64 %70
  %72 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %69, ptr noundef nonnull align 4 dereferenceable(4) %71)
  %73 = load i32, ptr %72, align 4, !tbaa !10
  store i32 %73, ptr %69, align 4, !tbaa !10
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %exitcond135.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count134
  br i1 %exitcond135.not, label %.lr.ph113.preheader, label %.lr.ph109, !llvm.loop !15

.preheader:                                       ; preds = %._crit_edge114, %0
  %.not86123 = icmp slt i32 %17, 0
  br i1 %.not86123, label %._crit_edge126, label %.lr.ph125

.lr.ph125:                                        ; preds = %.preheader
  %.not87118 = icmp eq i32 %17, 0
  br i1 %.not87118, label %._crit_edge126.loopexit, label %.lr.ph121.preheader

.lr.ph121.preheader:                              ; preds = %.lr.ph125
  %74 = add nuw nsw i64 %16, 1
  %wide.trip.count154 = and i64 %74, 4294967295
  br label %.lr.ph121

.lr.ph113:                                        ; preds = %.lr.ph113.preheader, %._crit_edge114
  %indvars.iv141 = phi i64 [ 1, %.lr.ph113.preheader ], [ %indvars.iv.next142, %._crit_edge114 ]
  %75 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %indvars.iv141
  store i32 -10000, ptr %75, align 4, !tbaa !10
  %76 = add nsw i64 %indvars.iv141, -1
  br label %77

._crit_edge114:                                   ; preds = %110
  %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
  %exitcond145.not = icmp eq i64 %indvars.iv.next142, %wide.trip.count144
  br i1 %exitcond145.not, label %.preheader, label %.lr.ph113, !llvm.loop !16

77:                                               ; preds = %.lr.ph113, %110
  %indvars.iv136 = phi i64 [ 1, %.lr.ph113 ], [ %indvars.iv.next137, %110 ]
  %78 = icmp ult i64 %indvars.iv136, %indvars.iv141
  br i1 %78, label %79, label %81

79:                                               ; preds = %77
  %80 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %indvars.iv141, i64 %indvars.iv136
  store i32 -10000, ptr %80, align 4, !tbaa !10
  br label %110

81:                                               ; preds = %77
  %82 = icmp ugt i64 %indvars.iv136, %indvars.iv141
  br i1 %82, label %83, label %103

83:                                               ; preds = %81
  %84 = getelementptr inbounds [2001 x i32], ptr @j, i64 0, i64 %indvars.iv136
  %85 = load i32, ptr %84, align 4, !tbaa !10
  %.not89 = icmp eq i32 %85, -1
  br i1 %.not89, label %103, label %86

86:                                               ; preds = %83
  %87 = getelementptr inbounds [2001 x i32], ptr @k, i64 0, i64 %indvars.iv136
  %88 = load i32, ptr %87, align 4, !tbaa !10
  %89 = sext i32 %88 to i64
  %.not90 = icmp slt i64 %indvars.iv141, %89
  br i1 %.not90, label %103, label %90

90:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %91 = sub nsw i64 %indvars.iv141, %89
  %92 = sext i32 %85 to i64
  %93 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %91, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !10
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %1, align 4, !tbaa !10
  %96 = add nsw i64 %indvars.iv136, -1
  %97 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %76, i64 %96
  %98 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %indvars.iv141, i64 %96
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %97, ptr noundef nonnull align 4 dereferenceable(4) %98)
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %99)
  %101 = load i32, ptr %100, align 4, !tbaa !10
  %102 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %indvars.iv141, i64 %indvars.iv136
  store i32 %101, ptr %102, align 4, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  br label %110

103:                                              ; preds = %86, %83, %81
  %104 = add nsw i64 %indvars.iv136, -1
  %105 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %76, i64 %104
  %106 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %indvars.iv141, i64 %104
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %105, ptr noundef nonnull align 4 dereferenceable(4) %106)
  %108 = load i32, ptr %107, align 4, !tbaa !10
  %109 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %indvars.iv141, i64 %indvars.iv136
  store i32 %108, ptr %109, align 4, !tbaa !10
  br label %110

110:                                              ; preds = %79, %103, %90
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %exitcond140.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count144
  br i1 %exitcond140.not, label %._crit_edge114, label %77, !llvm.loop !17

._crit_edge126.loopexit:                          ; preds = %.lr.ph125
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef nonnull @.str)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %._crit_edge126

._crit_edge126:                                   ; preds = %._crit_edge122, %._crit_edge126.loopexit, %.preheader
  %113 = call 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_)
  ret i32 0

.lr.ph121:                                        ; preds = %.lr.ph121.preheader, %._crit_edge122
  %indvars.iv151 = phi i64 [ 0, %.lr.ph121.preheader ], [ %indvars.iv.next152, %._crit_edge122 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !10
  br label %116

._crit_edge122:                                   ; preds = %116
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %119)
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %114, ptr noundef nonnull @.str)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1
  %exitcond155.not = icmp eq i64 %indvars.iv.next152, %wide.trip.count154
  br i1 %exitcond155.not, label %._crit_edge126, label %.lr.ph121, !llvm.loop !18

116:                                              ; preds = %.lr.ph121, %116
  %indvars.iv146 = phi i64 [ 1, %.lr.ph121 ], [ %indvars.iv.next147, %116 ]
  %117 = getelementptr inbounds [2001 x [2001 x i32]], ptr @dp, i64 0, i64 %indvars.iv151, i64 %indvars.iv146
  %118 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %117)
  %119 = load i32, ptr %118, align 4, !tbaa !10
  store i32 %119, ptr %2, align 4, !tbaa !10
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %exitcond150.not = icmp eq i64 %indvars.iv.next147, %wide.trip.count154
  br i1 %exitcond150.not, label %._crit_edge122, label %116, !llvm.loop !19
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #2 align 2

; 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

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

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


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