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

; 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::__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" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@dp = external dso_local global [2010 x [2010 x i64]], align 16
@dp2 = external dso_local global [2010 x [2010 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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)) #1

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

27:                                               ; preds = %48, %0
  %28 = load i32, ptr %4, align 4, !tbaa !8
  %29 = load i32, ptr @m, align 4, !tbaa !8
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %51

32:                                               ; preds = %27
  %33 = load i32, ptr %4, align 4, !tbaa !8
  %34 = sext i32 %33 to i64
  %35 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %34)
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = sext i8 %36 to i32
  %38 = icmp eq i32 %37, 40
  br i1 %38, label %39, label %42

39:                                               ; preds = %32
  %40 = load i32, ptr %2, align 4, !tbaa !8
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %2, align 4, !tbaa !8
  br label %45

42:                                               ; preds = %32
  %43 = load i32, ptr %2, align 4, !tbaa !8
  %44 = add nsw i32 %43, -1
  store i32 %44, ptr %2, align 4, !tbaa !8
  br label %45

45:                                               ; preds = %42, %39
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %47 = load i32, ptr %46, align 4, !tbaa !8
  store i32 %47, ptr %3, align 4, !tbaa !8
  br label %48

48:                                               ; preds = %45
  %49 = load i32, ptr %4, align 4, !tbaa !8
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %4, align 4, !tbaa !8
  br label %27, !llvm.loop !12

51:                                               ; preds = %31
  %52 = load i32, ptr %3, align 4, !tbaa !8
  %53 = sub nsw i32 0, %52
  store i32 %53, ptr %3, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %54 = load i32, ptr @n, align 4, !tbaa !8
  %55 = load i32, ptr @m, align 4, !tbaa !8
  %56 = sub nsw i32 %54, %55
  store i32 %56, ptr %5, align 4, !tbaa !8
  %57 = load i32, ptr %3, align 4, !tbaa !8
  %58 = load i32, ptr %5, align 4, !tbaa !8
  %59 = icmp sgt i32 %57, %58
  br i1 %59, label %60, label %63

60:                                               ; preds = %51
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  br label %328

63:                                               ; preds = %51
  store i64 1, ptr @dp, align 16, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !8
  br label %64

64:                                               ; preds = %154, %63
  %65 = load i32, ptr %7, align 4, !tbaa !8
  %66 = load i32, ptr %5, align 4, !tbaa !8
  %67 = icmp sle i32 %65, %66
  br i1 %67, label %69, label %68

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

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

70:                                               ; preds = %150, %69
  %71 = load i32, ptr %8, align 4, !tbaa !8
  %72 = load i32, ptr %7, align 4, !tbaa !8
  %73 = icmp sle i32 %71, %72
  br i1 %73, label %75, label %74

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

75:                                               ; preds = %70
  %76 = load i32, ptr %8, align 4, !tbaa !8
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %78, label %114

78:                                               ; preds = %75
  %79 = load i32, ptr %7, align 4, !tbaa !8
  %80 = sub nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %81
  %83 = load i32, ptr %8, align 4, !tbaa !8
  %84 = sub nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [2010 x i64], ptr %82, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !14
  %88 = load i32, ptr %7, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %89
  %91 = load i32, ptr %8, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [2010 x i64], ptr %90, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !14
  %95 = add nsw i64 %94, %87
  store i64 %95, ptr %93, align 8, !tbaa !14
  %96 = load i32, ptr %7, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %97
  %99 = load i32, ptr %8, align 4, !tbaa !8
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [2010 x i64], ptr %98, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !14
  %103 = icmp sge i64 %102, 1000000007
  br i1 %103, label %104, label %113

104:                                              ; preds = %78
  %105 = load i32, ptr %7, align 4, !tbaa !8
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %106
  %108 = load i32, ptr %8, align 4, !tbaa !8
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [2010 x i64], ptr %107, i64 0, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !14
  %112 = sub nsw i64 %111, 1000000007
  store i64 %112, ptr %110, align 8, !tbaa !14
  br label %113

113:                                              ; preds = %104, %78
  br label %114

114:                                              ; preds = %113, %75
  %115 = load i32, ptr %7, align 4, !tbaa !8
  %116 = sub nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %117
  %119 = load i32, ptr %8, align 4, !tbaa !8
  %120 = add nsw i32 %119, 1
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [2010 x i64], ptr %118, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !14
  %124 = load i32, ptr %7, align 4, !tbaa !8
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %125
  %127 = load i32, ptr %8, align 4, !tbaa !8
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [2010 x i64], ptr %126, i64 0, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !14
  %131 = add nsw i64 %130, %123
  store i64 %131, ptr %129, align 8, !tbaa !14
  %132 = load i32, ptr %7, align 4, !tbaa !8
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %133
  %135 = load i32, ptr %8, align 4, !tbaa !8
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [2010 x i64], ptr %134, i64 0, i64 %136
  %138 = load i64, ptr %137, align 8, !tbaa !14
  %139 = icmp sge i64 %138, 1000000007
  br i1 %139, label %140, label %149

140:                                              ; preds = %114
  %141 = load i32, ptr %7, align 4, !tbaa !8
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %142
  %144 = load i32, ptr %8, align 4, !tbaa !8
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [2010 x i64], ptr %143, i64 0, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !14
  %148 = sub nsw i64 %147, 1000000007
  store i64 %148, ptr %146, align 8, !tbaa !14
  br label %149

149:                                              ; preds = %140, %114
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %8, align 4, !tbaa !8
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %8, align 4, !tbaa !8
  br label %70, !llvm.loop !16

153:                                              ; preds = %74
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %7, align 4, !tbaa !8
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %7, align 4, !tbaa !8
  br label %64, !llvm.loop !17

157:                                              ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %158

158:                                              ; preds = %227, %157
  %159 = load i32, ptr %9, align 4, !tbaa !8
  %160 = load i32, ptr %5, align 4, !tbaa !8
  %161 = icmp sle i32 %159, %160
  br i1 %161, label %163, label %162

162:                                              ; preds = %158
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %230

163:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %164 = load i32, ptr %3, align 4, !tbaa !8
  store i32 %164, ptr %10, align 4, !tbaa !8
  br label %165

165:                                              ; preds = %223, %163
  %166 = load i32, ptr %10, align 4, !tbaa !8
  %167 = load i32, ptr %9, align 4, !tbaa !8
  %168 = icmp sle i32 %166, %167
  br i1 %168, label %170, label %169

169:                                              ; preds = %165
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %226

170:                                              ; preds = %165
  %171 = load i32, ptr %10, align 4, !tbaa !8
  %172 = load i32, ptr %2, align 4, !tbaa !8
  %173 = add nsw i32 %171, %172
  %174 = load i32, ptr %5, align 4, !tbaa !8
  %175 = icmp sle i32 %173, %174
  br i1 %175, label %176, label %222

176:                                              ; preds = %170
  %177 = load i32, ptr %9, align 4, !tbaa !8
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %178
  %180 = load i32, ptr %10, align 4, !tbaa !8
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [2010 x i64], ptr %179, i64 0, i64 %181
  %183 = load i64, ptr %182, align 8, !tbaa !14
  %184 = load i32, ptr %5, align 4, !tbaa !8
  %185 = load i32, ptr %9, align 4, !tbaa !8
  %186 = sub nsw i32 %184, %185
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %187
  %189 = load i32, ptr %10, align 4, !tbaa !8
  %190 = load i32, ptr %2, align 4, !tbaa !8
  %191 = add nsw i32 %189, %190
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [2010 x i64], ptr %188, i64 0, i64 %192
  %194 = load i64, ptr %193, align 8, !tbaa !14
  %195 = add nsw i64 %194, %183
  store i64 %195, ptr %193, align 8, !tbaa !14
  %196 = load i32, ptr %5, align 4, !tbaa !8
  %197 = load i32, ptr %9, align 4, !tbaa !8
  %198 = sub nsw i32 %196, %197
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %199
  %201 = load i32, ptr %10, align 4, !tbaa !8
  %202 = load i32, ptr %2, align 4, !tbaa !8
  %203 = add nsw i32 %201, %202
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [2010 x i64], ptr %200, i64 0, i64 %204
  %206 = load i64, ptr %205, align 8, !tbaa !14
  %207 = icmp sge i64 %206, 1000000007
  br i1 %207, label %208, label %221

208:                                              ; preds = %176
  %209 = load i32, ptr %5, align 4, !tbaa !8
  %210 = load i32, ptr %9, align 4, !tbaa !8
  %211 = sub nsw i32 %209, %210
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %212
  %214 = load i32, ptr %10, align 4, !tbaa !8
  %215 = load i32, ptr %2, align 4, !tbaa !8
  %216 = add nsw i32 %214, %215
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [2010 x i64], ptr %213, i64 0, i64 %217
  %219 = load i64, ptr %218, align 8, !tbaa !14
  %220 = sub nsw i64 %219, 1000000007
  store i64 %220, ptr %218, align 8, !tbaa !14
  br label %221

221:                                              ; preds = %208, %176
  br label %222

222:                                              ; preds = %221, %170
  br label %223

223:                                              ; preds = %222
  %224 = load i32, ptr %10, align 4, !tbaa !8
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %10, align 4, !tbaa !8
  br label %165, !llvm.loop !18

226:                                              ; preds = %169
  br label %227

227:                                              ; preds = %226
  %228 = load i32, ptr %9, align 4, !tbaa !8
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %9, align 4, !tbaa !8
  br label %158, !llvm.loop !19

230:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %231 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %231, ptr %11, align 4, !tbaa !8
  br label %232

232:                                              ; preds = %321, %230
  %233 = load i32, ptr %11, align 4, !tbaa !8
  %234 = icmp sge i32 %233, 0
  br i1 %234, label %236, label %235

235:                                              ; preds = %232
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %324

236:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !8
  br label %237

237:                                              ; preds = %317, %236
  %238 = load i32, ptr %12, align 4, !tbaa !8
  %239 = load i32, ptr @n, align 4, !tbaa !8
  %240 = icmp sle i32 %238, %239
  br i1 %240, label %242, label %241

241:                                              ; preds = %237
  store i32 20, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %320

242:                                              ; preds = %237
  %243 = load i32, ptr %11, align 4, !tbaa !8
  %244 = add nsw i32 %243, 1
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %245
  %247 = load i32, ptr %12, align 4, !tbaa !8
  %248 = add nsw i32 %247, 1
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [2010 x i64], ptr %246, i64 0, i64 %249
  %251 = load i64, ptr %250, align 8, !tbaa !14
  %252 = load i32, ptr %11, align 4, !tbaa !8
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %253
  %255 = load i32, ptr %12, align 4, !tbaa !8
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [2010 x i64], ptr %254, i64 0, i64 %256
  %258 = load i64, ptr %257, align 8, !tbaa !14
  %259 = add nsw i64 %258, %251
  store i64 %259, ptr %257, align 8, !tbaa !14
  %260 = load i32, ptr %11, align 4, !tbaa !8
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %261
  %263 = load i32, ptr %12, align 4, !tbaa !8
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [2010 x i64], ptr %262, i64 0, i64 %264
  %266 = load i64, ptr %265, align 8, !tbaa !14
  %267 = icmp sge i64 %266, 1000000007
  br i1 %267, label %268, label %277

268:                                              ; preds = %242
  %269 = load i32, ptr %11, align 4, !tbaa !8
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %270
  %272 = load i32, ptr %12, align 4, !tbaa !8
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [2010 x i64], ptr %271, i64 0, i64 %273
  %275 = load i64, ptr %274, align 8, !tbaa !14
  %276 = sub nsw i64 %275, 1000000007
  store i64 %276, ptr %274, align 8, !tbaa !14
  br label %277

277:                                              ; preds = %268, %242
  %278 = load i32, ptr %12, align 4, !tbaa !8
  %279 = icmp sgt i32 %278, 0
  br i1 %279, label %280, label %316

280:                                              ; preds = %277
  %281 = load i32, ptr %11, align 4, !tbaa !8
  %282 = add nsw i32 %281, 1
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %283
  %285 = load i32, ptr %12, align 4, !tbaa !8
  %286 = sub nsw i32 %285, 1
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [2010 x i64], ptr %284, i64 0, i64 %287
  %289 = load i64, ptr %288, align 8, !tbaa !14
  %290 = load i32, ptr %11, align 4, !tbaa !8
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %291
  %293 = load i32, ptr %12, align 4, !tbaa !8
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [2010 x i64], ptr %292, i64 0, i64 %294
  %296 = load i64, ptr %295, align 8, !tbaa !14
  %297 = add nsw i64 %296, %289
  store i64 %297, ptr %295, align 8, !tbaa !14
  %298 = load i32, ptr %11, align 4, !tbaa !8
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %299
  %301 = load i32, ptr %12, align 4, !tbaa !8
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [2010 x i64], ptr %300, i64 0, i64 %302
  %304 = load i64, ptr %303, align 8, !tbaa !14
  %305 = icmp sge i64 %304, 1000000007
  br i1 %305, label %306, label %315

306:                                              ; preds = %280
  %307 = load i32, ptr %11, align 4, !tbaa !8
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %308
  %310 = load i32, ptr %12, align 4, !tbaa !8
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [2010 x i64], ptr %309, i64 0, i64 %311
  %313 = load i64, ptr %312, align 8, !tbaa !14
  %314 = sub nsw i64 %313, 1000000007
  store i64 %314, ptr %312, align 8, !tbaa !14
  br label %315

315:                                              ; preds = %306, %280
  br label %316

316:                                              ; preds = %315, %277
  br label %317

317:                                              ; preds = %316
  %318 = load i32, ptr %12, align 4, !tbaa !8
  %319 = add nsw i32 %318, 1
  store i32 %319, ptr %12, align 4, !tbaa !8
  br label %237, !llvm.loop !20

320:                                              ; preds = %241
  br label %321

321:                                              ; preds = %320
  %322 = load i32, ptr %11, align 4, !tbaa !8
  %323 = add nsw i32 %322, -1
  store i32 %323, ptr %11, align 4, !tbaa !8
  br label %232, !llvm.loop !21

324:                                              ; preds = %235
  %325 = load i64, ptr @dp2, align 16, !tbaa !14
  %326 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %325)
  %327 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %326, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  br label %328

328:                                              ; preds = %324, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %329 = load i32, ptr %1, align 4
  ret i32 %329
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #4 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)) #3

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

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

; 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) #4 align 2

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

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

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

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

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


; 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::__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" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@dp = external dso_local local_unnamed_addr global [2010 x [2010 x i64]], align 16
@dp2 = external dso_local local_unnamed_addr global [2010 x [2010 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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)) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %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 @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %16 = 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) %15, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !8
  %17 = load i32, ptr @m, align 4, !tbaa !8
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %19 = phi i32 [ 0, %0 ], [ %29, %.lr.ph ]
  %.lcssa = phi i32 [ %17, %0 ], [ %30, %.lr.ph ]
  %20 = sub nsw i32 0, %19
  store i32 %20, ptr %2, align 4, !tbaa !8
  %21 = load i32, ptr @n, align 4, !tbaa !8
  %22 = sub nsw i32 %21, %.lcssa
  %23 = icmp slt i32 %22, %20
  br i1 %23, label %33, label %35

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %24 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv)
  %25 = load i8, ptr %24, align 1, !tbaa !11
  %26 = icmp eq i8 %25, 40
  %27 = load i32, ptr %1, align 4
  %storemerge91.v = select i1 %26, i32 1, i32 -1
  %storemerge91 = add nsw i32 %storemerge91.v, %27
  store i32 %storemerge91, ptr %1, align 4, !tbaa !8
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %29 = load i32, ptr %28, align 4, !tbaa !8
  store i32 %29, ptr %2, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = load i32, ptr @m, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = icmp slt i64 %indvars.iv.next, %31
  br i1 %32, label %.lr.ph, label %._crit_edge, !llvm.loop !12

33:                                               ; preds = %._crit_edge
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  br label %133

35:                                               ; preds = %._crit_edge
  store i64 1, ptr @dp, align 16, !tbaa !14
  %.not99 = icmp slt i32 %22, 1
  br i1 %.not99, label %.preheader95, label %.preheader96.preheader

.preheader96.preheader:                           ; preds = %35
  %36 = add i32 %21, 1
  %37 = sub i32 %36, %.lcssa
  %wide.trip.count129 = zext i32 %37 to i64
  br label %.peel.next

.peel.next:                                       ; preds = %.loopexit, %.preheader96.preheader
  %indvars.iv124 = phi i64 [ 1, %.preheader96.preheader ], [ %indvars.iv.next125, %.loopexit ]
  %indvars.iv122 = phi i64 [ 2, %.preheader96.preheader ], [ %indvars.iv.next123, %.loopexit ]
  %38 = add nsw i64 %indvars.iv124, -1
  %.phi.trans.insert = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %indvars.iv124, i64 0
  %.pre = load i64, ptr %.phi.trans.insert, align 16, !tbaa !14
  %39 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %38, i64 1
  %40 = load i64, ptr %39, align 8, !tbaa !14
  %41 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %indvars.iv124, i64 0
  %42 = add nsw i64 %.pre, %40
  %43 = icmp sgt i64 %42, 1000000006
  %44 = add nsw i64 %42, -1000000007
  %spec.select.peel = select i1 %43, i64 %44, i64 %42
  store i64 %spec.select.peel, ptr %41, align 16, !tbaa !14
  %min.iters.check = icmp ult i64 %indvars.iv124, 2
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.peel.next
  %indvars.iv116.ph = phi i64 [ 1, %.peel.next ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.peel.next
  %n.vec = and i64 %indvars.iv124, 9223372036854775806
  %ind.end = or i64 %indvars.iv124, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %45 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %38, i64 %index
  %wide.load = load <2 x i64>, ptr %45, align 16, !tbaa !14
  %46 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %indvars.iv124, i64 %offset.idx
  %wide.load166 = load <2 x i64>, ptr %46, align 8, !tbaa !14
  %47 = add nsw <2 x i64> %wide.load166, %wide.load
  %48 = icmp sgt <2 x i64> %47, <i64 1000000006, i64 1000000006>
  %49 = add nsw <2 x i64> %47, <i64 -1000000007, i64 -1000000007>
  %50 = select <2 x i1> %48, <2 x i64> %49, <2 x i64> %47
  %51 = add nuw nsw i64 %index, 2
  %52 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %38, i64 %51
  %wide.load167 = load <2 x i64>, ptr %52, align 16, !tbaa !14
  %53 = add nsw <2 x i64> %50, %wide.load167
  %54 = icmp sgt <2 x i64> %53, <i64 1000000006, i64 1000000006>
  %55 = add nsw <2 x i64> %53, <i64 -1000000007, i64 -1000000007>
  %56 = select <2 x i1> %54, <2 x i64> %55, <2 x i64> %53
  store <2 x i64> %56, ptr %46, align 8, !tbaa !14
  %index.next = add nuw i64 %index, 2
  %57 = icmp eq i64 %index.next, %n.vec
  br i1 %57, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %indvars.iv124, %n.vec
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

.preheader95:                                     ; preds = %.loopexit, %35
  %.not83105 = icmp slt i32 %22, 0
  br i1 %.not83105, label %._crit_edge112, label %.preheader94.lr.ph

.preheader94.lr.ph:                               ; preds = %.preheader95
  %58 = load i32, ptr %1, align 4
  %59 = sext i32 %20 to i64
  %60 = sext i32 %58 to i64
  %61 = zext nneg i32 %22 to i64
  %62 = add i32 %21, 1
  %63 = sub i32 %62, %.lcssa
  %wide.trip.count = zext i32 %63 to i64
  br label %.preheader94

.loopexit:                                        ; preds = %scalar.ph, %middle.block
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %exitcond130.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count129
  br i1 %exitcond130.not, label %.preheader95, label %.peel.next, !llvm.loop !20

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %scalar.ph ], [ %indvars.iv116.ph, %scalar.ph.preheader ]
  %64 = add nsw i64 %indvars.iv116, -1
  %65 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %38, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !14
  %67 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %indvars.iv124, i64 %indvars.iv116
  %68 = load i64, ptr %67, align 8, !tbaa !14
  %69 = add nsw i64 %68, %66
  %70 = icmp sgt i64 %69, 1000000006
  %71 = add nsw i64 %69, -1000000007
  %spec.select162 = select i1 %70, i64 %71, i64 %69
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %72 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %38, i64 %indvars.iv.next117
  %73 = load i64, ptr %72, align 8, !tbaa !14
  %74 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %indvars.iv124, i64 %indvars.iv116
  %75 = add nsw i64 %spec.select162, %73
  %76 = icmp sgt i64 %75, 1000000006
  %77 = add nsw i64 %75, -1000000007
  %spec.select = select i1 %76, i64 %77, i64 %75
  store i64 %spec.select, ptr %74, align 8, !tbaa !14
  %exitcond.not = icmp eq i64 %indvars.iv.next117, %indvars.iv122
  br i1 %exitcond.not, label %.loopexit, label %scalar.ph, !llvm.loop !21

.preheader94:                                     ; preds = %.preheader94.lr.ph, %._crit_edge104
  %indvars.iv137 = phi i64 [ 0, %.preheader94.lr.ph ], [ %indvars.iv.next138, %._crit_edge104 ]
  %indvars.iv134 = phi i32 [ 1, %.preheader94.lr.ph ], [ %indvars.iv.next135, %._crit_edge104 ]
  %.not86101 = icmp slt i64 %indvars.iv137, %59
  br i1 %.not86101, label %._crit_edge104, label %.lr.ph103

.lr.ph103:                                        ; preds = %.preheader94
  %78 = sub nsw i64 %61, %indvars.iv137
  br label %82

.preheader93:                                     ; preds = %._crit_edge104
  %.not84107 = icmp slt i32 %21, 0
  br i1 %.not84107, label %._crit_edge112, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader93
  %79 = add nuw i32 %21, 1
  %80 = zext nneg i32 %22 to i64
  %wide.trip.count144 = zext i32 %79 to i64
  %81 = zext nneg i32 %21 to i64
  %n.vec173 = and i64 %81, 2147483646
  %ind.end174 = or i64 %81, 1
  %cmp.n183 = icmp eq i64 %n.vec173, %81
  br label %94

._crit_edge104:                                   ; preds = %93, %.preheader94
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %indvars.iv.next135 = add nuw i32 %indvars.iv134, 1
  %exitcond140.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count
  br i1 %exitcond140.not, label %.preheader93, label %.preheader94, !llvm.loop !22

82:                                               ; preds = %.lr.ph103, %93
  %indvars.iv131 = phi i64 [ %59, %.lr.ph103 ], [ %indvars.iv.next132, %93 ]
  %83 = add nsw i64 %indvars.iv131, %60
  %.not87 = icmp sgt i64 %83, %61
  br i1 %.not87, label %93, label %84

84:                                               ; preds = %82
  %85 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp, i64 0, i64 %indvars.iv137, i64 %indvars.iv131
  %86 = load i64, ptr %85, align 8, !tbaa !14
  %87 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %78, i64 %83
  %88 = load i64, ptr %87, align 8, !tbaa !14
  %89 = add nsw i64 %88, %86
  store i64 %89, ptr %87, align 8, !tbaa !14
  %90 = icmp sgt i64 %89, 1000000006
  br i1 %90, label %91, label %93

91:                                               ; preds = %84
  %92 = add nsw i64 %89, -1000000007
  store i64 %92, ptr %87, align 8, !tbaa !14
  br label %93

93:                                               ; preds = %82, %91, %84
  %indvars.iv.next132 = add nsw i64 %indvars.iv131, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next132 to i32
  %exitcond136.not = icmp eq i32 %indvars.iv134, %lftr.wideiv
  br i1 %exitcond136.not, label %._crit_edge104, label %82, !llvm.loop !23

94:                                               ; preds = %._crit_edge110, %.preheader.preheader
  %indvars.iv149 = phi i64 [ %80, %.preheader.preheader ], [ %indvars.iv.next150, %._crit_edge110 ]
  %95 = add nuw nsw i64 %indvars.iv149, 1
  %96 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %95, i64 1
  %97 = load i64, ptr %96, align 8, !tbaa !14
  %98 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %indvars.iv149, i64 0
  %99 = load i64, ptr %98, align 16, !tbaa !14
  %100 = add nsw i64 %99, %97
  %101 = icmp sgt i64 %100, 1000000006
  %102 = add nsw i64 %100, -1000000007
  %spec.select92.peel = select i1 %101, i64 %102, i64 %100
  store i64 %spec.select92.peel, ptr %98, align 16, !tbaa !14
  switch i32 %21, label %vector.body176 [
    i32 0, label %._crit_edge110
    i32 1, label %.peel.next147.preheader
  ]

vector.body176:                                   ; preds = %94, %vector.body176
  %index177 = phi i64 [ %index.next182, %vector.body176 ], [ 0, %94 ]
  %offset.idx178 = or disjoint i64 %index177, 1
  %103 = add nuw nsw i64 %index177, 2
  %104 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %95, i64 %103
  %wide.load179 = load <2 x i64>, ptr %104, align 16, !tbaa !14
  %105 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %indvars.iv149, i64 %offset.idx178
  %wide.load180 = load <2 x i64>, ptr %105, align 8, !tbaa !14
  %106 = add nsw <2 x i64> %wide.load180, %wide.load179
  %107 = icmp sgt <2 x i64> %106, <i64 1000000006, i64 1000000006>
  %108 = add nsw <2 x i64> %106, <i64 -1000000007, i64 -1000000007>
  %109 = select <2 x i1> %107, <2 x i64> %108, <2 x i64> %106
  %110 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %95, i64 %index177
  %wide.load181 = load <2 x i64>, ptr %110, align 16, !tbaa !14
  %111 = add nsw <2 x i64> %wide.load181, %109
  %112 = icmp sgt <2 x i64> %111, <i64 1000000006, i64 1000000006>
  %113 = add nsw <2 x i64> %111, <i64 -1000000007, i64 -1000000007>
  %114 = select <2 x i1> %112, <2 x i64> %113, <2 x i64> %111
  store <2 x i64> %114, ptr %105, align 8, !tbaa !14
  %index.next182 = add nuw i64 %index177, 2
  %115 = icmp eq i64 %index.next182, %n.vec173
  br i1 %115, label %middle.block168, label %vector.body176, !llvm.loop !24

middle.block168:                                  ; preds = %vector.body176
  br i1 %cmp.n183, label %._crit_edge110, label %.peel.next147.preheader

.peel.next147.preheader:                          ; preds = %94, %middle.block168
  %indvars.iv141.ph = phi i64 [ 1, %94 ], [ %ind.end174, %middle.block168 ]
  br label %.peel.next147

._crit_edge112:                                   ; preds = %._crit_edge110, %.preheader95, %.preheader93
  %116 = load i64, ptr @dp2, align 16, !tbaa !14
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %116)
  br label %133

._crit_edge110:                                   ; preds = %.peel.next147, %middle.block168, %94
  %indvars.iv.next150 = add nsw i64 %indvars.iv149, -1
  %118 = trunc nuw i64 %indvars.iv149 to i32
  %119 = icmp sgt i32 %118, 0
  br i1 %119, label %94, label %._crit_edge112, !llvm.loop !25

.peel.next147:                                    ; preds = %.peel.next147.preheader, %.peel.next147
  %indvars.iv141 = phi i64 [ %indvars.iv.next142, %.peel.next147 ], [ %indvars.iv141.ph, %.peel.next147.preheader ]
  %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
  %120 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %95, i64 %indvars.iv.next142
  %121 = load i64, ptr %120, align 8, !tbaa !14
  %122 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %indvars.iv149, i64 %indvars.iv141
  %123 = load i64, ptr %122, align 8, !tbaa !14
  %124 = add nsw i64 %123, %121
  %125 = icmp sgt i64 %124, 1000000006
  %126 = add nsw i64 %124, -1000000007
  %spec.select92 = select i1 %125, i64 %126, i64 %124
  %127 = add nsw i64 %indvars.iv141, -1
  %128 = getelementptr inbounds [2010 x [2010 x i64]], ptr @dp2, i64 0, i64 %95, i64 %127
  %129 = load i64, ptr %128, align 8, !tbaa !14
  %130 = add nsw i64 %129, %spec.select92
  %131 = icmp sgt i64 %130, 1000000006
  %132 = add nsw i64 %130, -1000000007
  %spec.select163 = select i1 %131, i64 %132, i64 %130
  store i64 %spec.select163, ptr %122, align 8, !tbaa !14
  %exitcond145.not = icmp eq i64 %indvars.iv.next142, %wide.trip.count144
  br i1 %exitcond145.not, label %._crit_edge110, label %.peel.next147, !llvm.loop !26

133:                                              ; preds = %._crit_edge112, %33
  %.sink = phi ptr [ %117, %._crit_edge112 ], [ %34, %33 ]
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #4 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 #3

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

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

; 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 #4 align 2

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"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 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !10, i64 0}
!16 = distinct !{!16, !13, !17, !18, !19}
!17 = !{!"llvm.loop.peeled.count", i32 1}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13, !17, !19, !18}
!22 = distinct !{!22, !13}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13, !17, !18, !19}
!25 = distinct !{!25, !13}
!26 = distinct !{!26, !13, !17, !19, !18}


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