; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/University CodeSprint 2016/Problem G (G)

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

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

@MOD = external dso_local global i64, align 8
@n = external dso_local global i32, align 4
@C = external dso_local global [3001 x [3001 x i64]], align 16
@MC = external dso_local global [3001 x [3001 x i64]], align 16
@dp = external dso_local global [3001 x [3001 x i64]], align 16
@f = external dso_local global [3001 x i64], align 16
@invf = external dso_local global [3001 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

36:                                               ; preds = %55, %0
  %37 = load i32, ptr %2, align 4, !tbaa !11
  %38 = load i32, ptr @n, align 4, !tbaa !11
  %39 = icmp sle i32 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  %42 = load i32, ptr %2, align 4, !tbaa !11
  %43 = sub nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [3001 x i64], ptr @f, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !8
  %47 = load i32, ptr %2, align 4, !tbaa !11
  %48 = sext i32 %47 to i64
  %49 = mul nsw i64 %46, %48
  %50 = load i64, ptr @MOD, align 8, !tbaa !8
  %51 = srem i64 %49, %50
  %52 = load i32, ptr %2, align 4, !tbaa !11
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [3001 x i64], ptr @f, i64 0, i64 %53
  store i64 %51, ptr %54, align 8, !tbaa !8
  br label %55

55:                                               ; preds = %41
  %56 = load i32, ptr %2, align 4, !tbaa !11
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %2, align 4, !tbaa !11
  br label %36, !llvm.loop !13

58:                                               ; preds = %40
  %59 = load i32, ptr @n, align 4, !tbaa !11
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [3001 x i64], ptr @f, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !8
  %63 = call noundef i64 @_Z3invx(i64 noundef %62)
  %64 = load i32, ptr @n, align 4, !tbaa !11
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [3001 x i64], ptr @invf, i64 0, i64 %65
  store i64 %63, ptr %66, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %67 = load i32, ptr @n, align 4, !tbaa !11
  %68 = sub nsw i32 %67, 1
  store i32 %68, ptr %3, align 4, !tbaa !11
  br label %69

69:                                               ; preds = %88, %58
  %70 = load i32, ptr %3, align 4, !tbaa !11
  %71 = icmp sge i32 %70, 0
  br i1 %71, label %73, label %72

72:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %91

73:                                               ; preds = %69
  %74 = load i32, ptr %3, align 4, !tbaa !11
  %75 = add nsw i32 %74, 1
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [3001 x i64], ptr @invf, i64 0, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !8
  %79 = load i32, ptr %3, align 4, !tbaa !11
  %80 = add nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %82 = mul nsw i64 %78, %81
  %83 = load i64, ptr @MOD, align 8, !tbaa !8
  %84 = srem i64 %82, %83
  %85 = load i32, ptr %3, align 4, !tbaa !11
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [3001 x i64], ptr @invf, i64 0, i64 %86
  store i64 %84, ptr %87, align 8, !tbaa !8
  br label %88

88:                                               ; preds = %73
  %89 = load i32, ptr %3, align 4, !tbaa !11
  %90 = add nsw i32 %89, -1
  store i32 %90, ptr %3, align 4, !tbaa !11
  br label %69, !llvm.loop !15

91:                                               ; preds = %72
  store i64 1, ptr @C, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !11
  br label %92

92:                                               ; preds = %142, %91
  %93 = load i32, ptr %4, align 4, !tbaa !11
  %94 = load i32, ptr @n, align 4, !tbaa !11
  %95 = icmp sle i32 %93, %94
  br i1 %95, label %97, label %96

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

97:                                               ; preds = %92
  %98 = load i32, ptr %4, align 4, !tbaa !11
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %99
  %101 = load i32, ptr %4, align 4, !tbaa !11
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [3001 x i64], ptr %100, i64 0, i64 %102
  store i64 1, ptr %103, align 8, !tbaa !8
  %104 = load i32, ptr %4, align 4, !tbaa !11
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %105
  %107 = getelementptr inbounds [3001 x i64], ptr %106, i64 0, i64 0
  store i64 1, ptr %107, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !11
  br label %108

108:                                              ; preds = %138, %97
  %109 = load i32, ptr %6, align 4, !tbaa !11
  %110 = load i32, ptr %4, align 4, !tbaa !11
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

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

113:                                              ; preds = %108
  %114 = load i32, ptr %4, align 4, !tbaa !11
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %115
  %117 = load i32, ptr %6, align 4, !tbaa !11
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [3001 x i64], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %4, align 4, !tbaa !11
  %121 = sub nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %122
  %124 = load i32, ptr %6, align 4, !tbaa !11
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [3001 x i64], ptr %123, i64 0, i64 %125
  %127 = load i64, ptr %126, align 8, !tbaa !8
  %128 = load i32, ptr %4, align 4, !tbaa !11
  %129 = sub nsw i32 %128, 1
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %130
  %132 = load i32, ptr %6, align 4, !tbaa !11
  %133 = sub nsw i32 %132, 1
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [3001 x i64], ptr %131, i64 0, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !8
  %137 = add nsw i64 %127, %136
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %119, i64 noundef %137)
  br label %138

138:                                              ; preds = %113
  %139 = load i32, ptr %6, align 4, !tbaa !11
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %6, align 4, !tbaa !11
  br label %108, !llvm.loop !16

141:                                              ; preds = %112
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %4, align 4, !tbaa !11
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %4, align 4, !tbaa !11
  br label %92, !llvm.loop !17

145:                                              ; preds = %96
  store i64 1, ptr @MC, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !11
  br label %146

146:                                              ; preds = %212, %145
  %147 = load i32, ptr %7, align 4, !tbaa !11
  %148 = load i32, ptr @n, align 4, !tbaa !11
  %149 = icmp sle i32 %147, %148
  br i1 %149, label %151, label %150

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

151:                                              ; preds = %146
  %152 = load i32, ptr %7, align 4, !tbaa !11
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [3001 x [3001 x i64]], ptr @MC, i64 0, i64 %153
  %155 = getelementptr inbounds [3001 x i64], ptr %154, i64 0, i64 1
  store i64 1, ptr %155, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %156 = load i32, ptr %7, align 4, !tbaa !11
  %157 = mul nsw i32 2, %156
  store i32 %157, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 2, ptr %9, align 4, !tbaa !11
  br label %158

158:                                              ; preds = %205, %151
  %159 = load i32, ptr %8, align 4, !tbaa !11
  %160 = load i32, ptr @n, align 4, !tbaa !11
  %161 = icmp sle i32 %159, %160
  br i1 %161, label %163, label %162

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

163:                                              ; preds = %158
  %164 = load i32, ptr %8, align 4, !tbaa !11
  %165 = load i32, ptr %7, align 4, !tbaa !11
  %166 = sub nsw i32 %164, %165
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [3001 x [3001 x i64]], ptr @MC, i64 0, i64 %167
  %169 = load i32, ptr %9, align 4, !tbaa !11
  %170 = sub nsw i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [3001 x i64], ptr %168, i64 0, i64 %171
  %173 = load i64, ptr %172, align 8, !tbaa !8
  %174 = load i32, ptr %8, align 4, !tbaa !11
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %175
  %177 = load i32, ptr %7, align 4, !tbaa !11
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [3001 x i64], ptr %176, i64 0, i64 %178
  %180 = load i64, ptr %179, align 8, !tbaa !8
  %181 = mul nsw i64 %173, %180
  %182 = load i64, ptr @MOD, align 8, !tbaa !8
  %183 = srem i64 %181, %182
  %184 = load i32, ptr %9, align 4, !tbaa !11
  %185 = sub nsw i32 %184, 1
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [3001 x i64], ptr @f, i64 0, i64 %186
  %188 = load i64, ptr %187, align 8, !tbaa !8
  %189 = mul nsw i64 %183, %188
  %190 = load i64, ptr @MOD, align 8, !tbaa !8
  %191 = srem i64 %189, %190
  %192 = load i32, ptr %9, align 4, !tbaa !11
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [3001 x i64], ptr @invf, i64 0, i64 %193
  %195 = load i64, ptr %194, align 8, !tbaa !8
  %196 = mul nsw i64 %191, %195
  %197 = load i64, ptr @MOD, align 8, !tbaa !8
  %198 = srem i64 %196, %197
  %199 = load i32, ptr %8, align 4, !tbaa !11
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [3001 x [3001 x i64]], ptr @MC, i64 0, i64 %200
  %202 = load i32, ptr %9, align 4, !tbaa !11
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [3001 x i64], ptr %201, i64 0, i64 %203
  store i64 %198, ptr %204, align 8, !tbaa !8
  br label %205

205:                                              ; preds = %163
  %206 = load i32, ptr %7, align 4, !tbaa !11
  %207 = load i32, ptr %8, align 4, !tbaa !11
  %208 = add nsw i32 %207, %206
  store i32 %208, ptr %8, align 4, !tbaa !11
  %209 = load i32, ptr %9, align 4, !tbaa !11
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %9, align 4, !tbaa !11
  br label %158, !llvm.loop !18

211:                                              ; preds = %162
  br label %212

212:                                              ; preds = %211
  %213 = load i32, ptr %7, align 4, !tbaa !11
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %7, align 4, !tbaa !11
  br label %146, !llvm.loop !19

215:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %216 = load i32, ptr @n, align 4, !tbaa !11
  %217 = add nsw i32 %216, 1
  %218 = sdiv i32 %217, 2
  %219 = sub nsw i32 %218, 1
  store i32 %219, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %220

220:                                              ; preds = %229, %215
  %221 = load i32, ptr %11, align 4, !tbaa !11
  %222 = load i32, ptr %10, align 4, !tbaa !11
  %223 = icmp sle i32 %221, %222
  br i1 %223, label %225, label %224

224:                                              ; preds = %220
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %232

225:                                              ; preds = %220
  %226 = load i32, ptr %11, align 4, !tbaa !11
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [3001 x i64], ptr @dp, i64 0, i64 %227
  store i64 1, ptr %228, align 8, !tbaa !8
  br label %229

229:                                              ; preds = %225
  %230 = load i32, ptr %11, align 4, !tbaa !11
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %11, align 4, !tbaa !11
  br label %220, !llvm.loop !20

232:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !11
  br label %233

233:                                              ; preds = %242, %232
  %234 = load i32, ptr %12, align 4, !tbaa !11
  %235 = load i32, ptr %10, align 4, !tbaa !11
  %236 = icmp sle i32 %234, %235
  br i1 %236, label %238, label %237

237:                                              ; preds = %233
  store i32 23, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %245

238:                                              ; preds = %233
  %239 = load i32, ptr %12, align 4, !tbaa !11
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [3001 x i64], ptr getelementptr inbounds ([3001 x [3001 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 %240
  store i64 1, ptr %241, align 8, !tbaa !8
  br label %242

242:                                              ; preds = %238
  %243 = load i32, ptr %12, align 4, !tbaa !11
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %12, align 4, !tbaa !11
  br label %233, !llvm.loop !21

245:                                              ; preds = %237
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 2, ptr %15, align 4, !tbaa !11
  br label %246

246:                                              ; preds = %408, %245
  %247 = load i32, ptr %15, align 4, !tbaa !11
  %248 = load i32, ptr @n, align 4, !tbaa !11
  %249 = icmp slt i32 %247, %248
  br i1 %249, label %251, label %250

250:                                              ; preds = %246
  store i32 26, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %411

251:                                              ; preds = %246
  %252 = load i32, ptr %15, align 4, !tbaa !11
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %253
  %255 = getelementptr inbounds [3001 x i64], ptr %254, i64 0, i64 1
  store i64 1, ptr %255, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %256 = load i32, ptr %10, align 4, !tbaa !11
  %257 = add nsw i32 %256, 1
  store i32 %257, ptr %17, align 4, !tbaa !11
  %258 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %259 = load i32, ptr %258, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  store i32 %259, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 3, ptr %18, align 4, !tbaa !11
  br label %260

260:                                              ; preds = %348, %251
  %261 = load i32, ptr %18, align 4, !tbaa !11
  %262 = load i32, ptr %16, align 4, !tbaa !11
  %263 = icmp slt i32 %261, %262
  br i1 %263, label %265, label %264

264:                                              ; preds = %260
  store i32 29, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %351

265:                                              ; preds = %260
  %266 = load i32, ptr %18, align 4, !tbaa !11
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %267
  %269 = load i32, ptr %18, align 4, !tbaa !11
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [3001 x i64], ptr %268, i64 0, i64 %270
  %272 = load i64, ptr %271, align 8, !tbaa !8
  %273 = load i32, ptr %18, align 4, !tbaa !11
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %274
  %276 = load i32, ptr %18, align 4, !tbaa !11
  %277 = sub nsw i32 %276, 1
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [3001 x i64], ptr %275, i64 0, i64 %278
  %280 = load i64, ptr %279, align 8, !tbaa !8
  %281 = sub nsw i64 %272, %280
  store i64 %281, ptr %13, align 8, !tbaa !8
  %282 = load i64, ptr %13, align 8, !tbaa !8
  %283 = icmp slt i64 %282, 0
  br i1 %283, label %284, label %288

284:                                              ; preds = %265
  %285 = load i64, ptr @MOD, align 8, !tbaa !8
  %286 = load i64, ptr %13, align 8, !tbaa !8
  %287 = add nsw i64 %286, %285
  store i64 %287, ptr %13, align 8, !tbaa !8
  br label %288

288:                                              ; preds = %284, %265
  store i64 1, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %289 = load i32, ptr %18, align 4, !tbaa !11
  store i32 %289, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 1, ptr %20, align 4, !tbaa !11
  br label %290

290:                                              ; preds = %341, %288
  %291 = load i32, ptr %19, align 4, !tbaa !11
  %292 = load i32, ptr %15, align 4, !tbaa !11
  %293 = icmp sle i32 %291, %292
  br i1 %293, label %295, label %294

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

295:                                              ; preds = %290
  %296 = load i64, ptr %14, align 8, !tbaa !8
  %297 = load i64, ptr %13, align 8, !tbaa !8
  %298 = mul nsw i64 %296, %297
  %299 = load i64, ptr @MOD, align 8, !tbaa !8
  %300 = srem i64 %298, %299
  store i64 %300, ptr %14, align 8, !tbaa !8
  %301 = load i32, ptr %15, align 4, !tbaa !11
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %302
  %304 = load i32, ptr %18, align 4, !tbaa !11
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [3001 x i64], ptr %303, i64 0, i64 %305
  %307 = load i32, ptr %15, align 4, !tbaa !11
  %308 = load i32, ptr %19, align 4, !tbaa !11
  %309 = sub nsw i32 %307, %308
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %310
  %312 = load i32, ptr %18, align 4, !tbaa !11
  %313 = sub nsw i32 %312, 1
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [3001 x i64], ptr %311, i64 0, i64 %314
  %316 = load i64, ptr %315, align 8, !tbaa !8
  %317 = load i64, ptr %14, align 8, !tbaa !8
  %318 = mul nsw i64 %316, %317
  %319 = load i64, ptr @MOD, align 8, !tbaa !8
  %320 = srem i64 %318, %319
  %321 = load i32, ptr %15, align 4, !tbaa !11
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %322
  %324 = load i32, ptr %19, align 4, !tbaa !11
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [3001 x i64], ptr %323, i64 0, i64 %325
  %327 = load i64, ptr %326, align 8, !tbaa !8
  %328 = mul nsw i64 %320, %327
  %329 = load i64, ptr @MOD, align 8, !tbaa !8
  %330 = srem i64 %328, %329
  %331 = load i32, ptr %19, align 4, !tbaa !11
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds [3001 x [3001 x i64]], ptr @MC, i64 0, i64 %332
  %334 = load i32, ptr %20, align 4, !tbaa !11
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [3001 x i64], ptr %333, i64 0, i64 %335
  %337 = load i64, ptr %336, align 8, !tbaa !8
  %338 = mul nsw i64 %330, %337
  %339 = load i64, ptr @MOD, align 8, !tbaa !8
  %340 = srem i64 %338, %339
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %306, i64 noundef %340)
  br label %341

341:                                              ; preds = %295
  %342 = load i32, ptr %18, align 4, !tbaa !11
  %343 = load i32, ptr %19, align 4, !tbaa !11
  %344 = add nsw i32 %343, %342
  store i32 %344, ptr %19, align 4, !tbaa !11
  %345 = load i32, ptr %20, align 4, !tbaa !11
  %346 = add nsw i32 %345, 1
  store i32 %346, ptr %20, align 4, !tbaa !11
  br label %290, !llvm.loop !22

347:                                              ; preds = %294
  br label %348

348:                                              ; preds = %347
  %349 = load i32, ptr %18, align 4, !tbaa !11
  %350 = add nsw i32 %349, 1
  store i32 %350, ptr %18, align 4, !tbaa !11
  br label %260, !llvm.loop !23

351:                                              ; preds = %264
  %352 = load i32, ptr %15, align 4, !tbaa !11
  %353 = load i32, ptr %10, align 4, !tbaa !11
  %354 = icmp sle i32 %352, %353
  br i1 %354, label %355, label %383

355:                                              ; preds = %351
  %356 = load i32, ptr %15, align 4, !tbaa !11
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %357
  %359 = load i32, ptr %15, align 4, !tbaa !11
  %360 = sext i32 %359 to i64
  %361 = getelementptr inbounds [3001 x i64], ptr %358, i64 0, i64 %360
  %362 = load i32, ptr %15, align 4, !tbaa !11
  %363 = sub nsw i32 %362, 1
  %364 = sext i32 %363 to i64
  %365 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %364
  %366 = load i32, ptr %15, align 4, !tbaa !11
  %367 = add nsw i32 %366, 1
  %368 = sdiv i32 %367, 2
  %369 = sub nsw i32 %368, 1
  %370 = sext i32 %369 to i64
  %371 = getelementptr inbounds [3001 x i64], ptr %365, i64 0, i64 %370
  %372 = load i64, ptr %371, align 8, !tbaa !8
  %373 = load i32, ptr %15, align 4, !tbaa !11
  %374 = sext i32 %373 to i64
  %375 = mul nsw i64 %372, %374
  %376 = load i64, ptr @MOD, align 8, !tbaa !8
  %377 = srem i64 %375, %376
  %378 = load i32, ptr %15, align 4, !tbaa !11
  %379 = sext i32 %378 to i64
  %380 = mul nsw i64 %377, %379
  %381 = load i64, ptr @MOD, align 8, !tbaa !8
  %382 = srem i64 %380, %381
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %361, i64 noundef %382)
  br label %383

383:                                              ; preds = %355, %351
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 1, ptr %21, align 4, !tbaa !11
  br label %384

384:                                              ; preds = %404, %383
  %385 = load i32, ptr %21, align 4, !tbaa !11
  %386 = load i32, ptr %10, align 4, !tbaa !11
  %387 = icmp sle i32 %385, %386
  br i1 %387, label %389, label %388

388:                                              ; preds = %384
  store i32 35, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %407

389:                                              ; preds = %384
  %390 = load i32, ptr %15, align 4, !tbaa !11
  %391 = sext i32 %390 to i64
  %392 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %391
  %393 = load i32, ptr %21, align 4, !tbaa !11
  %394 = sext i32 %393 to i64
  %395 = getelementptr inbounds [3001 x i64], ptr %392, i64 0, i64 %394
  %396 = load i32, ptr %15, align 4, !tbaa !11
  %397 = sext i32 %396 to i64
  %398 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %397
  %399 = load i32, ptr %21, align 4, !tbaa !11
  %400 = sub nsw i32 %399, 1
  %401 = sext i32 %400 to i64
  %402 = getelementptr inbounds [3001 x i64], ptr %398, i64 0, i64 %401
  %403 = load i64, ptr %402, align 8, !tbaa !8
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %395, i64 noundef %403)
  br label %404

404:                                              ; preds = %389
  %405 = load i32, ptr %21, align 4, !tbaa !11
  %406 = add nsw i32 %405, 1
  store i32 %406, ptr %21, align 4, !tbaa !11
  br label %384, !llvm.loop !24

407:                                              ; preds = %388
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %408

408:                                              ; preds = %407
  %409 = load i32, ptr %15, align 4, !tbaa !11
  %410 = add nsw i32 %409, 1
  store i32 %410, ptr %15, align 4, !tbaa !11
  br label %246, !llvm.loop !25

411:                                              ; preds = %250
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %412 = load i32, ptr @n, align 4, !tbaa !11
  %413 = sub nsw i32 %412, 1
  %414 = sext i32 %413 to i64
  %415 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %414
  %416 = load i32, ptr %10, align 4, !tbaa !11
  %417 = sext i32 %416 to i64
  %418 = getelementptr inbounds [3001 x i64], ptr %415, i64 0, i64 %417
  %419 = load i64, ptr %418, align 8, !tbaa !8
  %420 = load i32, ptr @n, align 4, !tbaa !11
  %421 = sext i32 %420 to i64
  %422 = mul nsw i64 %419, %421
  %423 = load i64, ptr @MOD, align 8, !tbaa !8
  %424 = srem i64 %422, %423
  store i64 %424, ptr %22, align 8, !tbaa !8
  %425 = load i64, ptr %22, align 8, !tbaa !8
  %426 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %425)
  %427 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %426, 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 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %428 = load i32, ptr %1, align 4
  ret i32 %428
}

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 @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_Z3invx(i64 noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #6

; 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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}


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

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

@MOD = external dso_local global i64, align 8
@n = external dso_local global i32, align 4
@C = external dso_local global [3001 x [3001 x i64]], align 16
@MC = external dso_local local_unnamed_addr global [3001 x [3001 x i64]], align 16
@dp = external dso_local global [3001 x [3001 x i64]], align 16
@f = external dso_local local_unnamed_addr global [3001 x i64], align 16
@invf = external dso_local local_unnamed_addr global [3001 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = 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 @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) @MOD)
  store i64 1, ptr @f, align 16, !tbaa !8
  %16 = load i32, ptr @n, align 4, !tbaa !11
  %.not113 = icmp slt i32 %16, 1
  br i1 %.not113, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %17 = load i64, ptr @MOD, align 8, !tbaa !8
  %18 = zext nneg i32 %16 to i64
  %xtraiter = and i64 %18, 1
  %19 = icmp eq i32 %16, 1
  br i1 %19, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %18, 2147483646
  br label %37

._crit_edge.loopexit.unr-lcssa:                   ; preds = %37, %.lr.ph
  %.unr = phi i64 [ 1, %.lr.ph ], [ %43, %37 ]
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next.1, %37 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %20 = mul nsw i64 %.unr, %indvars.iv.unr
  %21 = srem i64 %20, %17
  %22 = getelementptr inbounds [3001 x i64], ptr @f, i64 0, i64 %indvars.iv.unr
  store i64 %21, ptr %22, align 8, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %0
  %23 = sext i32 %16 to i64
  %24 = getelementptr inbounds [3001 x i64], ptr @f, i64 0, i64 %23
  %25 = load i64, ptr %24, align 8, !tbaa !8
  %26 = tail call noundef i64 @_Z3invx(i64 noundef %25)
  %27 = load i32, ptr @n, align 4, !tbaa !11
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [3001 x i64], ptr @invf, i64 0, i64 %28
  store i64 %26, ptr %29, align 8, !tbaa !8
  %30 = icmp sgt i32 %27, 0
  br i1 %30, label %.lr.ph117, label %._crit_edge118.thread

._crit_edge118.thread:                            ; preds = %._crit_edge
  store i64 1, ptr @C, align 16, !tbaa !8
  store i64 1, ptr @MC, align 16, !tbaa !8
  br label %.preheader.thread

.lr.ph117:                                        ; preds = %._crit_edge
  %31 = load i64, ptr @MOD, align 8, !tbaa !8
  %32 = zext nneg i32 %27 to i64
  %.phi.trans.insert = getelementptr inbounds [3001 x i64], ptr @invf, i64 0, i64 %32
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !8
  %xtraiter262 = and i64 %32, 1
  %lcmp.mod263.not = icmp eq i64 %xtraiter262, 0
  br i1 %lcmp.mod263.not, label %.prol.loopexit, label %.prol.loopexit.unr-lcssa

.prol.loopexit.unr-lcssa:                         ; preds = %.lr.ph117
  %indvars.iv.next173.prol = add nsw i64 %32, -1
  %33 = mul nsw i64 %.pre, %32
  %34 = srem i64 %33, %31
  %35 = getelementptr inbounds [3001 x i64], ptr @invf, i64 0, i64 %indvars.iv.next173.prol
  store i64 %34, ptr %35, align 8, !tbaa !8
  br label %.prol.loopexit

.prol.loopexit:                                   ; preds = %.prol.loopexit.unr-lcssa, %.lr.ph117
  %.unr264 = phi i64 [ %.pre, %.lr.ph117 ], [ %34, %.prol.loopexit.unr-lcssa ]
  %indvars.iv172.unr = phi i64 [ %32, %.lr.ph117 ], [ %indvars.iv.next173.prol, %.prol.loopexit.unr-lcssa ]
  %36 = icmp eq i32 %27, 1
  br i1 %36, label %._crit_edge118, label %.lr.ph117.new

37:                                               ; preds = %37, %.lr.ph.new
  %38 = phi i64 [ 1, %.lr.ph.new ], [ %43, %37 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next.1, %37 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %37 ]
  %39 = mul nsw i64 %38, %indvars.iv
  %40 = srem i64 %39, %17
  %41 = getelementptr inbounds [3001 x i64], ptr @f, i64 0, i64 %indvars.iv
  store i64 %40, ptr %41, align 8, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = mul nsw i64 %40, %indvars.iv.next
  %43 = srem i64 %42, %17
  %44 = getelementptr inbounds [3001 x i64], ptr @f, i64 0, i64 %indvars.iv.next
  store i64 %43, ptr %44, align 8, !tbaa !8
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %37, !llvm.loop !13

._crit_edge118:                                   ; preds = %.lr.ph117.new, %.prol.loopexit
  store i64 1, ptr @C, align 16, !tbaa !8
  br label %.lr.ph126

.lr.ph117.new:                                    ; preds = %.prol.loopexit, %.lr.ph117.new
  %45 = phi i64 [ %50, %.lr.ph117.new ], [ %.unr264, %.prol.loopexit ]
  %indvars.iv172 = phi i64 [ %indvars.iv.next173.1, %.lr.ph117.new ], [ %indvars.iv172.unr, %.prol.loopexit ]
  %indvars.iv.next173 = add nsw i64 %indvars.iv172, -1
  %46 = mul nsw i64 %45, %indvars.iv172
  %47 = srem i64 %46, %31
  %48 = getelementptr inbounds [3001 x i64], ptr @invf, i64 0, i64 %indvars.iv.next173
  store i64 %47, ptr %48, align 8, !tbaa !8
  %indvars.iv.next173.1 = add nsw i64 %indvars.iv172, -2
  %49 = mul nsw i64 %47, %indvars.iv.next173
  %50 = srem i64 %49, %31
  %51 = getelementptr inbounds [3001 x i64], ptr @invf, i64 0, i64 %indvars.iv.next173.1
  store i64 %50, ptr %51, align 8, !tbaa !8
  %52 = icmp ugt i64 %indvars.iv.next173, 1
  br i1 %52, label %.lr.ph117.new, label %._crit_edge118, !llvm.loop !15

._crit_edge127:                                   ; preds = %._crit_edge122
  store i64 1, ptr @MC, align 16, !tbaa !8
  %.not104135 = icmp slt i32 %61, 1
  br i1 %.not104135, label %.preheader.thread, label %.lr.ph138

.lr.ph138:                                        ; preds = %._crit_edge127
  %53 = load i64, ptr @MOD, align 8
  %54 = zext nneg i32 %61 to i64
  %55 = add nuw i32 %61, 1
  %wide.trip.count195 = zext i32 %55 to i64
  br label %75

.lr.ph126:                                        ; preds = %._crit_edge118, %._crit_edge122
  %56 = phi i32 [ %61, %._crit_edge122 ], [ %27, %._crit_edge118 ]
  %indvars.iv180 = phi i64 [ %indvars.iv.next181, %._crit_edge122 ], [ 1, %._crit_edge118 ]
  %57 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %indvars.iv180
  %58 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %indvars.iv180, i64 %indvars.iv180
  store i64 1, ptr %58, align 8, !tbaa !8
  store i64 1, ptr %57, align 8, !tbaa !8
  %59 = icmp ugt i64 %indvars.iv180, 1
  br i1 %59, label %.lr.ph121, label %._crit_edge122

.lr.ph121:                                        ; preds = %.lr.ph126
  %60 = add nsw i64 %indvars.iv180, -1
  br label %63

._crit_edge122.loopexit:                          ; preds = %63
  %.pre226 = load i32, ptr @n, align 4, !tbaa !11
  br label %._crit_edge122

._crit_edge122:                                   ; preds = %._crit_edge122.loopexit, %.lr.ph126
  %61 = phi i32 [ %.pre226, %._crit_edge122.loopexit ], [ %56, %.lr.ph126 ]
  %indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1
  %62 = sext i32 %61 to i64
  %.not103.not = icmp slt i64 %indvars.iv180, %62
  br i1 %.not103.not, label %.lr.ph126, label %._crit_edge127, !llvm.loop !16

63:                                               ; preds = %.lr.ph121, %63
  %indvars.iv175 = phi i64 [ 1, %.lr.ph121 ], [ %indvars.iv.next176, %63 ]
  %64 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %indvars.iv180, i64 %indvars.iv175
  %65 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %60, i64 %indvars.iv175
  %66 = load i64, ptr %65, align 8, !tbaa !8
  %67 = add nsw i64 %indvars.iv175, -1
  %68 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %60, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !8
  %70 = add nsw i64 %69, %66
  tail call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %64, i64 noundef %70)
  %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
  %exitcond179.not = icmp eq i64 %indvars.iv.next176, %indvars.iv180
  br i1 %exitcond179.not, label %._crit_edge122.loopexit, label %63, !llvm.loop !17

._crit_edge139:                                   ; preds = %._crit_edge134
  %71 = sdiv i32 %55, 2
  %smax = tail call i32 @llvm.smax.i32(i32 %71, i32 1)
  %wide.trip.count200 = zext nneg i32 %smax to i64
  %min.iters.check = icmp slt i32 %55, 8
  br i1 %min.iters.check, label %.lr.ph143.preheader, label %vector.ph

.lr.ph143.preheader:                              ; preds = %middle.block, %._crit_edge139
  %indvars.iv197.ph = phi i64 [ 0, %._crit_edge139 ], [ %n.vec, %middle.block ]
  br label %.lr.ph143

vector.ph:                                        ; preds = %._crit_edge139
  %n.vec = and i64 %wide.trip.count200, 1073741820
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %72 = getelementptr inbounds [3001 x i64], ptr @dp, i64 0, i64 %index
  %73 = getelementptr inbounds i8, ptr %72, i64 16
  store <2 x i64> <i64 1, i64 1>, ptr %72, align 16, !tbaa !8
  store <2 x i64> <i64 1, i64 1>, ptr %73, align 16, !tbaa !8
  %index.next = add nuw i64 %index, 4
  %74 = icmp eq i64 %index.next, %n.vec
  br i1 %74, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count200
  br i1 %cmp.n, label %.preheader, label %.lr.ph143.preheader

75:                                               ; preds = %.lr.ph138, %._crit_edge134
  %indvars.iv187 = phi i64 [ 1, %.lr.ph138 ], [ %indvars.iv.next188, %._crit_edge134 ]
  %indvars.iv185 = phi i64 [ 2, %.lr.ph138 ], [ %indvars.iv.next186, %._crit_edge134 ]
  %76 = getelementptr inbounds [3001 x [3001 x i64]], ptr @MC, i64 0, i64 %indvars.iv187, i64 1
  store i64 1, ptr %76, align 8, !tbaa !8
  %77 = shl nuw nsw i64 %indvars.iv187, 1
  %.not110129 = icmp ugt i64 %77, %54
  br i1 %.not110129, label %._crit_edge134, label %.lr.ph133

._crit_edge134:                                   ; preds = %.lr.ph133, %75
  %indvars.iv.next188 = add nuw nsw i64 %indvars.iv187, 1
  %indvars.iv.next186 = add nuw nsw i64 %indvars.iv185, 2
  %exitcond196.not = icmp eq i64 %indvars.iv.next188, %wide.trip.count195
  br i1 %exitcond196.not, label %._crit_edge139, label %75, !llvm.loop !21

.lr.ph133:                                        ; preds = %75, %.lr.ph133
  %indvars.iv189 = phi i64 [ %indvars.iv.next190, %.lr.ph133 ], [ %indvars.iv185, %75 ]
  %indvars.iv183 = phi i64 [ %indvars.iv.next184, %.lr.ph133 ], [ 2, %75 ]
  %78 = sub nuw nsw i64 %indvars.iv189, %indvars.iv187
  %79 = add nsw i64 %indvars.iv183, -1
  %80 = getelementptr inbounds [3001 x [3001 x i64]], ptr @MC, i64 0, i64 %78, i64 %79
  %81 = load i64, ptr %80, align 8, !tbaa !8
  %82 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %indvars.iv189, i64 %indvars.iv187
  %83 = load i64, ptr %82, align 8, !tbaa !8
  %84 = mul nsw i64 %83, %81
  %85 = srem i64 %84, %53
  %86 = getelementptr inbounds [3001 x i64], ptr @f, i64 0, i64 %79
  %87 = load i64, ptr %86, align 8, !tbaa !8
  %88 = mul nsw i64 %87, %85
  %89 = srem i64 %88, %53
  %90 = getelementptr inbounds [3001 x i64], ptr @invf, i64 0, i64 %indvars.iv183
  %91 = load i64, ptr %90, align 8, !tbaa !8
  %92 = mul nsw i64 %91, %89
  %93 = srem i64 %92, %53
  %94 = getelementptr inbounds [3001 x [3001 x i64]], ptr @MC, i64 0, i64 %indvars.iv189, i64 %indvars.iv183
  store i64 %93, ptr %94, align 8, !tbaa !8
  %indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, %indvars.iv187
  %indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1
  %.not110 = icmp ugt i64 %indvars.iv.next190, %54
  br i1 %.not110, label %._crit_edge134, label %.lr.ph133, !llvm.loop !22

.preheader.thread:                                ; preds = %._crit_edge118.thread, %._crit_edge127
  %95 = phi i32 [ %27, %._crit_edge118.thread ], [ %61, %._crit_edge127 ]
  %.pre229 = add nsw i32 %95, 1
  %96 = sdiv i32 %.pre229, 2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  br label %._crit_edge167

.preheader:                                       ; preds = %.lr.ph143, %middle.block
  %.not106.not144 = icmp sgt i32 %61, 2
  br i1 %.not106.not144, label %.lr.ph146.preheader, label %._crit_edge147.thread

._crit_edge147.thread:                            ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  br label %._crit_edge167

.lr.ph146.preheader:                              ; preds = %.preheader
  %smax205 = tail call i32 @llvm.smax.i32(i32 %71, i32 2)
  %wide.trip.count206 = zext nneg i32 %smax205 to i64
  %97 = add nsw i64 %wide.trip.count206, -1
  %min.iters.check248 = icmp slt i32 %55, 10
  br i1 %min.iters.check248, label %.lr.ph146.preheader260, label %vector.ph249

.lr.ph146.preheader260:                           ; preds = %middle.block246, %.lr.ph146.preheader
  %indvars.iv202.ph = phi i64 [ 1, %.lr.ph146.preheader ], [ %ind.end, %middle.block246 ]
  br label %.lr.ph146

vector.ph249:                                     ; preds = %.lr.ph146.preheader
  %n.vec251 = and i64 %97, -4
  %ind.end = or disjoint i64 %n.vec251, 1
  br label %vector.body253

vector.body253:                                   ; preds = %vector.body253, %vector.ph249
  %index254 = phi i64 [ 0, %vector.ph249 ], [ %index.next255, %vector.body253 ]
  %offset.idx = or disjoint i64 %index254, 1
  %98 = getelementptr inbounds [3001 x i64], ptr getelementptr inbounds (i8, ptr @dp, i64 24008), i64 0, i64 %offset.idx
  %99 = getelementptr inbounds i8, ptr %98, i64 16
  store <2 x i64> <i64 1, i64 1>, ptr %98, align 16, !tbaa !8
  store <2 x i64> <i64 1, i64 1>, ptr %99, align 16, !tbaa !8
  %index.next255 = add nuw i64 %index254, 4
  %100 = icmp eq i64 %index.next255, %n.vec251
  br i1 %100, label %middle.block246, label %vector.body253, !llvm.loop !23

middle.block246:                                  ; preds = %vector.body253
  %cmp.n256 = icmp eq i64 %97, %n.vec251
  br i1 %cmp.n256, label %._crit_edge147, label %.lr.ph146.preheader260

.lr.ph143:                                        ; preds = %.lr.ph143.preheader, %.lr.ph143
  %indvars.iv197 = phi i64 [ %indvars.iv.next198, %.lr.ph143 ], [ %indvars.iv197.ph, %.lr.ph143.preheader ]
  %101 = getelementptr inbounds [3001 x i64], ptr @dp, i64 0, i64 %indvars.iv197
  store i64 1, ptr %101, align 8, !tbaa !8
  %indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1
  %exitcond201.not = icmp eq i64 %indvars.iv.next198, %wide.trip.count200
  br i1 %exitcond201.not, label %.preheader, label %.lr.ph143, !llvm.loop !24

._crit_edge147:                                   ; preds = %.lr.ph146, %middle.block246
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 2, ptr %1, align 4, !tbaa !11
  br i1 %.not106.not144, label %.lr.ph166, label %._crit_edge167

.lr.ph166:                                        ; preds = %._crit_edge147
  %smax223 = tail call i32 @llvm.smax.i32(i32 %71, i32 2)
  %wide.trip.count224 = zext nneg i32 %smax223 to i64
  br label %116

.lr.ph146:                                        ; preds = %.lr.ph146.preheader260, %.lr.ph146
  %indvars.iv202 = phi i64 [ %indvars.iv.next203, %.lr.ph146 ], [ %indvars.iv202.ph, %.lr.ph146.preheader260 ]
  %102 = getelementptr inbounds [3001 x i64], ptr getelementptr inbounds (i8, ptr @dp, i64 24008), i64 0, i64 %indvars.iv202
  store i64 1, ptr %102, align 8, !tbaa !8
  %indvars.iv.next203 = add nuw nsw i64 %indvars.iv202, 1
  %exitcond207.not = icmp eq i64 %indvars.iv.next203, %wide.trip.count206
  br i1 %exitcond207.not, label %._crit_edge147, label %.lr.ph146, !llvm.loop !25

._crit_edge167:                                   ; preds = %._crit_edge163, %.preheader.thread, %._crit_edge147.thread, %._crit_edge147
  %103 = phi i32 [ %71, %._crit_edge147 ], [ %71, %._crit_edge147.thread ], [ %96, %.preheader.thread ], [ %71, %._crit_edge163 ]
  %.lcssa = phi i32 [ %61, %._crit_edge147 ], [ %61, %._crit_edge147.thread ], [ %95, %.preheader.thread ], [ %176, %._crit_edge163 ]
  %104 = add nsw i32 %103, -1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %105 = add nsw i32 %.lcssa, -1
  %106 = sext i32 %105 to i64
  %107 = sext i32 %104 to i64
  %108 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %106, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !8
  %110 = sext i32 %.lcssa to i64
  %111 = mul nsw i64 %109, %110
  %112 = load i64, ptr @MOD, align 8, !tbaa !8
  %113 = srem i64 %111, %112
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %113)
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %114, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

116:                                              ; preds = %.lr.ph166, %._crit_edge163
  %storemerge164 = phi i32 [ 2, %.lr.ph166 ], [ %175, %._crit_edge163 ]
  %117 = sext i32 %storemerge164 to i64
  %118 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %117, i64 1
  store i64 1, ptr %118, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  store i32 %71, ptr %2, align 4, !tbaa !11
  %119 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %120 = load i32, ptr %119, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %121 = icmp sgt i32 %120, 3
  %.pre228 = load i32, ptr %1, align 4, !tbaa !11
  br i1 %121, label %.lr.ph157.preheader, label %._crit_edge158

.lr.ph157.preheader:                              ; preds = %116
  %wide.trip.count218 = zext nneg i32 %120 to i64
  br label %.lr.ph157

._crit_edge158:                                   ; preds = %._crit_edge154, %116
  %122 = phi i32 [ %.pre228, %116 ], [ %134, %._crit_edge154 ]
  %.not107.not = icmp slt i32 %122, %71
  br i1 %.not107.not, label %158, label %.lr.ph162.preheader

.lr.ph157:                                        ; preds = %.lr.ph157.preheader, %._crit_edge154
  %123 = phi i32 [ %.pre228, %.lr.ph157.preheader ], [ %134, %._crit_edge154 ]
  %indvars.iv210 = phi i64 [ 3, %.lr.ph157.preheader ], [ %indvars.iv.next211, %._crit_edge154 ]
  %124 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %indvars.iv210, i64 %indvars.iv210
  %125 = load i64, ptr %124, align 8, !tbaa !8
  %126 = add nsw i64 %indvars.iv210, -1
  %127 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %indvars.iv210, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !8
  %129 = sub nsw i64 %125, %128
  %130 = icmp slt i64 %129, 0
  %131 = load i64, ptr @MOD, align 8
  %132 = select i1 %130, i64 %131, i64 0
  %.087 = add nsw i64 %132, %129
  %133 = sext i32 %123 to i64
  %.not109148 = icmp sgt i64 %indvars.iv210, %133
  br i1 %.not109148, label %._crit_edge154, label %.lr.ph153

._crit_edge154:                                   ; preds = %.lr.ph153, %.lr.ph157
  %134 = phi i32 [ %123, %.lr.ph157 ], [ %156, %.lr.ph153 ]
  %indvars.iv.next211 = add nuw nsw i64 %indvars.iv210, 1
  %exitcond219.not = icmp eq i64 %indvars.iv.next211, %wide.trip.count218
  br i1 %exitcond219.not, label %._crit_edge158, label %.lr.ph157, !llvm.loop !26

.lr.ph153:                                        ; preds = %.lr.ph157, %.lr.ph153
  %indvars.iv212 = phi i64 [ %indvars.iv.next213, %.lr.ph153 ], [ %indvars.iv210, %.lr.ph157 ]
  %indvars.iv208 = phi i64 [ %indvars.iv.next209, %.lr.ph153 ], [ 1, %.lr.ph157 ]
  %135 = phi i32 [ %156, %.lr.ph153 ], [ %123, %.lr.ph157 ]
  %.086149 = phi i64 [ %138, %.lr.ph153 ], [ 1, %.lr.ph157 ]
  %136 = mul nsw i64 %.086149, %.087
  %137 = load i64, ptr @MOD, align 8, !tbaa !8
  %138 = srem i64 %136, %137
  %139 = sext i32 %135 to i64
  %140 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %139, i64 %indvars.iv210
  %141 = trunc nuw nsw i64 %indvars.iv212 to i32
  %142 = sub nsw i32 %135, %141
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %143, i64 %126
  %145 = load i64, ptr %144, align 8, !tbaa !8
  %146 = mul nsw i64 %145, %138
  %147 = srem i64 %146, %137
  %148 = getelementptr inbounds [3001 x [3001 x i64]], ptr @C, i64 0, i64 %139, i64 %indvars.iv212
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %150 = mul nsw i64 %149, %147
  %151 = srem i64 %150, %137
  %152 = getelementptr inbounds [3001 x [3001 x i64]], ptr @MC, i64 0, i64 %indvars.iv212, i64 %indvars.iv208
  %153 = load i64, ptr %152, align 8, !tbaa !8
  %154 = mul nsw i64 %153, %151
  %155 = srem i64 %154, %137
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %140, i64 noundef %155)
  %indvars.iv.next213 = add nuw nsw i64 %indvars.iv212, %indvars.iv210
  %indvars.iv.next209 = add nuw nsw i64 %indvars.iv208, 1
  %156 = load i32, ptr %1, align 4, !tbaa !11
  %157 = trunc nuw i64 %indvars.iv.next213 to i32
  %.not109 = icmp slt i32 %156, %157
  br i1 %.not109, label %._crit_edge154, label %.lr.ph153, !llvm.loop !27

158:                                              ; preds = %._crit_edge158
  %159 = sext i32 %122 to i64
  %160 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %159, i64 %159
  %161 = add nsw i32 %122, -1
  %162 = sext i32 %161 to i64
  %163 = add nsw i32 %122, 1
  %164 = sdiv i32 %163, 2
  %165 = add nsw i32 %164, -1
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %162, i64 %166
  %168 = load i64, ptr %167, align 8, !tbaa !8
  %169 = mul nsw i64 %168, %159
  %170 = load i64, ptr @MOD, align 8, !tbaa !8
  %171 = srem i64 %169, %170
  %172 = mul nsw i64 %171, %159
  %173 = srem i64 %172, %170
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %160, i64 noundef %173)
  br label %.lr.ph162.preheader

.lr.ph162.preheader:                              ; preds = %._crit_edge158, %158
  br label %.lr.ph162

._crit_edge163:                                   ; preds = %.lr.ph162
  %174 = load i32, ptr %1, align 4, !tbaa !11
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %1, align 4, !tbaa !11
  %176 = load i32, ptr @n, align 4, !tbaa !11
  %177 = icmp slt i32 %175, %176
  br i1 %177, label %116, label %._crit_edge167, !llvm.loop !28

.lr.ph162:                                        ; preds = %.lr.ph162.preheader, %.lr.ph162
  %indvars.iv220 = phi i64 [ %indvars.iv.next221, %.lr.ph162 ], [ 1, %.lr.ph162.preheader ]
  %178 = load i32, ptr %1, align 4, !tbaa !11
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %179, i64 %indvars.iv220
  %181 = add nsw i64 %indvars.iv220, -1
  %182 = getelementptr inbounds [3001 x [3001 x i64]], ptr @dp, i64 0, i64 %179, i64 %181
  %183 = load i64, ptr %182, align 8, !tbaa !8
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %180, i64 noundef %183)
  %indvars.iv.next221 = add nuw nsw i64 %indvars.iv220, 1
  %exitcond225.not = icmp eq i64 %indvars.iv.next221, %wide.trip.count224
  br i1 %exitcond225.not, label %._crit_edge163, label %.lr.ph162, !llvm.loop !29
}

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 @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_Z3invx(i64 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #6

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

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

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

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

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

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


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