; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2019.03 (snakes)

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, 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 ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  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 @stdin, align 8, !tbaa !8
  %30 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %29)
  %31 = load ptr, ptr @stdout, align 8, !tbaa !8
  %32 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %31)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %35 = load i32, ptr %2, align 4, !tbaa !11
  %36 = zext i32 %35 to i64
  %37 = call ptr @llvm.stacksave.p0()
  store ptr %37, ptr %4, align 8
  %38 = alloca i32, i64 %36, align 16
  store i64 %36, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !11
  br label %39

39:                                               ; preds = %49, %0
  %40 = load i32, ptr %6, align 4, !tbaa !11
  %41 = load i32, ptr %2, align 4, !tbaa !11
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %52

44:                                               ; preds = %39
  %45 = load i32, ptr %6, align 4, !tbaa !11
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %38, i64 %46
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %47)
  br label %49

49:                                               ; preds = %44
  %50 = load i32, ptr %6, align 4, !tbaa !11
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %6, align 4, !tbaa !11
  br label %39, !llvm.loop !13

52:                                               ; preds = %43
  %53 = load i32, ptr %2, align 4, !tbaa !11
  %54 = zext i32 %53 to i64
  %55 = load i32, ptr %2, align 4, !tbaa !11
  %56 = zext i32 %55 to i64
  %57 = mul nuw i64 %54, %56
  %58 = alloca i32, i64 %57, align 16
  store i64 %54, ptr %7, align 8
  store i64 %56, ptr %8, align 8
  %59 = load i32, ptr %2, align 4, !tbaa !11
  %60 = zext i32 %59 to i64
  %61 = load i32, ptr %2, align 4, !tbaa !11
  %62 = zext i32 %61 to i64
  %63 = mul nuw i64 %60, %62
  %64 = alloca i32, i64 %63, align 16
  store i64 %60, ptr %9, align 8
  store i64 %62, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %65

65:                                               ; preds = %93, %52
  %66 = load i32, ptr %11, align 4, !tbaa !11
  %67 = load i32, ptr %2, align 4, !tbaa !11
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %96

70:                                               ; preds = %65
  %71 = load i32, ptr %11, align 4, !tbaa !11
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i32, ptr %38, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !11
  %75 = load i32, ptr %11, align 4, !tbaa !11
  %76 = sext i32 %75 to i64
  %77 = mul nsw i64 %76, %56
  %78 = getelementptr inbounds i32, ptr %58, i64 %77
  %79 = load i32, ptr %11, align 4, !tbaa !11
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i32, ptr %78, i64 %80
  store i32 %74, ptr %81, align 4, !tbaa !11
  %82 = load i32, ptr %11, align 4, !tbaa !11
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %38, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !11
  %86 = load i32, ptr %11, align 4, !tbaa !11
  %87 = sext i32 %86 to i64
  %88 = mul nsw i64 %87, %62
  %89 = getelementptr inbounds i32, ptr %64, i64 %88
  %90 = load i32, ptr %11, align 4, !tbaa !11
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i32, ptr %89, i64 %91
  store i32 %85, ptr %92, align 4, !tbaa !11
  br label %93

93:                                               ; preds = %70
  %94 = load i32, ptr %11, align 4, !tbaa !11
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %11, align 4, !tbaa !11
  br label %65, !llvm.loop !15

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

97:                                               ; preds = %156, %96
  %98 = load i32, ptr %12, align 4, !tbaa !11
  %99 = load i32, ptr %2, align 4, !tbaa !11
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %159

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %103 = load i32, ptr %12, align 4, !tbaa !11
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %14, align 4, !tbaa !11
  br label %105

105:                                              ; preds = %152, %102
  %106 = load i32, ptr %14, align 4, !tbaa !11
  %107 = load i32, ptr %2, align 4, !tbaa !11
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  store i32 11, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %155

110:                                              ; preds = %105
  %111 = load i32, ptr %12, align 4, !tbaa !11
  %112 = sext i32 %111 to i64
  %113 = mul nsw i64 %112, %56
  %114 = getelementptr inbounds i32, ptr %58, i64 %113
  %115 = load i32, ptr %14, align 4, !tbaa !11
  %116 = sub nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %114, i64 %117
  %119 = load i32, ptr %14, align 4, !tbaa !11
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i32, ptr %38, i64 %120
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %118, ptr noundef nonnull align 4 dereferenceable(4) %121)
  %123 = load i32, ptr %122, align 4, !tbaa !11
  %124 = load i32, ptr %12, align 4, !tbaa !11
  %125 = sext i32 %124 to i64
  %126 = mul nsw i64 %125, %56
  %127 = getelementptr inbounds i32, ptr %58, i64 %126
  %128 = load i32, ptr %14, align 4, !tbaa !11
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr %127, i64 %129
  store i32 %123, ptr %130, align 4, !tbaa !11
  %131 = load i32, ptr %12, align 4, !tbaa !11
  %132 = sext i32 %131 to i64
  %133 = mul nsw i64 %132, %62
  %134 = getelementptr inbounds i32, ptr %64, i64 %133
  %135 = load i32, ptr %14, align 4, !tbaa !11
  %136 = sub nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds i32, ptr %134, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !11
  %140 = load i32, ptr %14, align 4, !tbaa !11
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i32, ptr %38, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !11
  %144 = add nsw i32 %139, %143
  %145 = load i32, ptr %12, align 4, !tbaa !11
  %146 = sext i32 %145 to i64
  %147 = mul nsw i64 %146, %62
  %148 = getelementptr inbounds i32, ptr %64, i64 %147
  %149 = load i32, ptr %14, align 4, !tbaa !11
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds i32, ptr %148, i64 %150
  store i32 %144, ptr %151, align 4, !tbaa !11
  br label %152

152:                                              ; preds = %110
  %153 = load i32, ptr %14, align 4, !tbaa !11
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %14, align 4, !tbaa !11
  br label %105, !llvm.loop !16

155:                                              ; preds = %109
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %12, align 4, !tbaa !11
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %12, align 4, !tbaa !11
  br label %97, !llvm.loop !17

159:                                              ; preds = %101
  %160 = load i32, ptr %2, align 4, !tbaa !11
  %161 = zext i32 %160 to i64
  %162 = load i32, ptr %3, align 4, !tbaa !11
  %163 = add nsw i32 %162, 1
  %164 = zext i32 %163 to i64
  %165 = mul nuw i64 %161, %164
  %166 = alloca i32, i64 %165, align 16
  store i64 %161, ptr %15, align 8
  store i64 %164, ptr %16, align 8
  %167 = mul nsw i64 0, %164
  %168 = getelementptr inbounds i32, ptr %166, i64 %167
  %169 = load i32, ptr %2, align 4, !tbaa !11
  %170 = sub nsw i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = mul nsw i64 %171, %164
  %173 = getelementptr inbounds i32, ptr %166, i64 %172
  %174 = load i32, ptr %3, align 4, !tbaa !11
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds i32, ptr %173, i64 %175
  %177 = getelementptr inbounds i32, ptr %176, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 1000000000, ptr %17, align 4, !tbaa !11
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef %168, ptr noundef %177, ptr noundef nonnull align 4 dereferenceable(4) %17)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %178

178:                                              ; preds = %205, %159
  %179 = load i32, ptr %18, align 4, !tbaa !11
  %180 = load i32, ptr %2, align 4, !tbaa !11
  %181 = icmp slt i32 %179, %180
  br i1 %181, label %183, label %182

182:                                              ; preds = %178
  store i32 14, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %208

183:                                              ; preds = %178
  %184 = mul nsw i64 0, %56
  %185 = getelementptr inbounds i32, ptr %58, i64 %184
  %186 = load i32, ptr %18, align 4, !tbaa !11
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds i32, ptr %185, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !11
  %190 = load i32, ptr %18, align 4, !tbaa !11
  %191 = add nsw i32 %190, 1
  %192 = mul nsw i32 %189, %191
  %193 = mul nsw i64 0, %62
  %194 = getelementptr inbounds i32, ptr %64, i64 %193
  %195 = load i32, ptr %18, align 4, !tbaa !11
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds i32, ptr %194, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !11
  %199 = sub nsw i32 %192, %198
  %200 = load i32, ptr %18, align 4, !tbaa !11
  %201 = sext i32 %200 to i64
  %202 = mul nsw i64 %201, %164
  %203 = getelementptr inbounds i32, ptr %166, i64 %202
  %204 = getelementptr inbounds i32, ptr %203, i64 0
  store i32 %199, ptr %204, align 4, !tbaa !11
  br label %205

205:                                              ; preds = %183
  %206 = load i32, ptr %18, align 4, !tbaa !11
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %18, align 4, !tbaa !11
  br label %178, !llvm.loop !18

208:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 1, ptr %19, align 4, !tbaa !11
  br label %209

209:                                              ; preds = %284, %208
  %210 = load i32, ptr %19, align 4, !tbaa !11
  %211 = load i32, ptr %3, align 4, !tbaa !11
  %212 = icmp sle i32 %210, %211
  br i1 %212, label %214, label %213

213:                                              ; preds = %209
  store i32 17, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %287

214:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !11
  br label %215

215:                                              ; preds = %280, %214
  %216 = load i32, ptr %20, align 4, !tbaa !11
  %217 = load i32, ptr %2, align 4, !tbaa !11
  %218 = icmp slt i32 %216, %217
  br i1 %218, label %220, label %219

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

220:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %221

221:                                              ; preds = %276, %220
  %222 = load i32, ptr %21, align 4, !tbaa !11
  %223 = load i32, ptr %20, align 4, !tbaa !11
  %224 = icmp slt i32 %222, %223
  br i1 %224, label %226, label %225

225:                                              ; preds = %221
  store i32 23, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %279

226:                                              ; preds = %221
  %227 = load i32, ptr %20, align 4, !tbaa !11
  %228 = sext i32 %227 to i64
  %229 = mul nsw i64 %228, %164
  %230 = getelementptr inbounds i32, ptr %166, i64 %229
  %231 = load i32, ptr %19, align 4, !tbaa !11
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds i32, ptr %230, i64 %232
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %234 = load i32, ptr %21, align 4, !tbaa !11
  %235 = sext i32 %234 to i64
  %236 = mul nsw i64 %235, %164
  %237 = getelementptr inbounds i32, ptr %166, i64 %236
  %238 = load i32, ptr %19, align 4, !tbaa !11
  %239 = sub nsw i32 %238, 1
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds i32, ptr %237, i64 %240
  %242 = load i32, ptr %241, align 4, !tbaa !11
  %243 = load i32, ptr %21, align 4, !tbaa !11
  %244 = add nsw i32 %243, 1
  %245 = sext i32 %244 to i64
  %246 = mul nsw i64 %245, %56
  %247 = getelementptr inbounds i32, ptr %58, i64 %246
  %248 = load i32, ptr %20, align 4, !tbaa !11
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds i32, ptr %247, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !11
  %252 = load i32, ptr %20, align 4, !tbaa !11
  %253 = load i32, ptr %21, align 4, !tbaa !11
  %254 = sub nsw i32 %252, %253
  %255 = mul nsw i32 %251, %254
  %256 = add nsw i32 %242, %255
  %257 = load i32, ptr %21, align 4, !tbaa !11
  %258 = add nsw i32 %257, 1
  %259 = sext i32 %258 to i64
  %260 = mul nsw i64 %259, %62
  %261 = getelementptr inbounds i32, ptr %64, i64 %260
  %262 = load i32, ptr %20, align 4, !tbaa !11
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds i32, ptr %261, i64 %263
  %265 = load i32, ptr %264, align 4, !tbaa !11
  %266 = sub nsw i32 %256, %265
  store i32 %266, ptr %22, align 4, !tbaa !11
  %267 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %233, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %268 = load i32, ptr %267, align 4, !tbaa !11
  %269 = load i32, ptr %20, align 4, !tbaa !11
  %270 = sext i32 %269 to i64
  %271 = mul nsw i64 %270, %164
  %272 = getelementptr inbounds i32, ptr %166, i64 %271
  %273 = load i32, ptr %19, align 4, !tbaa !11
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds i32, ptr %272, i64 %274
  store i32 %268, ptr %275, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %276

276:                                              ; preds = %226
  %277 = load i32, ptr %21, align 4, !tbaa !11
  %278 = add nsw i32 %277, 1
  store i32 %278, ptr %21, align 4, !tbaa !11
  br label %221, !llvm.loop !19

279:                                              ; preds = %225
  br label %280

280:                                              ; preds = %279
  %281 = load i32, ptr %20, align 4, !tbaa !11
  %282 = add nsw i32 %281, 1
  store i32 %282, ptr %20, align 4, !tbaa !11
  br label %215, !llvm.loop !20

283:                                              ; preds = %219
  br label %284

284:                                              ; preds = %283
  %285 = load i32, ptr %19, align 4, !tbaa !11
  %286 = add nsw i32 %285, 1
  store i32 %286, ptr %19, align 4, !tbaa !11
  br label %209, !llvm.loop !21

287:                                              ; preds = %213
  %288 = load i32, ptr %2, align 4, !tbaa !11
  %289 = sub nsw i32 %288, 1
  %290 = sext i32 %289 to i64
  %291 = mul nsw i64 %290, %164
  %292 = getelementptr inbounds i32, ptr %166, i64 %291
  %293 = load i32, ptr %3, align 4, !tbaa !11
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds i32, ptr %292, i64 %294
  %296 = load i32, ptr %295, align 4, !tbaa !11
  %297 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %296)
  %298 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %297, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %13, align 4
  %299 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %299)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %300 = load i32, ptr %1, align 4
  ret i32 %300
}

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 ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #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)) #5

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

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

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

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


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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = load ptr, ptr @stdin, align 8, !tbaa !8
  %12 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %11)
  %13 = load ptr, ptr @stdout, align 8, !tbaa !8
  %14 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %17 = load i32, ptr %1, align 4, !tbaa !11
  %18 = zext i32 %17 to i64
  %19 = call ptr @llvm.stacksave.p0()
  %20 = alloca i32, i64 %18, align 16
  %21 = load i32, ptr %1, align 4, !tbaa !11
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  %23 = zext i32 %21 to i64
  %24 = mul nuw i64 %23, %23
  %25 = alloca i32, i64 %24, align 16
  %26 = alloca i32, i64 %24, align 16
  br label %._crit_edge76

._crit_edge:                                      ; preds = %.lr.ph
  %27 = zext i32 %35 to i64
  %28 = mul nuw i64 %27, %27
  %29 = alloca i32, i64 %28, align 16
  %30 = alloca i32, i64 %28, align 16
  %31 = icmp sgt i32 %35, 0
  br i1 %31, label %.lr.ph70.preheader, label %._crit_edge76

.lr.ph70.preheader:                               ; preds = %._crit_edge
  %xtraiter = and i64 %27, 1
  %32 = icmp eq i32 %35, 1
  br i1 %32, label %.preheader64.unr-lcssa, label %.lr.ph70.preheader.new

.lr.ph70.preheader.new:                           ; preds = %.lr.ph70.preheader
  %unroll_iter = and i64 %27, 2147483646
  br label %.lr.ph70

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %33 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv
  %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) %33)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = load i32, ptr %1, align 4, !tbaa !11
  %36 = sext i32 %35 to i64
  %37 = icmp slt i64 %indvars.iv.next, %36
  br i1 %37, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader64.unr-lcssa:                           ; preds = %.lr.ph70, %.lr.ph70.preheader
  %indvars.iv104.unr = phi i64 [ 0, %.lr.ph70.preheader ], [ %indvars.iv.next105.1, %.lr.ph70 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader64, label %.lr.ph70.epil

.lr.ph70.epil:                                    ; preds = %.preheader64.unr-lcssa
  %38 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv104.unr
  %39 = load i32, ptr %38, align 4, !tbaa !11
  %40 = mul nuw nsw i64 %indvars.iv104.unr, %27
  %41 = getelementptr inbounds i32, ptr %29, i64 %40
  %42 = getelementptr inbounds i32, ptr %41, i64 %indvars.iv104.unr
  store i32 %39, ptr %42, align 4, !tbaa !11
  %43 = getelementptr inbounds i32, ptr %30, i64 %40
  %44 = getelementptr inbounds i32, ptr %43, i64 %indvars.iv104.unr
  store i32 %39, ptr %44, align 4, !tbaa !11
  br label %.preheader64

.preheader64:                                     ; preds = %.preheader64.unr-lcssa, %.lr.ph70.epil
  br i1 %31, label %.lr.ph75, label %._crit_edge76

.lr.ph70:                                         ; preds = %.lr.ph70, %.lr.ph70.preheader.new
  %indvars.iv104 = phi i64 [ 0, %.lr.ph70.preheader.new ], [ %indvars.iv.next105.1, %.lr.ph70 ]
  %niter = phi i64 [ 0, %.lr.ph70.preheader.new ], [ %niter.next.1, %.lr.ph70 ]
  %45 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv104
  %46 = load i32, ptr %45, align 8, !tbaa !11
  %47 = mul nuw nsw i64 %indvars.iv104, %27
  %48 = getelementptr inbounds i32, ptr %29, i64 %47
  %49 = getelementptr inbounds i32, ptr %48, i64 %indvars.iv104
  store i32 %46, ptr %49, align 8, !tbaa !11
  %50 = getelementptr inbounds i32, ptr %30, i64 %47
  %51 = getelementptr inbounds i32, ptr %50, i64 %indvars.iv104
  store i32 %46, ptr %51, align 8, !tbaa !11
  %indvars.iv.next105 = or disjoint i64 %indvars.iv104, 1
  %52 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv.next105
  %53 = load i32, ptr %52, align 4, !tbaa !11
  %54 = mul nuw nsw i64 %indvars.iv.next105, %27
  %55 = getelementptr inbounds i32, ptr %29, i64 %54
  %56 = getelementptr inbounds i32, ptr %55, i64 %indvars.iv.next105
  store i32 %53, ptr %56, align 4, !tbaa !11
  %57 = getelementptr inbounds i32, ptr %30, i64 %54
  %58 = getelementptr inbounds i32, ptr %57, i64 %indvars.iv.next105
  store i32 %53, ptr %58, align 4, !tbaa !11
  %indvars.iv.next105.1 = add nuw nsw i64 %indvars.iv104, 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 %.preheader64.unr-lcssa, label %.lr.ph70, !llvm.loop !15

.loopexit:                                        ; preds = %85, %.lr.ph75
  %.pre-phi = phi i64 [ %80, %.lr.ph75 ], [ %98, %85 ]
  %59 = phi i32 [ %79, %.lr.ph75 ], [ %97, %85 ]
  %60 = icmp slt i64 %indvars.iv.next113, %.pre-phi
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  br i1 %60, label %.lr.ph75, label %._crit_edge76.loopexit, !llvm.loop !16

._crit_edge76.loopexit:                           ; preds = %.loopexit
  %.pre132 = zext i32 %59 to i64
  br label %._crit_edge76

._crit_edge76:                                    ; preds = %._crit_edge, %._crit_edge.thread, %._crit_edge76.loopexit, %.preheader64
  %61 = phi i64 [ %27, %._crit_edge76.loopexit ], [ %27, %.preheader64 ], [ %27, %._crit_edge ], [ %23, %._crit_edge.thread ]
  %62 = phi ptr [ %29, %._crit_edge76.loopexit ], [ %29, %.preheader64 ], [ %29, %._crit_edge ], [ %25, %._crit_edge.thread ]
  %63 = phi ptr [ %30, %._crit_edge76.loopexit ], [ %30, %.preheader64 ], [ %30, %._crit_edge ], [ %26, %._crit_edge.thread ]
  %.pre-phi133 = phi i64 [ %.pre132, %._crit_edge76.loopexit ], [ %27, %.preheader64 ], [ %27, %._crit_edge ], [ %23, %._crit_edge.thread ]
  %.lcssa65 = phi i32 [ %59, %._crit_edge76.loopexit ], [ %35, %.preheader64 ], [ %35, %._crit_edge ], [ %21, %._crit_edge.thread ]
  %64 = load i32, ptr %2, align 4, !tbaa !11
  %65 = add nsw i32 %64, 1
  %66 = zext i32 %65 to i64
  %67 = mul nuw i64 %.pre-phi133, %66
  %68 = alloca i32, i64 %67, align 16
  %69 = add nsw i32 %.lcssa65, -1
  %70 = sext i32 %69 to i64
  %71 = mul nsw i64 %66, %70
  %72 = getelementptr inbounds i32, ptr %68, i64 %71
  %73 = sext i32 %64 to i64
  %74 = getelementptr inbounds i32, ptr %72, i64 %73
  %75 = getelementptr inbounds i8, ptr %74, i64 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store i32 1000000000, ptr %3, align 4, !tbaa !11
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull %68, ptr noundef nonnull %75, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %76 = load i32, ptr %1, align 4, !tbaa !11
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %.lr.ph80.preheader, label %.preheader63.thread

.lr.ph80.preheader:                               ; preds = %._crit_edge76
  %wide.trip.count118 = zext nneg i32 %76 to i64
  %xtraiter161 = and i64 %wide.trip.count118, 1
  %78 = icmp eq i32 %76, 1
  br i1 %78, label %.preheader63.unr-lcssa, label %.lr.ph80.preheader.new

.lr.ph80.preheader.new:                           ; preds = %.lr.ph80.preheader
  %unroll_iter163 = and i64 %wide.trip.count118, 2147483646
  br label %.lr.ph80

.lr.ph75:                                         ; preds = %.preheader64, %.loopexit
  %79 = phi i32 [ %59, %.loopexit ], [ %35, %.preheader64 ]
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %.loopexit ], [ 0, %.preheader64 ]
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %.loopexit ], [ 1, %.preheader64 ]
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %80 = sext i32 %79 to i64
  %81 = icmp slt i64 %indvars.iv.next113, %80
  br i1 %81, label %.lr.ph73, label %.loopexit

.lr.ph73:                                         ; preds = %.lr.ph75
  %82 = mul nuw nsw i64 %indvars.iv112, %27
  %83 = getelementptr inbounds i32, ptr %29, i64 %82
  %84 = getelementptr inbounds i32, ptr %30, i64 %82
  br label %85

85:                                               ; preds = %.lr.ph73, %85
  %indvars.iv109 = phi i64 [ %indvars.iv107, %.lr.ph73 ], [ %indvars.iv.next110, %85 ]
  %86 = add nsw i64 %indvars.iv109, -1
  %87 = getelementptr inbounds i32, ptr %83, i64 %86
  %88 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv109
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %87, ptr noundef nonnull align 4 dereferenceable(4) %88)
  %90 = load i32, ptr %89, align 4, !tbaa !11
  %91 = getelementptr inbounds i32, ptr %83, i64 %indvars.iv109
  store i32 %90, ptr %91, align 4, !tbaa !11
  %92 = getelementptr inbounds i32, ptr %84, i64 %86
  %93 = load i32, ptr %92, align 4, !tbaa !11
  %94 = load i32, ptr %88, align 4, !tbaa !11
  %95 = add nsw i32 %94, %93
  %96 = getelementptr inbounds i32, ptr %84, i64 %indvars.iv109
  store i32 %95, ptr %96, align 4, !tbaa !11
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %97 = load i32, ptr %1, align 4, !tbaa !11
  %98 = sext i32 %97 to i64
  %99 = icmp slt i64 %indvars.iv.next110, %98
  br i1 %99, label %85, label %.loopexit, !llvm.loop !17

.preheader63.unr-lcssa:                           ; preds = %.lr.ph80, %.lr.ph80.preheader
  %indvars.iv115.unr = phi i64 [ 0, %.lr.ph80.preheader ], [ %indvars.iv.next116.1, %.lr.ph80 ]
  %lcmp.mod162.not = icmp eq i64 %xtraiter161, 0
  br i1 %lcmp.mod162.not, label %.preheader63, label %.lr.ph80.epil

.lr.ph80.epil:                                    ; preds = %.preheader63.unr-lcssa
  %100 = getelementptr inbounds i32, ptr %62, i64 %indvars.iv115.unr
  %101 = load i32, ptr %100, align 4, !tbaa !11
  %102 = trunc i64 %indvars.iv115.unr to i32
  %103 = add i32 %102, 1
  %104 = mul nsw i32 %101, %103
  %105 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv115.unr
  %106 = load i32, ptr %105, align 4, !tbaa !11
  %107 = sub nsw i32 %104, %106
  %108 = mul nuw nsw i64 %indvars.iv115.unr, %66
  %109 = getelementptr inbounds i32, ptr %68, i64 %108
  store i32 %107, ptr %109, align 4, !tbaa !11
  br label %.preheader63

.preheader63:                                     ; preds = %.preheader63.unr-lcssa, %.lr.ph80.epil
  %110 = load i32, ptr %2, align 4, !tbaa !11
  %.not94 = icmp slt i32 %110, 1
  br i1 %.not94, label %._crit_edge96, label %.preheader62.lr.ph

.preheader63.thread:                              ; preds = %._crit_edge76
  %111 = load i32, ptr %2, align 4, !tbaa !11
  br label %._crit_edge96

.preheader62.lr.ph:                               ; preds = %.preheader63
  %invariant.gep89 = getelementptr i8, ptr %68, i64 -4
  br i1 %77, label %.preheader62, label %._crit_edge96

.lr.ph80:                                         ; preds = %.lr.ph80, %.lr.ph80.preheader.new
  %indvars.iv115 = phi i64 [ 0, %.lr.ph80.preheader.new ], [ %indvars.iv.next116.1, %.lr.ph80 ]
  %niter164 = phi i64 [ 0, %.lr.ph80.preheader.new ], [ %niter164.next.1, %.lr.ph80 ]
  %112 = getelementptr inbounds i32, ptr %62, i64 %indvars.iv115
  %113 = load i32, ptr %112, align 8, !tbaa !11
  %indvars.iv.next116 = or disjoint i64 %indvars.iv115, 1
  %114 = trunc nuw nsw i64 %indvars.iv.next116 to i32
  %115 = mul nsw i32 %113, %114
  %116 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv115
  %117 = load i32, ptr %116, align 8, !tbaa !11
  %118 = sub nsw i32 %115, %117
  %119 = mul nuw nsw i64 %indvars.iv115, %66
  %120 = getelementptr inbounds i32, ptr %68, i64 %119
  store i32 %118, ptr %120, align 8, !tbaa !11
  %121 = getelementptr inbounds i32, ptr %62, i64 %indvars.iv.next116
  %122 = load i32, ptr %121, align 4, !tbaa !11
  %indvars.iv.next116.1 = add nuw nsw i64 %indvars.iv115, 2
  %123 = trunc nuw nsw i64 %indvars.iv.next116.1 to i32
  %124 = mul nsw i32 %122, %123
  %125 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv.next116
  %126 = load i32, ptr %125, align 4, !tbaa !11
  %127 = sub nsw i32 %124, %126
  %128 = mul nuw nsw i64 %indvars.iv.next116, %66
  %129 = getelementptr inbounds i32, ptr %68, i64 %128
  store i32 %127, ptr %129, align 4, !tbaa !11
  %niter164.next.1 = add i64 %niter164, 2
  %niter164.ncmp.1 = icmp eq i64 %niter164.next.1, %unroll_iter163
  br i1 %niter164.ncmp.1, label %.preheader63.unr-lcssa, label %.lr.ph80, !llvm.loop !18

.preheader62:                                     ; preds = %.preheader62.lr.ph, %._crit_edge92
  %130 = phi i32 [ %146, %._crit_edge92 ], [ %110, %.preheader62.lr.ph ]
  %131 = phi i32 [ %147, %._crit_edge92 ], [ %76, %.preheader62.lr.ph ]
  %132 = phi i32 [ %148, %._crit_edge92 ], [ %76, %.preheader62.lr.ph ]
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %._crit_edge92 ], [ 1, %.preheader62.lr.ph ]
  %133 = icmp sgt i32 %132, 0
  br i1 %133, label %.preheader.lr.ph, label %._crit_edge92

.preheader.lr.ph:                                 ; preds = %.preheader62
  %invariant.gep = getelementptr inbounds i32, ptr %68, i64 %indvars.iv128
  %gep90 = getelementptr i32, ptr %invariant.gep89, i64 %indvars.iv128
  br label %.preheader

._crit_edge96:                                    ; preds = %._crit_edge92, %.preheader63.thread, %.preheader62.lr.ph, %.preheader63
  %134 = phi i32 [ %76, %.preheader63 ], [ %76, %.preheader62.lr.ph ], [ %76, %.preheader63.thread ], [ %147, %._crit_edge92 ]
  %.lcssa = phi i32 [ %110, %.preheader63 ], [ %110, %.preheader62.lr.ph ], [ %111, %.preheader63.thread ], [ %146, %._crit_edge92 ]
  %135 = add nsw i32 %134, -1
  %136 = sext i32 %135 to i64
  %137 = mul nsw i64 %136, %66
  %138 = getelementptr inbounds i32, ptr %68, i64 %137
  %139 = sext i32 %.lcssa to i64
  %140 = getelementptr inbounds i32, ptr %138, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !11
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %141)
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %142, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %19)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge83
  %144 = phi i32 [ %131, %.preheader.lr.ph ], [ %150, %._crit_edge83 ]
  %indvars.iv125 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next126, %._crit_edge83 ]
  %.not98 = icmp eq i64 %indvars.iv125, 0
  br i1 %.not98, label %._crit_edge83, label %.lr.ph82

.lr.ph82:                                         ; preds = %.preheader
  %145 = mul nuw nsw i64 %indvars.iv125, %66
  %gep93 = getelementptr inbounds i32, ptr %invariant.gep, i64 %145
  %invariant.gep86 = getelementptr inbounds i32, ptr %62, i64 %indvars.iv125
  %invariant.gep87 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv125
  br label %153

._crit_edge92.loopexit:                           ; preds = %._crit_edge83
  %.pre131 = load i32, ptr %2, align 4, !tbaa !11
  br label %._crit_edge92

._crit_edge92:                                    ; preds = %._crit_edge92.loopexit, %.preheader62
  %146 = phi i32 [ %.pre131, %._crit_edge92.loopexit ], [ %130, %.preheader62 ]
  %147 = phi i32 [ %150, %._crit_edge92.loopexit ], [ %131, %.preheader62 ]
  %148 = phi i32 [ %150, %._crit_edge92.loopexit ], [ %132, %.preheader62 ]
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %149 = sext i32 %146 to i64
  %.not.not = icmp slt i64 %indvars.iv128, %149
  br i1 %.not.not, label %.preheader62, label %._crit_edge96, !llvm.loop !19

._crit_edge83.loopexit:                           ; preds = %153
  %.pre = load i32, ptr %1, align 4, !tbaa !11
  br label %._crit_edge83

._crit_edge83:                                    ; preds = %._crit_edge83.loopexit, %.preheader
  %150 = phi i32 [ %.pre, %._crit_edge83.loopexit ], [ %144, %.preheader ]
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %151 = sext i32 %150 to i64
  %152 = icmp slt i64 %indvars.iv.next126, %151
  br i1 %152, label %.preheader, label %._crit_edge92.loopexit, !llvm.loop !21

153:                                              ; preds = %.lr.ph82, %153
  %indvars.iv120 = phi i64 [ 0, %.lr.ph82 ], [ %indvars.iv.next121, %153 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %154 = mul nuw nsw i64 %indvars.iv120, %66
  %gep85 = getelementptr i32, ptr %gep90, i64 %154
  %155 = load i32, ptr %gep85, align 4, !tbaa !11
  %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
  %156 = mul nuw nsw i64 %indvars.iv.next121, %61
  %gep = getelementptr inbounds i32, ptr %invariant.gep86, i64 %156
  %157 = load i32, ptr %gep, align 4, !tbaa !11
  %158 = sub nsw i64 %indvars.iv125, %indvars.iv120
  %159 = trunc nsw i64 %158 to i32
  %160 = mul nsw i32 %157, %159
  %161 = add nsw i32 %160, %155
  %gep88 = getelementptr inbounds i32, ptr %invariant.gep87, i64 %156
  %162 = load i32, ptr %gep88, align 4, !tbaa !11
  %163 = sub i32 %161, %162
  store i32 %163, ptr %4, align 4, !tbaa !11
  %164 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %gep93, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %165 = load i32, ptr %164, align 4, !tbaa !11
  store i32 %165, ptr %gep93, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %exitcond124.not = icmp eq i64 %indvars.iv.next121, %indvars.iv125
  br i1 %exitcond124.not, label %._crit_edge83.loopexit, label %153, !llvm.loop !22
}

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 ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) 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 #5

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { 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 #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 = !{!"any pointer", !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}
!20 = !{!"llvm.loop.unswitch.partial.disable"}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}


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