; LLVM IR from VastoLorde95/Competitive-Programming :: SPOJ/Random/MARTIAN (simmartian)

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

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

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_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 [500 x [500 x i32]], align 16
  %7 = alloca [500 x [500 x i32]], align 16
  %8 = alloca [500 x [500 x i32]], align 16
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 1000000, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 1000000, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 1000000, ptr %8) #6
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3, ptr noundef %2)
  br label %17

17:                                               ; preds = %309, %0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %23

20:                                               ; preds = %17
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = icmp ne i32 %21, 0
  br label %23

23:                                               ; preds = %20, %17
  %24 = phi i1 [ false, %17 ], [ %22, %20 ]
  br i1 %24, label %25, label %322

25:                                               ; preds = %23
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %82, %25
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %30, label %85

30:                                               ; preds = %26
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %78, %30
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %35, label %81

35:                                               ; preds = %31
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [500 x [500 x i32]], ptr %6, i64 0, i64 %37
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [500 x i32], ptr %38, i64 0, i64 %40
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %41)
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %62

45:                                               ; preds = %35
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [500 x [500 x i32]], ptr %6, i64 0, i64 %47
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [500 x i32], ptr %48, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [500 x [500 x i32]], ptr %6, i64 0, i64 %54
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = sub nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [500 x i32], ptr %55, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %52, %60
  br label %70

62:                                               ; preds = %35
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [500 x [500 x i32]], ptr %6, i64 0, i64 %64
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [500 x i32], ptr %65, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %62, %45
  %71 = phi i32 [ %61, %45 ], [ %69, %62 ]
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [500 x [500 x i32]], ptr %6, i64 0, i64 %73
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [500 x i32], ptr %74, i64 0, i64 %76
  store i32 %71, ptr %77, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %70
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %5, align 4, !tbaa !5
  br label %31, !llvm.loop !9

81:                                               ; preds = %31
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %4, align 4, !tbaa !5
  br label %26, !llvm.loop !11

85:                                               ; preds = %26
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %148, %85
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %90, label %151

90:                                               ; preds = %86
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %144, %90
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = load i32, ptr %2, align 4, !tbaa !5
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %95, label %147

95:                                               ; preds = %91
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [500 x [500 x i32]], ptr %7, i64 0, i64 %97
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [500 x i32], ptr %98, i64 0, i64 %100
  %102 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %101)
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %122

105:                                              ; preds = %95
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [500 x [500 x i32]], ptr %7, i64 0, i64 %107
  %109 = load i32, ptr %5, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [500 x i32], ptr %108, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [500 x [500 x i32]], ptr %7, i64 0, i64 %115
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [500 x i32], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = add nsw i32 %112, %120
  br label %130

122:                                              ; preds = %95
  %123 = load i32, ptr %4, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [500 x [500 x i32]], ptr %7, i64 0, i64 %124
  %126 = load i32, ptr %5, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [500 x i32], ptr %125, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %122, %105
  %131 = phi i32 [ %121, %105 ], [ %129, %122 ]
  %132 = load i32, ptr %4, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [500 x [500 x i32]], ptr %7, i64 0, i64 %133
  %135 = load i32, ptr %5, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [500 x i32], ptr %134, i64 0, i64 %136
  store i32 %131, ptr %137, align 4, !tbaa !5
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [500 x [500 x i32]], ptr %8, i64 0, i64 %139
  %141 = load i32, ptr %5, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [500 x i32], ptr %140, i64 0, i64 %142
  store i32 0, ptr %143, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %130
  %145 = load i32, ptr %5, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %5, align 4, !tbaa !5
  br label %91, !llvm.loop !12

147:                                              ; preds = %91
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %4, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %4, align 4, !tbaa !5
  br label %86, !llvm.loop !13

151:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %306, %151
  %153 = load i32, ptr %9, align 4, !tbaa !5
  %154 = load i32, ptr %3, align 4, !tbaa !5
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %157, label %156

156:                                              ; preds = %152
  store i32 16, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %309

157:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %302, %157
  %159 = load i32, ptr %11, align 4, !tbaa !5
  %160 = load i32, ptr %2, align 4, !tbaa !5
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %163, label %162

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

163:                                              ; preds = %158
  %164 = load i32, ptr %9, align 4, !tbaa !5
  %165 = icmp eq i32 %164, 0
  br i1 %165, label %166, label %190

166:                                              ; preds = %163
  %167 = load i32, ptr %11, align 4, !tbaa !5
  %168 = icmp eq i32 %167, 0
  br i1 %168, label %169, label %190

169:                                              ; preds = %166
  %170 = load i32, ptr %9, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [500 x [500 x i32]], ptr %6, i64 0, i64 %171
  %173 = load i32, ptr %11, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [500 x i32], ptr %172, i64 0, i64 %174
  %176 = load i32, ptr %9, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [500 x [500 x i32]], ptr %7, i64 0, i64 %177
  %179 = load i32, ptr %11, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [500 x i32], ptr %178, i64 0, i64 %180
  %182 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %175, ptr noundef nonnull align 4 dereferenceable(4) %181)
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = load i32, ptr %9, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [500 x [500 x i32]], ptr %8, i64 0, i64 %185
  %187 = load i32, ptr %11, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [500 x i32], ptr %186, i64 0, i64 %188
  store i32 %183, ptr %189, align 4, !tbaa !5
  br label %301

190:                                              ; preds = %166, %163
  %191 = load i32, ptr %9, align 4, !tbaa !5
  %192 = icmp eq i32 %191, 0
  br i1 %192, label %193, label %224

193:                                              ; preds = %190
  %194 = load i32, ptr %9, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [500 x [500 x i32]], ptr %6, i64 0, i64 %195
  %197 = load i32, ptr %11, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [500 x i32], ptr %196, i64 0, i64 %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %200 = load i32, ptr %9, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [500 x [500 x i32]], ptr %7, i64 0, i64 %201
  %203 = load i32, ptr %11, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [500 x i32], ptr %202, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = load i32, ptr %9, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [500 x [500 x i32]], ptr %8, i64 0, i64 %208
  %210 = load i32, ptr %11, align 4, !tbaa !5
  %211 = sub nsw i32 %210, 1
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [500 x i32], ptr %209, i64 0, i64 %212
  %214 = load i32, ptr %213, align 4, !tbaa !5
  %215 = add nsw i32 %206, %214
  store i32 %215, ptr %12, align 4, !tbaa !5
  %216 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %199, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = load i32, ptr %9, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [500 x [500 x i32]], ptr %8, i64 0, i64 %219
  %221 = load i32, ptr %11, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [500 x i32], ptr %220, i64 0, i64 %222
  store i32 %217, ptr %223, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %300

224:                                              ; preds = %190
  %225 = load i32, ptr %11, align 4, !tbaa !5
  %226 = icmp eq i32 %225, 0
  br i1 %226, label %227, label %258

227:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %228 = load i32, ptr %9, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [500 x [500 x i32]], ptr %6, i64 0, i64 %229
  %231 = load i32, ptr %11, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [500 x i32], ptr %230, i64 0, i64 %232
  %234 = load i32, ptr %233, align 4, !tbaa !5
  %235 = load i32, ptr %9, align 4, !tbaa !5
  %236 = sub nsw i32 %235, 1
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [500 x [500 x i32]], ptr %8, i64 0, i64 %237
  %239 = load i32, ptr %11, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [500 x i32], ptr %238, i64 0, i64 %240
  %242 = load i32, ptr %241, align 4, !tbaa !5
  %243 = add nsw i32 %234, %242
  store i32 %243, ptr %13, align 4, !tbaa !5
  %244 = load i32, ptr %9, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [500 x [500 x i32]], ptr %7, i64 0, i64 %245
  %247 = load i32, ptr %11, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [500 x i32], ptr %246, i64 0, i64 %248
  %250 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %249)
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = load i32, ptr %9, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [500 x [500 x i32]], ptr %8, i64 0, i64 %253
  %255 = load i32, ptr %11, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [500 x i32], ptr %254, i64 0, i64 %256
  store i32 %251, ptr %257, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %299

258:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %259 = load i32, ptr %9, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [500 x [500 x i32]], ptr %6, i64 0, i64 %260
  %262 = load i32, ptr %11, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [500 x i32], ptr %261, i64 0, i64 %263
  %265 = load i32, ptr %264, align 4, !tbaa !5
  %266 = load i32, ptr %9, align 4, !tbaa !5
  %267 = sub nsw i32 %266, 1
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [500 x [500 x i32]], ptr %8, i64 0, i64 %268
  %270 = load i32, ptr %11, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [500 x i32], ptr %269, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !5
  %274 = add nsw i32 %265, %273
  store i32 %274, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %275 = load i32, ptr %9, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [500 x [500 x i32]], ptr %7, i64 0, i64 %276
  %278 = load i32, ptr %11, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [500 x i32], ptr %277, i64 0, i64 %279
  %281 = load i32, ptr %280, align 4, !tbaa !5
  %282 = load i32, ptr %9, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [500 x [500 x i32]], ptr %8, i64 0, i64 %283
  %285 = load i32, ptr %11, align 4, !tbaa !5
  %286 = sub nsw i32 %285, 1
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [500 x i32], ptr %284, i64 0, i64 %287
  %289 = load i32, ptr %288, align 4, !tbaa !5
  %290 = add nsw i32 %281, %289
  store i32 %290, ptr %15, align 4, !tbaa !5
  %291 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %292 = load i32, ptr %291, align 4, !tbaa !5
  %293 = load i32, ptr %9, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [500 x [500 x i32]], ptr %8, i64 0, i64 %294
  %296 = load i32, ptr %11, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [500 x i32], ptr %295, i64 0, i64 %297
  store i32 %292, ptr %298, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %299

299:                                              ; preds = %258, %227
  br label %300

300:                                              ; preds = %299, %193
  br label %301

301:                                              ; preds = %300, %169
  br label %302

302:                                              ; preds = %301
  %303 = load i32, ptr %11, align 4, !tbaa !5
  %304 = add nsw i32 %303, 1
  store i32 %304, ptr %11, align 4, !tbaa !5
  br label %158, !llvm.loop !14

305:                                              ; preds = %162
  br label %306

306:                                              ; preds = %305
  %307 = load i32, ptr %9, align 4, !tbaa !5
  %308 = add nsw i32 %307, 1
  store i32 %308, ptr %9, align 4, !tbaa !5
  br label %152, !llvm.loop !15

309:                                              ; preds = %156
  %310 = load i32, ptr %3, align 4, !tbaa !5
  %311 = sub nsw i32 %310, 1
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [500 x [500 x i32]], ptr %8, i64 0, i64 %312
  %314 = load i32, ptr %2, align 4, !tbaa !5
  %315 = sub nsw i32 %314, 1
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [500 x i32], ptr %313, i64 0, i64 %316
  %318 = load i32, ptr %317, align 4, !tbaa !5
  %319 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %318)
  %320 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %319, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %321 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3, ptr noundef %2)
  br label %17, !llvm.loop !16

322:                                              ; preds = %23
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1000000, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1000000, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1000000, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %323 = load i32, ptr %1, align 4
  ret i32 %323
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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

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

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_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 [500 x [500 x i32]], align 16
  %4 = alloca [500 x [500 x i32]], align 16
  %5 = alloca [500 x [500 x i32]], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %5) #7
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2, ptr noundef nonnull %1)
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = icmp ne i32 %11, 0
  %13 = load i32, ptr %2, align 4
  %14 = icmp ne i32 %13, 0
  %15 = select i1 %12, i1 %14, i1 false
  br i1 %15, label %.preheader84, label %._crit_edge97

.preheader84:                                     ; preds = %0, %._crit_edge96
  %16 = phi i32 [ %112, %._crit_edge96 ], [ %11, %0 ]
  %17 = phi i32 [ %114, %._crit_edge96 ], [ %13, %0 ]
  %18 = icmp sgt i32 %17, 0
  %19 = icmp sgt i32 %16, 0
  %or.cond = and i1 %18, %19
  br i1 %or.cond, label %.preheader81, label %._crit_edge96

.preheader83:                                     ; preds = %._crit_edge
  %20 = icmp sgt i32 %41, 0
  %21 = icmp sgt i32 %42, 0
  %or.cond150 = and i1 %20, %21
  br i1 %or.cond150, label %.preheader80, label %._crit_edge96

.preheader81:                                     ; preds = %.preheader84, %._crit_edge
  %22 = phi i32 [ %41, %._crit_edge ], [ %17, %.preheader84 ]
  %23 = phi i32 [ %42, %._crit_edge ], [ %16, %.preheader84 ]
  %indvars.iv106 = phi i64 [ %indvars.iv.next107, %._crit_edge ], [ 0, %.preheader84 ]
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %25, label %._crit_edge

25:                                               ; preds = %.preheader81
  %26 = getelementptr inbounds [500 x [500 x i32]], ptr %3, i64 0, i64 %indvars.iv106, i64 0
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %26)
  %28 = load i32, ptr %1, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 1
  br i1 %29, label %.peel.next, label %._crit_edge.loopexit

.peel.next:                                       ; preds = %25, %.peel.next
  %indvars.iv = phi i64 [ %indvars.iv.next, %.peel.next ], [ 1, %25 ]
  %30 = getelementptr inbounds [500 x [500 x i32]], ptr %3, i64 0, i64 %indvars.iv106, i64 %indvars.iv
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %30)
  %32 = add nsw i64 %indvars.iv, -1
  %33 = getelementptr inbounds [500 x [500 x i32]], ptr %3, i64 0, i64 %indvars.iv106, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = load i32, ptr %30, align 4, !tbaa !5
  %36 = add nsw i32 %34, %35
  store i32 %36, ptr %30, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = icmp slt i64 %indvars.iv.next, %38
  br i1 %39, label %.peel.next, label %._crit_edge.loopexit, !llvm.loop !9

._crit_edge.loopexit:                             ; preds = %.peel.next, %25
  %40 = phi i32 [ %28, %25 ], [ %37, %.peel.next ]
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader81
  %41 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %22, %.preheader81 ]
  %42 = phi i32 [ %40, %._crit_edge.loopexit ], [ %23, %.preheader81 ]
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %43 = sext i32 %41 to i64
  %44 = icmp slt i64 %indvars.iv.next107, %43
  br i1 %44, label %.preheader81, label %.preheader83, !llvm.loop !12

.preheader82:                                     ; preds = %._crit_edge89
  %45 = icmp sgt i32 %67, 0
  %46 = icmp sgt i32 %66, 0
  %or.cond151 = and i1 %45, %46
  br i1 %or.cond151, label %.preheader, label %._crit_edge96

.preheader80:                                     ; preds = %.preheader83, %._crit_edge89
  %47 = phi i32 [ %66, %._crit_edge89 ], [ %42, %.preheader83 ]
  %indvars.iv115 = phi i64 [ %indvars.iv.next116, %._crit_edge89 ], [ 0, %.preheader83 ]
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %.lr.ph88, label %._crit_edge89

.lr.ph88:                                         ; preds = %.preheader80
  %.not = icmp eq i64 %indvars.iv115, 0
  %49 = add nsw i64 %indvars.iv115, -1
  br i1 %.not, label %.lr.ph88.split.us, label %.lr.ph88.split

.lr.ph88.split.us:                                ; preds = %.lr.ph88, %.lr.ph88.split.us
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %.lr.ph88.split.us ], [ 0, %.lr.ph88 ]
  %50 = getelementptr inbounds [500 x [500 x i32]], ptr %4, i64 0, i64 0, i64 %indvars.iv112
  %51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %50)
  %52 = getelementptr inbounds [500 x [500 x i32]], ptr %5, i64 0, i64 0, i64 %indvars.iv112
  store i32 0, ptr %52, align 4, !tbaa !5
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %53 = load i32, ptr %1, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = icmp slt i64 %indvars.iv.next113, %54
  br i1 %55, label %.lr.ph88.split.us, label %._crit_edge89, !llvm.loop !14

.lr.ph88.split:                                   ; preds = %.lr.ph88, %.lr.ph88.split
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %.lr.ph88.split ], [ 0, %.lr.ph88 ]
  %56 = getelementptr inbounds [500 x [500 x i32]], ptr %4, i64 0, i64 %indvars.iv115, i64 %indvars.iv109
  %57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %56)
  %58 = load i32, ptr %56, align 4, !tbaa !5
  %59 = getelementptr inbounds [500 x [500 x i32]], ptr %4, i64 0, i64 %49, i64 %indvars.iv109
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %60, %58
  store i32 %61, ptr %56, align 4, !tbaa !5
  %62 = getelementptr inbounds [500 x [500 x i32]], ptr %5, i64 0, i64 %indvars.iv115, i64 %indvars.iv109
  store i32 0, ptr %62, align 4, !tbaa !5
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %63 = load i32, ptr %1, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %indvars.iv.next110, %64
  br i1 %65, label %.lr.ph88.split, label %._crit_edge89, !llvm.loop !14

._crit_edge89:                                    ; preds = %.lr.ph88.split, %.lr.ph88.split.us, %.preheader80
  %66 = phi i32 [ %47, %.preheader80 ], [ %53, %.lr.ph88.split.us ], [ %63, %.lr.ph88.split ]
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next116, %68
  br i1 %69, label %.preheader80, label %.preheader82, !llvm.loop !15

.preheader:                                       ; preds = %.preheader82, %._crit_edge93
  %70 = phi i32 [ %117, %._crit_edge93 ], [ %66, %.preheader82 ]
  %71 = phi i32 [ %118, %._crit_edge93 ], [ %66, %.preheader82 ]
  %indvars.iv126 = phi i64 [ %indvars.iv.next127, %._crit_edge93 ], [ 0, %.preheader82 ]
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %.lr.ph92, label %._crit_edge93

.lr.ph92:                                         ; preds = %.preheader
  %73 = icmp eq i64 %indvars.iv126, 0
  %74 = add nsw i64 %indvars.iv126, -1
  br i1 %73, label %86, label %75

75:                                               ; preds = %.lr.ph92
  %76 = getelementptr inbounds [500 x [500 x i32]], ptr %5, i64 0, i64 %indvars.iv126
  %77 = getelementptr inbounds [500 x [500 x i32]], ptr %4, i64 0, i64 %indvars.iv126
  %78 = getelementptr inbounds [500 x [500 x i32]], ptr %5, i64 0, i64 %74
  %79 = getelementptr inbounds [500 x [500 x i32]], ptr %3, i64 0, i64 %indvars.iv126
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %80 = load i32, ptr %79, align 16, !tbaa !5
  %81 = load i32, ptr %78, align 16, !tbaa !5
  %82 = add nsw i32 %81, %80
  store i32 %82, ptr %7, align 4, !tbaa !5
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %77)
  %84 = load i32, ptr %83, align 4, !tbaa !5
  store i32 %84, ptr %76, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %.pre129 = load i32, ptr %1, align 4, !tbaa !5
  %85 = icmp sgt i32 %.pre129, 1
  br i1 %85, label %.lr.ph92.split.peel.next, label %._crit_edge93

86:                                               ; preds = %.lr.ph92
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %88 = load i32, ptr %87, align 4, !tbaa !5
  store i32 %88, ptr %5, align 16, !tbaa !5
  %.pre131 = load i32, ptr %1, align 4, !tbaa !5
  %89 = icmp sgt i32 %.pre131, 1
  br i1 %89, label %.lr.ph92.split.us.peel.next, label %._crit_edge93

.lr.ph92.split.us.peel.next:                      ; preds = %86, %.lr.ph92.split.us.peel.next
  %indvars.iv122 = phi i64 [ %indvars.iv.next123, %.lr.ph92.split.us.peel.next ], [ 1, %86 ]
  %90 = getelementptr inbounds [500 x i32], ptr %3, i64 0, i64 %indvars.iv122
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %91 = getelementptr inbounds [500 x i32], ptr %4, i64 0, i64 %indvars.iv122
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = add nsw i64 %indvars.iv122, -1
  %94 = getelementptr inbounds [500 x i32], ptr %5, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = add nsw i32 %95, %92
  store i32 %96, ptr %6, align 4, !tbaa !5
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %90, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = getelementptr inbounds [500 x i32], ptr %5, i64 0, i64 %indvars.iv122
  store i32 %98, ptr %99, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %.pre132 = load i32, ptr %1, align 4, !tbaa !5
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %100 = sext i32 %.pre132 to i64
  %101 = icmp slt i64 %indvars.iv.next123, %100
  br i1 %101, label %.lr.ph92.split.us.peel.next, label %._crit_edge93, !llvm.loop !16

._crit_edge96:                                    ; preds = %._crit_edge93, %.preheader84, %.preheader83, %.preheader82
  %102 = phi i32 [ %66, %.preheader82 ], [ %42, %.preheader83 ], [ %16, %.preheader84 ], [ %117, %._crit_edge93 ]
  %.lcssa = phi i32 [ %67, %.preheader82 ], [ %41, %.preheader83 ], [ %17, %.preheader84 ], [ %119, %._crit_edge93 ]
  %103 = add nsw i32 %.lcssa, -1
  %104 = sext i32 %103 to i64
  %105 = add nsw i32 %102, -1
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [500 x [500 x i32]], ptr %5, i64 0, i64 %104, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %108)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %109, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %111 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2, ptr noundef nonnull %1)
  %112 = load i32, ptr %1, align 4, !tbaa !5
  %113 = icmp ne i32 %112, 0
  %114 = load i32, ptr %2, align 4
  %115 = icmp ne i32 %114, 0
  %116 = select i1 %113, i1 %115, i1 false
  br i1 %116, label %.preheader84, label %._crit_edge97, !llvm.loop !17

._crit_edge93:                                    ; preds = %.lr.ph92.split.peel.next, %.lr.ph92.split.us.peel.next, %75, %86, %.preheader
  %117 = phi i32 [ %70, %.preheader ], [ %.pre131, %86 ], [ %.pre129, %75 ], [ %.pre132, %.lr.ph92.split.us.peel.next ], [ %.pre130, %.lr.ph92.split.peel.next ]
  %118 = phi i32 [ %71, %.preheader ], [ %.pre131, %86 ], [ %.pre129, %75 ], [ %.pre132, %.lr.ph92.split.us.peel.next ], [ %.pre130, %.lr.ph92.split.peel.next ]
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %119 = load i32, ptr %2, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = icmp slt i64 %indvars.iv.next127, %120
  br i1 %121, label %.preheader, label %._crit_edge96, !llvm.loop !18

.lr.ph92.split.peel.next:                         ; preds = %75, %.lr.ph92.split.peel.next
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %.lr.ph92.split.peel.next ], [ 1, %75 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %122 = getelementptr inbounds [500 x [500 x i32]], ptr %3, i64 0, i64 %indvars.iv126, i64 %indvars.iv118
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = getelementptr inbounds [500 x [500 x i32]], ptr %5, i64 0, i64 %74, i64 %indvars.iv118
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = add nsw i32 %125, %123
  store i32 %126, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %127 = getelementptr inbounds [500 x [500 x i32]], ptr %4, i64 0, i64 %indvars.iv126, i64 %indvars.iv118
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = add nsw i64 %indvars.iv118, -1
  %130 = getelementptr inbounds [500 x [500 x i32]], ptr %5, i64 0, i64 %indvars.iv126, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = add nsw i32 %131, %128
  store i32 %132, ptr %9, align 4, !tbaa !5
  %133 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = getelementptr inbounds [500 x [500 x i32]], ptr %5, i64 0, i64 %indvars.iv126, i64 %indvars.iv118
  store i32 %134, ptr %135, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  %.pre130 = load i32, ptr %1, align 4, !tbaa !5
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %136 = sext i32 %.pre130 to i64
  %137 = icmp slt i64 %indvars.iv.next119, %136
  br i1 %137, label %.lr.ph92.split.peel.next, label %._crit_edge93, !llvm.loop !19

._crit_edge97:                                    ; preds = %._crit_edge96, %0
  call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; 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 #3

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !13}
!16 = distinct !{!16, !10, !11}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !13}
!19 = distinct !{!19, !10, !11}


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