; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/0621_ARC047 (D)

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

@M = external dso_local global [60 x [60 x i32]], align 16
@num = external dso_local global [5010 x i32], align 16
@A = external dso_local global [5010 x i32], align 16
@B = external dso_local global [5010 x i32], align 16
@C = external dso_local global [5010 x i32], align 16
@D = external dso_local global [5010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = 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
  %18 = 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)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 50
  br i1 %21, label %22, label %23

22:                                               ; preds = %0
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %297

23:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @M, ptr noundef getelementptr inbounds (i32, ptr @M, i64 3600), ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %70, %23
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %73

29:                                               ; preds = %24
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [5010 x i32], ptr @num, i64 0, i64 %31
  %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) %32)
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [5010 x i32], ptr @num, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = icmp sle i32 %37, 2
  br i1 %38, label %39, label %52

39:                                               ; preds = %29
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [5010 x i32], ptr @A, i64 0, i64 %41
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %42)
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [5010 x i32], ptr @B, i64 0, i64 %45
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull align 4 dereferenceable(4) %46)
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [5010 x i32], ptr @C, i64 0, i64 %49
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull align 4 dereferenceable(4) %50)
  br label %69

52:                                               ; preds = %29
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [5010 x i32], ptr @A, i64 0, i64 %54
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %55)
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [5010 x i32], ptr @B, i64 0, i64 %58
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %56, ptr noundef nonnull align 4 dereferenceable(4) %59)
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [5010 x i32], ptr @C, i64 0, i64 %62
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef nonnull align 4 dereferenceable(4) %63)
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [5010 x i32], ptr @D, i64 0, i64 %66
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %64, ptr noundef nonnull align 4 dereferenceable(4) %67)
  br label %69

69:                                               ; preds = %52, %39
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %6, align 4, !tbaa !5
  br label %24, !llvm.loop !9

73:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %293, %73
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

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

79:                                               ; preds = %74
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [5010 x i32], ptr @num, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = icmp eq i32 %83, 1
  br i1 %84, label %85, label %137

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

86:                                               ; preds = %133, %85
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %136

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

92:                                               ; preds = %129, %91
  %93 = load i32, ptr %9, align 4, !tbaa !5
  %94 = load i32, ptr %2, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

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

97:                                               ; preds = %92
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [5010 x i32], ptr @A, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = add nsw i32 %102, %103
  %105 = icmp sle i32 %101, %104
  br i1 %105, label %106, label %128

106:                                              ; preds = %97
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = add nsw i32 %107, %108
  %110 = load i32, ptr %7, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [5010 x i32], ptr @B, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = icmp sle i32 %109, %113
  br i1 %114, label %115, label %128

115:                                              ; preds = %106
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [5010 x i32], ptr @C, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [60 x [60 x i32]], ptr @M, i64 0, i64 %121
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [60 x i32], ptr %122, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = add nsw i32 %126, %119
  store i32 %127, ptr %125, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %115, %106, %97
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %9, align 4, !tbaa !5
  br label %92, !llvm.loop !11

132:                                              ; preds = %96
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %8, align 4, !tbaa !5
  br label %86, !llvm.loop !12

136:                                              ; preds = %90
  br label %292

137:                                              ; preds = %79
  %138 = load i32, ptr %7, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [5010 x i32], ptr @num, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = icmp eq i32 %141, 2
  br i1 %142, label %143, label %195

143:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %191, %143
  %145 = load i32, ptr %10, align 4, !tbaa !5
  %146 = load i32, ptr %2, align 4, !tbaa !5
  %147 = icmp slt i32 %145, %146
  br i1 %147, label %149, label %148

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

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

150:                                              ; preds = %187, %149
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = load i32, ptr %2, align 4, !tbaa !5
  %153 = icmp slt i32 %151, %152
  br i1 %153, label %155, label %154

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

155:                                              ; preds = %150
  %156 = load i32, ptr %7, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [5010 x i32], ptr @A, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = load i32, ptr %11, align 4, !tbaa !5
  %162 = sub nsw i32 %160, %161
  %163 = icmp sle i32 %159, %162
  br i1 %163, label %164, label %186

164:                                              ; preds = %155
  %165 = load i32, ptr %10, align 4, !tbaa !5
  %166 = load i32, ptr %11, align 4, !tbaa !5
  %167 = sub nsw i32 %165, %166
  %168 = load i32, ptr %7, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [5010 x i32], ptr @B, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = icmp sle i32 %167, %171
  br i1 %172, label %173, label %186

173:                                              ; preds = %164
  %174 = load i32, ptr %7, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [5010 x i32], ptr @C, i64 0, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = load i32, ptr %10, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [60 x [60 x i32]], ptr @M, i64 0, i64 %179
  %181 = load i32, ptr %11, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [60 x i32], ptr %180, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = add nsw i32 %184, %177
  store i32 %185, ptr %183, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %173, %164, %155
  br label %187

187:                                              ; preds = %186
  %188 = load i32, ptr %11, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %11, align 4, !tbaa !5
  br label %150, !llvm.loop !13

190:                                              ; preds = %154
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %10, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %10, align 4, !tbaa !5
  br label %144, !llvm.loop !14

194:                                              ; preds = %148
  br label %291

195:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 -1000000010, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %196 = load i32, ptr %7, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [5010 x i32], ptr @A, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  store i32 %199, ptr %13, align 4, !tbaa !5
  br label %200

200:                                              ; preds = %234, %195
  %201 = load i32, ptr %13, align 4, !tbaa !5
  %202 = load i32, ptr %7, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [5010 x i32], ptr @B, i64 0, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %206 = icmp sle i32 %201, %205
  br i1 %206, label %208, label %207

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

208:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %209 = load i32, ptr %7, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [5010 x i32], ptr @C, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !5
  store i32 %212, ptr %14, align 4, !tbaa !5
  br label %213

213:                                              ; preds = %230, %208
  %214 = load i32, ptr %14, align 4, !tbaa !5
  %215 = load i32, ptr %7, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [5010 x i32], ptr @D, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = icmp sle i32 %214, %218
  br i1 %219, label %221, label %220

220:                                              ; preds = %213
  store i32 23, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %233

221:                                              ; preds = %213
  %222 = load i32, ptr %13, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [60 x [60 x i32]], ptr @M, i64 0, i64 %223
  %225 = load i32, ptr %14, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [60 x i32], ptr %224, i64 0, i64 %226
  %228 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %227)
  %229 = load i32, ptr %228, align 4, !tbaa !5
  store i32 %229, ptr %12, align 4, !tbaa !5
  br label %230

230:                                              ; preds = %221
  %231 = load i32, ptr %14, align 4, !tbaa !5
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %14, align 4, !tbaa !5
  br label %213, !llvm.loop !15

233:                                              ; preds = %220
  br label %234

234:                                              ; preds = %233
  %235 = load i32, ptr %13, align 4, !tbaa !5
  %236 = add nsw i32 %235, 1
  store i32 %236, ptr %13, align 4, !tbaa !5
  br label %200, !llvm.loop !16

237:                                              ; preds = %207
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %238 = load i32, ptr %7, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [5010 x i32], ptr @A, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  store i32 %241, ptr %16, align 4, !tbaa !5
  br label %242

242:                                              ; preds = %281, %237
  %243 = load i32, ptr %16, align 4, !tbaa !5
  %244 = load i32, ptr %7, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [5010 x i32], ptr @B, i64 0, i64 %245
  %247 = load i32, ptr %246, align 4, !tbaa !5
  %248 = icmp sle i32 %243, %247
  br i1 %248, label %250, label %249

249:                                              ; preds = %242
  store i32 26, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %284

250:                                              ; preds = %242
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %251 = load i32, ptr %7, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [5010 x i32], ptr @C, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  store i32 %254, ptr %17, align 4, !tbaa !5
  br label %255

255:                                              ; preds = %277, %250
  %256 = load i32, ptr %17, align 4, !tbaa !5
  %257 = load i32, ptr %7, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [5010 x i32], ptr @D, i64 0, i64 %258
  %260 = load i32, ptr %259, align 4, !tbaa !5
  %261 = icmp sle i32 %256, %260
  br i1 %261, label %263, label %262

262:                                              ; preds = %255
  store i32 29, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %280

263:                                              ; preds = %255
  %264 = load i32, ptr %16, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [60 x [60 x i32]], ptr @M, i64 0, i64 %265
  %267 = load i32, ptr %17, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [60 x i32], ptr %266, i64 0, i64 %268
  %270 = load i32, ptr %269, align 4, !tbaa !5
  %271 = load i32, ptr %12, align 4, !tbaa !5
  %272 = icmp eq i32 %270, %271
  br i1 %272, label %273, label %276

273:                                              ; preds = %263
  %274 = load i32, ptr %15, align 4, !tbaa !5
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr %15, align 4, !tbaa !5
  br label %276

276:                                              ; preds = %273, %263
  br label %277

277:                                              ; preds = %276
  %278 = load i32, ptr %17, align 4, !tbaa !5
  %279 = add nsw i32 %278, 1
  store i32 %279, ptr %17, align 4, !tbaa !5
  br label %255, !llvm.loop !17

280:                                              ; preds = %262
  br label %281

281:                                              ; preds = %280
  %282 = load i32, ptr %16, align 4, !tbaa !5
  %283 = add nsw i32 %282, 1
  store i32 %283, ptr %16, align 4, !tbaa !5
  br label %242, !llvm.loop !18

284:                                              ; preds = %249
  %285 = load i32, ptr %12, align 4, !tbaa !5
  %286 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %285)
  %287 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %286, ptr noundef @.str)
  %288 = load i32, ptr %15, align 4, !tbaa !5
  %289 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %287, i32 noundef %288)
  %290 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %289, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %291

291:                                              ; preds = %284, %194
  br label %292

292:                                              ; preds = %291, %136
  br label %293

293:                                              ; preds = %292
  %294 = load i32, ptr %7, align 4, !tbaa !5
  %295 = add nsw i32 %294, 1
  store i32 %295, ptr %7, align 4, !tbaa !5
  br label %74, !llvm.loop !19

296:                                              ; preds = %78
  store i32 0, ptr %4, align 4
  br label %297

297:                                              ; preds = %296, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %298 = load i32, ptr %4, align 4
  switch i32 %298, label %301 [
    i32 0, label %299
    i32 1, label %299
  ]

299:                                              ; preds = %297, %297
  %300 = load i32, ptr %1, align 4
  ret i32 %300

301:                                              ; preds = %297
  unreachable
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, 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

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

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

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

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 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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_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" }

@M = external dso_local global [60 x [60 x i32]], align 16
@num = external dso_local global [5010 x i32], align 16
@A = external dso_local global [5010 x i32], align 16
@B = external dso_local global [5010 x i32], align 16
@C = external dso_local global [5010 x i32], align 16
@D = external dso_local global [5010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = 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
  %5 = 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)
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 50
  br i1 %8, label %.loopexit90, label %9

9:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @M, ptr noundef nonnull getelementptr inbounds (i8, ptr @M, i64 14400), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %.loopexit90

.preheader89:                                     ; preds = %26
  %12 = icmp sgt i32 %27, 0
  br i1 %12, label %.lr.ph123, label %.loopexit90

.lr.ph:                                           ; preds = %9, %26
  %indvars.iv = phi i64 [ %indvars.iv.next, %26 ], [ 0, %9 ]
  %13 = getelementptr inbounds [5010 x i32], ptr @num, i64 0, i64 %indvars.iv
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %15 = load i32, ptr %13, align 4, !tbaa !5
  %16 = icmp slt i32 %15, 3
  %17 = getelementptr inbounds [5010 x i32], ptr @A, i64 0, i64 %indvars.iv
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %19 = getelementptr inbounds [5010 x i32], ptr @B, i64 0, i64 %indvars.iv
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %21 = getelementptr inbounds [5010 x i32], ptr @C, i64 0, i64 %indvars.iv
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
  br i1 %16, label %26, label %23

23:                                               ; preds = %.lr.ph
  %24 = getelementptr inbounds [5010 x i32], ptr @D, i64 0, i64 %indvars.iv
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %24)
  br label %26

26:                                               ; preds = %.lr.ph, %23
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = icmp slt i64 %indvars.iv.next, %28
  br i1 %29, label %.lr.ph, label %.preheader89, !llvm.loop !9

.lr.ph123:                                        ; preds = %.preheader89, %.loopexit
  %30 = phi i32 [ %127, %.loopexit ], [ %27, %.preheader89 ]
  %indvars.iv162 = phi i64 [ %indvars.iv.next163, %.loopexit ], [ 0, %.preheader89 ]
  %31 = getelementptr inbounds [5010 x i32], ptr @num, i64 0, i64 %indvars.iv162
  %32 = load i32, ptr %31, align 4, !tbaa !5
  switch i32 %32, label %69 [
    i32 1, label %.preheader86
    i32 2, label %.preheader87
  ]

.preheader87:                                     ; preds = %.lr.ph123
  %33 = load i32, ptr %1, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.preheader85.lr.ph, label %.loopexit

.preheader85.lr.ph:                               ; preds = %.preheader87
  %35 = getelementptr inbounds [5010 x i32], ptr @A, i64 0, i64 %indvars.iv162
  %36 = getelementptr inbounds [5010 x i32], ptr @B, i64 0, i64 %indvars.iv162
  %37 = getelementptr inbounds [5010 x i32], ptr @C, i64 0, i64 %indvars.iv162
  %38 = load i32, ptr %35, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %wide.trip.count135 = zext nneg i32 %33 to i64
  br label %.preheader85.us

.preheader85.us:                                  ; preds = %._crit_edge.us, %.preheader85.lr.ph
  %indvars.iv132 = phi i64 [ %indvars.iv.next133, %._crit_edge.us ], [ 0, %.preheader85.lr.ph ]
  br label %40

40:                                               ; preds = %.preheader85.us, %50
  %indvars.iv129 = phi i64 [ 0, %.preheader85.us ], [ %indvars.iv.next130, %50 ]
  %41 = sub nsw i64 %indvars.iv132, %indvars.iv129
  %.not81.us = icmp slt i64 %41, %39
  br i1 %.not81.us, label %50, label %42

42:                                               ; preds = %40
  %43 = load i32, ptr %36, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %.not82.us = icmp sgt i64 %41, %44
  br i1 %.not82.us, label %50, label %45

45:                                               ; preds = %42
  %46 = load i32, ptr %37, align 4, !tbaa !5
  %47 = getelementptr inbounds [60 x [60 x i32]], ptr @M, i64 0, i64 %indvars.iv132, i64 %indvars.iv129
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = add nsw i32 %48, %46
  store i32 %49, ptr %47, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %45, %42, %40
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next130, %wide.trip.count135
  br i1 %exitcond.not, label %._crit_edge.us, label %40, !llvm.loop !11

._crit_edge.us:                                   ; preds = %50
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %exitcond136.not = icmp eq i64 %indvars.iv.next133, %wide.trip.count135
  br i1 %exitcond136.not, label %.loopexit, label %.preheader85.us, !llvm.loop !12

.preheader86:                                     ; preds = %.lr.ph123
  %51 = load i32, ptr %1, align 4, !tbaa !5
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %.preheader86
  %53 = getelementptr inbounds [5010 x i32], ptr @A, i64 0, i64 %indvars.iv162
  %54 = getelementptr inbounds [5010 x i32], ptr @B, i64 0, i64 %indvars.iv162
  %55 = getelementptr inbounds [5010 x i32], ptr @C, i64 0, i64 %indvars.iv162
  %56 = load i32, ptr %53, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %wide.trip.count145 = zext nneg i32 %51 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %._crit_edge.us98, %.preheader.lr.ph
  %indvars.iv142 = phi i64 [ %indvars.iv.next143, %._crit_edge.us98 ], [ 0, %.preheader.lr.ph ]
  br label %58

58:                                               ; preds = %.preheader.us, %68
  %indvars.iv137 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next138, %68 ]
  %59 = add nuw nsw i64 %indvars.iv137, %indvars.iv142
  %.not83.us = icmp slt i64 %59, %57
  br i1 %.not83.us, label %68, label %60

60:                                               ; preds = %58
  %61 = load i32, ptr %54, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %.not84.us = icmp sgt i64 %59, %62
  br i1 %.not84.us, label %68, label %63

63:                                               ; preds = %60
  %64 = load i32, ptr %55, align 4, !tbaa !5
  %65 = getelementptr inbounds [60 x [60 x i32]], ptr @M, i64 0, i64 %indvars.iv142, i64 %indvars.iv137
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, %64
  store i32 %67, ptr %65, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %63, %60, %58
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %exitcond141.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count145
  br i1 %exitcond141.not, label %._crit_edge.us98, label %58, !llvm.loop !13

._crit_edge.us98:                                 ; preds = %68
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %exitcond146.not = icmp eq i64 %indvars.iv.next143, %wide.trip.count145
  br i1 %exitcond146.not, label %.loopexit, label %.preheader.us, !llvm.loop !14

69:                                               ; preds = %.lr.ph123
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 -1000000010, ptr %4, align 4, !tbaa !5
  %70 = getelementptr inbounds [5010 x i32], ptr @A, i64 0, i64 %indvars.iv162
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = getelementptr inbounds [5010 x i32], ptr @B, i64 0, i64 %indvars.iv162
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %.not102 = icmp sgt i32 %71, %73
  br i1 %.not102, label %._crit_edge106, label %.lr.ph105

.lr.ph105:                                        ; preds = %69
  %74 = getelementptr inbounds [5010 x i32], ptr @C, i64 0, i64 %indvars.iv162
  %75 = getelementptr inbounds [5010 x i32], ptr @D, i64 0, i64 %indvars.iv162
  %76 = load i32, ptr %74, align 4, !tbaa !5
  %77 = load i32, ptr %75, align 4, !tbaa !5
  %78 = icmp sgt i32 %76, %77
  br i1 %78, label %._crit_edge106, label %.lr.ph105.split.preheader

.lr.ph105.split.preheader:                        ; preds = %.lr.ph105
  %79 = sext i32 %71 to i64
  br label %.lr.ph105.split

._crit_edge106.loopexit125:                       ; preds = %._crit_edge
  %.pre165 = load i32, ptr %70, align 4, !tbaa !5
  br label %._crit_edge106

._crit_edge106:                                   ; preds = %.lr.ph105, %._crit_edge106.loopexit125, %69
  %80 = phi i32 [ -1000000010, %69 ], [ %98, %._crit_edge106.loopexit125 ], [ -1000000010, %.lr.ph105 ]
  %81 = phi i32 [ %71, %69 ], [ %.pre165, %._crit_edge106.loopexit125 ], [ %71, %.lr.ph105 ]
  %.lcssa = phi i32 [ %73, %69 ], [ %99, %._crit_edge106.loopexit125 ], [ %73, %.lr.ph105 ]
  %.not78114 = icmp sgt i32 %81, %.lcssa
  br i1 %.not78114, label %._crit_edge119, label %.lr.ph118

.lr.ph118:                                        ; preds = %._crit_edge106
  %82 = getelementptr inbounds [5010 x i32], ptr @C, i64 0, i64 %indvars.iv162
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = getelementptr inbounds [5010 x i32], ptr @D, i64 0, i64 %indvars.iv162
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %.not79107 = icmp sgt i32 %83, %85
  br i1 %.not79107, label %._crit_edge119, label %.lr.ph111.preheader

.lr.ph111.preheader:                              ; preds = %.lr.ph118
  %86 = sext i32 %83 to i64
  %87 = add i32 %85, 1
  %88 = sext i32 %81 to i64
  %89 = add i32 %.lcssa, 1
  %90 = sub i32 %85, %83
  %91 = zext i32 %90 to i64
  %92 = add nuw nsw i64 %91, 1
  %min.iters.check = icmp ult i32 %90, 7
  %n.vec = and i64 %92, 8589934584
  %ind.end = add nsw i64 %n.vec, %86
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %80, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %cmp.n = icmp eq i64 %92, %n.vec
  br label %.lr.ph111

.lr.ph105.split:                                  ; preds = %.lr.ph105.split.preheader, %._crit_edge
  %93 = phi i32 [ -1000000010, %.lr.ph105.split.preheader ], [ %98, %._crit_edge ]
  %94 = phi i32 [ %73, %.lr.ph105.split.preheader ], [ %99, %._crit_edge ]
  %95 = phi i32 [ %77, %.lr.ph105.split.preheader ], [ %100, %._crit_edge ]
  %indvars.iv150 = phi i64 [ %79, %.lr.ph105.split.preheader ], [ %indvars.iv.next151, %._crit_edge ]
  %96 = load i32, ptr %74, align 4, !tbaa !5
  %.not8099 = icmp sgt i32 %96, %95
  br i1 %.not8099, label %._crit_edge, label %.lr.ph101

.lr.ph101:                                        ; preds = %.lr.ph105.split
  %97 = sext i32 %96 to i64
  br label %102

._crit_edge.loopexit:                             ; preds = %102
  %.pre = load i32, ptr %72, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph105.split
  %98 = phi i32 [ %105, %._crit_edge.loopexit ], [ %93, %.lr.ph105.split ]
  %99 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %94, %.lr.ph105.split ]
  %100 = phi i32 [ %106, %._crit_edge.loopexit ], [ %95, %.lr.ph105.split ]
  %indvars.iv.next151 = add nsw i64 %indvars.iv150, 1
  %101 = sext i32 %99 to i64
  %.not.not = icmp slt i64 %indvars.iv150, %101
  br i1 %.not.not, label %.lr.ph105.split, label %._crit_edge106.loopexit125, !llvm.loop !15

102:                                              ; preds = %.lr.ph101, %102
  %indvars.iv147 = phi i64 [ %97, %.lr.ph101 ], [ %indvars.iv.next148, %102 ]
  %103 = getelementptr inbounds [60 x [60 x i32]], ptr @M, i64 0, i64 %indvars.iv150, i64 %indvars.iv147
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %103)
  %105 = load i32, ptr %104, align 4, !tbaa !5
  store i32 %105, ptr %4, align 4, !tbaa !5
  %indvars.iv.next148 = add nsw i64 %indvars.iv147, 1
  %106 = load i32, ptr %75, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %.not80.not = icmp slt i64 %indvars.iv147, %107
  br i1 %.not80.not, label %102, label %._crit_edge.loopexit, !llvm.loop !17

._crit_edge119:                                   ; preds = %._crit_edge112, %.lr.ph118, %._crit_edge106
  %.065.lcssa = phi i32 [ 0, %._crit_edge106 ], [ 0, %.lr.ph118 ], [ %spec.select.lcssa, %._crit_edge112 ]
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %80)
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %108, ptr noundef nonnull @.str)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %109, i32 noundef %.065.lcssa)
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %110, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %.pre166 = load i32, ptr %2, align 4, !tbaa !5
  br label %.loopexit

.lr.ph111:                                        ; preds = %.lr.ph111.preheader, %._crit_edge112
  %indvars.iv157 = phi i64 [ %88, %.lr.ph111.preheader ], [ %indvars.iv.next158, %._crit_edge112 ]
  %.065115 = phi i32 [ 0, %.lr.ph111.preheader ], [ %spec.select.lcssa, %._crit_edge112 ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph111
  %indvars.iv153.ph = phi i64 [ %86, %.lr.ph111 ], [ %ind.end, %middle.block ]
  %.1108.ph = phi i32 [ %.065115, %.lr.ph111 ], [ %122, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph111
  %112 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.065115, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %112, %vector.ph ], [ %119, %vector.body ]
  %vec.phi179 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %120, %vector.body ]
  %offset.idx = add i64 %index, %86
  %113 = getelementptr inbounds [60 x [60 x i32]], ptr @M, i64 0, i64 %indvars.iv157, i64 %offset.idx
  %114 = getelementptr inbounds i8, ptr %113, i64 16
  %wide.load = load <4 x i32>, ptr %113, align 4, !tbaa !5
  %wide.load180 = load <4 x i32>, ptr %114, align 4, !tbaa !5
  %115 = icmp eq <4 x i32> %wide.load, %broadcast.splat
  %116 = icmp eq <4 x i32> %wide.load180, %broadcast.splat
  %117 = zext <4 x i1> %115 to <4 x i32>
  %118 = zext <4 x i1> %116 to <4 x i32>
  %119 = add <4 x i32> %vec.phi, %117
  %120 = add <4 x i32> %vec.phi179, %118
  %index.next = add nuw i64 %index, 8
  %121 = icmp eq i64 %index.next, %n.vec
  br i1 %121, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %120, %119
  %122 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br i1 %cmp.n, label %._crit_edge112, label %scalar.ph.preheader

._crit_edge112:                                   ; preds = %scalar.ph, %middle.block
  %spec.select.lcssa = phi i32 [ %122, %middle.block ], [ %spec.select, %scalar.ph ]
  %indvars.iv.next158 = add nsw i64 %indvars.iv157, 1
  %lftr.wideiv160 = trunc i64 %indvars.iv.next158 to i32
  %exitcond161.not = icmp eq i32 %89, %lftr.wideiv160
  br i1 %exitcond161.not, label %._crit_edge119, label %.lr.ph111, !llvm.loop !21

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv153 = phi i64 [ %indvars.iv.next154, %scalar.ph ], [ %indvars.iv153.ph, %scalar.ph.preheader ]
  %.1108 = phi i32 [ %spec.select, %scalar.ph ], [ %.1108.ph, %scalar.ph.preheader ]
  %123 = getelementptr inbounds [60 x [60 x i32]], ptr @M, i64 0, i64 %indvars.iv157, i64 %indvars.iv153
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = icmp eq i32 %124, %80
  %126 = zext i1 %125 to i32
  %spec.select = add nsw i32 %.1108, %126
  %indvars.iv.next154 = add nsw i64 %indvars.iv153, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next154 to i32
  %exitcond156.not = icmp eq i32 %87, %lftr.wideiv
  br i1 %exitcond156.not, label %._crit_edge112, label %scalar.ph, !llvm.loop !22

.loopexit:                                        ; preds = %._crit_edge.us, %._crit_edge.us98, %.preheader87, %.preheader86, %._crit_edge119
  %127 = phi i32 [ %30, %.preheader87 ], [ %30, %.preheader86 ], [ %.pre166, %._crit_edge119 ], [ %30, %._crit_edge.us98 ], [ %30, %._crit_edge.us ]
  %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
  %128 = sext i32 %127 to i64
  %129 = icmp slt i64 %indvars.iv.next163, %128
  br i1 %129, label %.lr.ph123, label %.loopexit90, !llvm.loop !23

.loopexit90:                                      ; preds = %.loopexit, %9, %.preheader89, %0
  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

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 #2

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #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 = { "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 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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}
!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}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !20, !19}
!23 = distinct !{!23, !10}


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