; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2019-20/Dec/Plat (pieaters)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@dp = external dso_local global [300 x [300 x i32]], align 16
@mx = external dso_local global [300 x [300 x [300 x i32]]], align 16
@w = external dso_local global %"class.std::vector", align 8
@l = external dso_local global %"class.std::vector", align 8
@r = external dso_local global %"class.std::vector", align 8
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) #0

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca ptr, align 8
  %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 1, ptr %3) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef @.str.7, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %18 unwind label %33

18:                                               ; preds = %0
  invoke void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %2)
          to label %19 unwind label %37

19:                                               ; preds = %18
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #6
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %22 = load i32, ptr @M, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %23)
  %24 = load i32, ptr @M, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @l, i64 noundef %25)
  %26 = load i32, ptr @M, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @r, i64 noundef %27)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %102, %19
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = load i32, ptr @M, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %42, label %32

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

33:                                               ; preds = %0
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %4, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %5, align 4
  br label %41

37:                                               ; preds = %18
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %4, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  br label %41

41:                                               ; preds = %37, %33
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #6
  br label %325

42:                                               ; preds = %28
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %44) #6
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %45)
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @l, i64 noundef %48) #6
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 4 dereferenceable(4) %49)
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @r, i64 noundef %52) #6
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef nonnull align 4 dereferenceable(4) %53)
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @l, i64 noundef %56) #6
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = add nsw i32 %58, -1
  store i32 %59, ptr %57, align 4, !tbaa !5
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @r, i64 noundef %61) #6
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %63, -1
  store i32 %64, ptr %62, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @l, i64 noundef %66) #6
  %68 = load i32, ptr %67, align 4, !tbaa !5
  store i32 %68, ptr %8, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %98, %42
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @r, i64 noundef %72) #6
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  %76 = icmp slt i32 %70, %75
  br i1 %76, label %78, label %77

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

78:                                               ; preds = %69
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %80
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @l, i64 noundef %83) #6
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [300 x [300 x i32]], ptr %81, i64 0, i64 %86
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @r, i64 noundef %89) #6
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [300 x i32], ptr %87, i64 0, i64 %92
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %95) #6
  %97 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %93, ptr noundef nonnull align 4 dereferenceable(4) %96)
  br label %98

98:                                               ; preds = %78
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %8, align 4, !tbaa !5
  br label %69, !llvm.loop !9

101:                                              ; preds = %77
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %6, align 4, !tbaa !5
  br label %28, !llvm.loop !11

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

106:                                              ; preds = %185, %105
  %107 = load i32, ptr %9, align 4, !tbaa !5
  %108 = load i32, ptr @N, align 4, !tbaa !5
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %111, label %110

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

111:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %112 = load i32, ptr %9, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  %114 = sub nsw i32 %113, 1
  store i32 %114, ptr %10, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %181, %111
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = icmp sge i32 %116, 0
  br i1 %117, label %119, label %118

118:                                              ; preds = %115
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %184

119:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %120 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %120, ptr %11, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %177, %119
  %122 = load i32, ptr %11, align 4, !tbaa !5
  %123 = load i32, ptr @N, align 4, !tbaa !5
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %121
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %180

126:                                              ; preds = %121
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %150

129:                                              ; preds = %126
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %131
  %133 = load i32, ptr %10, align 4, !tbaa !5
  %134 = sub nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [300 x [300 x i32]], ptr %132, i64 0, i64 %135
  %137 = load i32, ptr %11, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [300 x i32], ptr %136, i64 0, i64 %138
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %141
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [300 x [300 x i32]], ptr %142, i64 0, i64 %144
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [300 x i32], ptr %145, i64 0, i64 %147
  %149 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %139, ptr noundef nonnull align 4 dereferenceable(4) %148)
  br label %150

150:                                              ; preds = %129, %126
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = load i32, ptr @N, align 4, !tbaa !5
  %153 = sub nsw i32 %152, 1
  %154 = icmp slt i32 %151, %153
  br i1 %154, label %155, label %176

155:                                              ; preds = %150
  %156 = load i32, ptr %9, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %157
  %159 = load i32, ptr %10, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [300 x [300 x i32]], ptr %158, i64 0, i64 %160
  %162 = load i32, ptr %11, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [300 x i32], ptr %161, i64 0, i64 %164
  %166 = load i32, ptr %9, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %167
  %169 = load i32, ptr %10, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [300 x [300 x i32]], ptr %168, i64 0, i64 %170
  %172 = load i32, ptr %11, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [300 x i32], ptr %171, i64 0, i64 %173
  %175 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %165, ptr noundef nonnull align 4 dereferenceable(4) %174)
  br label %176

176:                                              ; preds = %155, %150
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %11, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %11, align 4, !tbaa !5
  br label %121, !llvm.loop !12

180:                                              ; preds = %125
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %10, align 4, !tbaa !5
  %183 = add nsw i32 %182, -1
  store i32 %183, ptr %10, align 4, !tbaa !5
  br label %115, !llvm.loop !13

184:                                              ; preds = %118
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %9, align 4, !tbaa !5
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %9, align 4, !tbaa !5
  br label %106, !llvm.loop !14

188:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %189 = load i32, ptr @N, align 4, !tbaa !5
  %190 = sub nsw i32 %189, 1
  store i32 %190, ptr %12, align 4, !tbaa !5
  br label %191

191:                                              ; preds = %313, %188
  %192 = load i32, ptr %12, align 4, !tbaa !5
  %193 = icmp sge i32 %192, 0
  br i1 %193, label %195, label %194

194:                                              ; preds = %191
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %316

195:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %196 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %196, ptr %13, align 4, !tbaa !5
  br label %197

197:                                              ; preds = %309, %195
  %198 = load i32, ptr %13, align 4, !tbaa !5
  %199 = load i32, ptr @N, align 4, !tbaa !5
  %200 = icmp slt i32 %198, %199
  br i1 %200, label %202, label %201

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

202:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %203 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %203, ptr %14, align 4, !tbaa !5
  br label %204

204:                                              ; preds = %233, %202
  %205 = load i32, ptr %14, align 4, !tbaa !5
  %206 = load i32, ptr %13, align 4, !tbaa !5
  %207 = icmp slt i32 %205, %206
  br i1 %207, label %209, label %208

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

209:                                              ; preds = %204
  %210 = load i32, ptr %12, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [300 x [300 x i32]], ptr @dp, i64 0, i64 %211
  %213 = load i32, ptr %13, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [300 x i32], ptr %212, i64 0, i64 %214
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %216 = load i32, ptr %12, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [300 x [300 x i32]], ptr @dp, i64 0, i64 %217
  %219 = load i32, ptr %14, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [300 x i32], ptr %218, i64 0, i64 %220
  %222 = load i32, ptr %221, align 4, !tbaa !5
  %223 = load i32, ptr %14, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [300 x [300 x i32]], ptr @dp, i64 0, i64 %225
  %227 = load i32, ptr %13, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [300 x i32], ptr %226, i64 0, i64 %228
  %230 = load i32, ptr %229, align 4, !tbaa !5
  %231 = add nsw i32 %222, %230
  store i32 %231, ptr %15, align 4, !tbaa !5
  %232 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %215, ptr noundef nonnull align 4 dereferenceable(4) %15)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %233

233:                                              ; preds = %209
  %234 = load i32, ptr %14, align 4, !tbaa !5
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr %14, align 4, !tbaa !5
  br label %204, !llvm.loop !15

236:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %237 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %237, ptr %16, align 4, !tbaa !5
  br label %238

238:                                              ; preds = %305, %236
  %239 = load i32, ptr %16, align 4, !tbaa !5
  %240 = load i32, ptr %13, align 4, !tbaa !5
  %241 = add nsw i32 %240, 1
  %242 = icmp slt i32 %239, %241
  br i1 %242, label %244, label %243

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

244:                                              ; preds = %238
  %245 = load i32, ptr %16, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %246
  %248 = load i32, ptr %12, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [300 x [300 x i32]], ptr %247, i64 0, i64 %249
  %251 = load i32, ptr %13, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [300 x i32], ptr %250, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = icmp ne i32 %254, 0
  br i1 %255, label %256, label %304

256:                                              ; preds = %244
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %257 = load i32, ptr %16, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %258
  %260 = load i32, ptr %12, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [300 x [300 x i32]], ptr %259, i64 0, i64 %261
  %263 = load i32, ptr %13, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [300 x i32], ptr %262, i64 0, i64 %264
  %266 = load i32, ptr %265, align 4, !tbaa !5
  store i32 %266, ptr %17, align 4, !tbaa !5
  %267 = load i32, ptr %16, align 4, !tbaa !5
  %268 = load i32, ptr %12, align 4, !tbaa !5
  %269 = icmp sgt i32 %267, %268
  br i1 %269, label %270, label %281

270:                                              ; preds = %256
  %271 = load i32, ptr %12, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [300 x [300 x i32]], ptr @dp, i64 0, i64 %272
  %274 = load i32, ptr %16, align 4, !tbaa !5
  %275 = sub nsw i32 %274, 1
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [300 x i32], ptr %273, i64 0, i64 %276
  %278 = load i32, ptr %277, align 4, !tbaa !5
  %279 = load i32, ptr %17, align 4, !tbaa !5
  %280 = add nsw i32 %279, %278
  store i32 %280, ptr %17, align 4, !tbaa !5
  br label %281

281:                                              ; preds = %270, %256
  %282 = load i32, ptr %16, align 4, !tbaa !5
  %283 = load i32, ptr %13, align 4, !tbaa !5
  %284 = icmp slt i32 %282, %283
  br i1 %284, label %285, label %296

285:                                              ; preds = %281
  %286 = load i32, ptr %16, align 4, !tbaa !5
  %287 = add nsw i32 %286, 1
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [300 x [300 x i32]], ptr @dp, i64 0, i64 %288
  %290 = load i32, ptr %13, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [300 x i32], ptr %289, i64 0, i64 %291
  %293 = load i32, ptr %292, align 4, !tbaa !5
  %294 = load i32, ptr %17, align 4, !tbaa !5
  %295 = add nsw i32 %294, %293
  store i32 %295, ptr %17, align 4, !tbaa !5
  br label %296

296:                                              ; preds = %285, %281
  %297 = load i32, ptr %12, align 4, !tbaa !5
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [300 x [300 x i32]], ptr @dp, i64 0, i64 %298
  %300 = load i32, ptr %13, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [300 x i32], ptr %299, i64 0, i64 %301
  %303 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %302, ptr noundef nonnull align 4 dereferenceable(4) %17)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %304

304:                                              ; preds = %296, %244
  br label %305

305:                                              ; preds = %304
  %306 = load i32, ptr %16, align 4, !tbaa !5
  %307 = add nsw i32 %306, 1
  store i32 %307, ptr %16, align 4, !tbaa !5
  br label %238, !llvm.loop !16

308:                                              ; preds = %243
  br label %309

309:                                              ; preds = %308
  %310 = load i32, ptr %13, align 4, !tbaa !5
  %311 = add nsw i32 %310, 1
  store i32 %311, ptr %13, align 4, !tbaa !5
  br label %197, !llvm.loop !17

312:                                              ; preds = %201
  br label %313

313:                                              ; preds = %312
  %314 = load i32, ptr %12, align 4, !tbaa !5
  %315 = add nsw i32 %314, -1
  store i32 %315, ptr %12, align 4, !tbaa !5
  br label %191, !llvm.loop !18

316:                                              ; preds = %194
  %317 = load i32, ptr @N, align 4, !tbaa !5
  %318 = sub nsw i32 %317, 1
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [300 x i32], ptr @dp, i64 0, i64 %319
  %321 = load i32, ptr %320, align 4, !tbaa !5
  %322 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %321)
  %323 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %322, ptr noundef @.str.8)
  %324 = load i32, ptr %1, align 4
  ret i32 %324

325:                                              ; preds = %41
  %326 = load ptr, ptr %4, align 8
  %327 = load i32, ptr %5, align 4
  %328 = insertvalue { ptr, i32 } poison, ptr %326, 0
  %329 = insertvalue { ptr, i32 } %328, i32 %327, 1
  resume { ptr, i32 } %329
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #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 = { 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}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@dp = external dso_local global [300 x [300 x i32]], align 16
@mx = external dso_local global [300 x [300 x [300 x i32]]], align 16
@w = external dso_local global %"class.std::vector", align 8
@l = external dso_local global %"class.std::vector", align 8
@r = external dso_local global %"class.std::vector", align 8
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) local_unnamed_addr #0

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.7, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %5 unwind label %19

5:                                                ; preds = %0
  invoke void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %1)
          to label %6 unwind label %21

6:                                                ; preds = %5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %9 = load i32, ptr @M, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %10)
  %11 = load i32, ptr @M, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @l, i64 noundef %12)
  %13 = load i32, ptr @M, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @r, i64 noundef %14)
  %15 = load i32, ptr @M, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph101, label %.preheader96

.preheader96:                                     ; preds = %._crit_edge, %6
  %17 = load i32, ptr @N, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.preheader94.lr.ph, label %._crit_edge119

19:                                               ; preds = %0
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %23

21:                                               ; preds = %5
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  br label %23

23:                                               ; preds = %21, %19
  %.pn = phi { ptr, i32 } [ %22, %21 ], [ %20, %19 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn

.lr.ph101:                                        ; preds = %6, %._crit_edge
  %indvars.iv126 = phi i64 [ %indvars.iv.next127, %._crit_edge ], [ 0, %6 ]
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %indvars.iv126) #6
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @l, i64 noundef %indvars.iv126) #6
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @r, i64 noundef %indvars.iv126) #6
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @l, i64 noundef %indvars.iv126) #6
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = add nsw i32 %31, -1
  store i32 %32, ptr %30, align 4, !tbaa !5
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @r, i64 noundef %indvars.iv126) #6
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  store i32 %35, ptr %33, align 4, !tbaa !5
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @l, i64 noundef %indvars.iv126) #6
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @r, i64 noundef %indvars.iv126) #6
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %.not9097 = icmp sgt i32 %37, %39
  br i1 %.not9097, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph101
  %40 = sext i32 %37 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph101
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %41 = load i32, ptr @M, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = icmp slt i64 %indvars.iv.next127, %42
  br i1 %43, label %.lr.ph101, label %.preheader96, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %40, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @l, i64 noundef %indvars.iv126) #6
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @r, i64 noundef %indvars.iv126) #6
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %indvars.iv, i64 %46, i64 %49
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %indvars.iv126) #6
  %52 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %50, ptr noundef nonnull align 4 dereferenceable(4) %51)
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @r, i64 noundef %indvars.iv126) #6
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %.not90.not = icmp slt i64 %indvars.iv, %55
  br i1 %.not90.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.loopexit95:                                      ; preds = %._crit_edge104, %.preheader94.lr.ph
  %56 = phi i32 [ %63, %.preheader94.lr.ph ], [ %88, %._crit_edge104 ]
  %57 = sext i32 %56 to i64
  %58 = icmp slt i64 %indvars.iv.next130, %57
  br i1 %58, label %.preheader94.lr.ph, label %.preheader93, !llvm.loop !12

.preheader93:                                     ; preds = %.loopexit95
  %59 = icmp sgt i32 %56, 0
  br i1 %59, label %.preheader92.preheader, label %._crit_edge119

.preheader92.preheader:                           ; preds = %.preheader93
  %60 = add nsw i32 %56, -1
  %61 = zext nneg i32 %60 to i64
  %62 = zext nneg i32 %56 to i64
  br label %.preheader92

.preheader94.lr.ph:                               ; preds = %.preheader96, %.loopexit95
  %63 = phi i32 [ %56, %.loopexit95 ], [ %17, %.preheader96 ]
  %indvars.iv129 = phi i64 [ %indvars.iv.next130, %.loopexit95 ], [ 0, %.preheader96 ]
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %indvars.iv129, %64
  br i1 %65, label %.preheader94, label %.loopexit95

.preheader94:                                     ; preds = %.preheader94.lr.ph, %._crit_edge104
  %66 = phi i32 [ %88, %._crit_edge104 ], [ %63, %.preheader94.lr.ph ]
  %67 = phi i32 [ %89, %._crit_edge104 ], [ %63, %.preheader94.lr.ph ]
  %68 = phi i32 [ %90, %._crit_edge104 ], [ %63, %.preheader94.lr.ph ]
  %indvars.iv137 = phi i64 [ %indvars.iv.next138, %._crit_edge104 ], [ %indvars.iv129, %.preheader94.lr.ph ]
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %indvars.iv129, %69
  br i1 %70, label %.lr.ph103, label %._crit_edge104

.lr.ph103:                                        ; preds = %.preheader94
  %.not89 = icmp eq i64 %indvars.iv137, 0
  %71 = add i64 %indvars.iv137, 4294967295
  %72 = and i64 %71, 4294967295
  br i1 %.not89, label %.lr.ph103.split.us, label %.lr.ph103.split

.lr.ph103.split.us:                               ; preds = %.lr.ph103, %.lr.ph103.split.us._crit_edge
  %73 = phi i32 [ %84, %.lr.ph103.split.us._crit_edge ], [ %66, %.lr.ph103 ]
  %74 = phi i32 [ %85, %.lr.ph103.split.us._crit_edge ], [ %67, %.lr.ph103 ]
  %75 = phi i32 [ %85, %.lr.ph103.split.us._crit_edge ], [ %68, %.lr.ph103 ]
  %indvars.iv134 = phi i64 [ %79, %.lr.ph103.split.us._crit_edge ], [ %indvars.iv129, %.lr.ph103 ]
  %76 = add nsw i32 %75, -1
  %77 = sext i32 %76 to i64
  %78 = icmp slt i64 %indvars.iv134, %77
  %79 = add nuw nsw i64 %indvars.iv134, 1
  br i1 %78, label %80, label %.lr.ph103.split.us._crit_edge

80:                                               ; preds = %.lr.ph103.split.us
  %81 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %indvars.iv129, i64 0, i64 %79
  %82 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %indvars.iv129, i64 0, i64 %indvars.iv134
  %83 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %81, ptr noundef nonnull align 4 dereferenceable(4) %82)
  %.pre155 = load i32, ptr @N, align 4, !tbaa !5
  br label %.lr.ph103.split.us._crit_edge

.lr.ph103.split.us._crit_edge:                    ; preds = %.lr.ph103.split.us, %80
  %84 = phi i32 [ %.pre155, %80 ], [ %73, %.lr.ph103.split.us ]
  %85 = phi i32 [ %.pre155, %80 ], [ %74, %.lr.ph103.split.us ]
  %86 = trunc nuw i64 %79 to i32
  %87 = icmp sgt i32 %85, %86
  br i1 %87, label %.lr.ph103.split.us, label %._crit_edge104, !llvm.loop !13

._crit_edge104:                                   ; preds = %.lr.ph103.split._crit_edge, %.lr.ph103.split.us._crit_edge, %.preheader94
  %88 = phi i32 [ %66, %.preheader94 ], [ %84, %.lr.ph103.split.us._crit_edge ], [ %103, %.lr.ph103.split._crit_edge ]
  %89 = phi i32 [ %67, %.preheader94 ], [ %85, %.lr.ph103.split.us._crit_edge ], [ %103, %.lr.ph103.split._crit_edge ]
  %90 = phi i32 [ %68, %.preheader94 ], [ %85, %.lr.ph103.split.us._crit_edge ], [ %103, %.lr.ph103.split._crit_edge ]
  %indvars.iv.next138 = add nsw i64 %indvars.iv137, -1
  %91 = icmp sgt i64 %indvars.iv137, 0
  br i1 %91, label %.preheader94, label %.loopexit95, !llvm.loop !14

.lr.ph103.split:                                  ; preds = %.lr.ph103, %.lr.ph103.split._crit_edge
  %indvars.iv131 = phi i64 [ %99, %.lr.ph103.split._crit_edge ], [ %indvars.iv129, %.lr.ph103 ]
  %92 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %indvars.iv129, i64 %72, i64 %indvars.iv131
  %93 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %indvars.iv129, i64 %indvars.iv137, i64 %indvars.iv131
  %94 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %92, ptr noundef nonnull align 4 dereferenceable(4) %93)
  %95 = load i32, ptr @N, align 4, !tbaa !5
  %96 = add nsw i32 %95, -1
  %97 = sext i32 %96 to i64
  %98 = icmp slt i64 %indvars.iv131, %97
  %99 = add nuw nsw i64 %indvars.iv131, 1
  br i1 %98, label %100, label %.lr.ph103.split._crit_edge

100:                                              ; preds = %.lr.ph103.split
  %101 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %indvars.iv129, i64 %indvars.iv137, i64 %99
  %102 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %101, ptr noundef nonnull align 4 dereferenceable(4) %93)
  %.pre = load i32, ptr @N, align 4, !tbaa !5
  br label %.lr.ph103.split._crit_edge

.lr.ph103.split._crit_edge:                       ; preds = %.lr.ph103.split, %100
  %103 = phi i32 [ %.pre, %100 ], [ %95, %.lr.ph103.split ]
  %104 = trunc nuw i64 %99 to i32
  %105 = icmp sgt i32 %103, %104
  br i1 %105, label %.lr.ph103.split, label %._crit_edge104, !llvm.loop !13

.loopexit:                                        ; preds = %._crit_edge114, %.preheader92
  %106 = phi i32 [ %108, %.preheader92 ], [ %130, %._crit_edge114 ]
  %107 = icmp sgt i64 %indvars.iv152, 1
  %indvars.iv.next142 = add nsw i64 %indvars.iv141, -1
  br i1 %107, label %.preheader92, label %._crit_edge119, !llvm.loop !16

.preheader92:                                     ; preds = %.preheader92.preheader, %.loopexit
  %108 = phi i32 [ %56, %.preheader92.preheader ], [ %106, %.loopexit ]
  %indvars.iv152 = phi i64 [ %62, %.preheader92.preheader ], [ %indvars.iv.next153, %.loopexit ]
  %indvars.iv141 = phi i64 [ %61, %.preheader92.preheader ], [ %indvars.iv.next142, %.loopexit ]
  %indvars.iv.next153 = add nsw i64 %indvars.iv152, -1
  %109 = sext i32 %108 to i64
  %.not120 = icmp sgt i64 %indvars.iv152, %109
  br i1 %.not120, label %.loopexit, label %.preheader91

._crit_edge119:                                   ; preds = %.loopexit, %.preheader96, %.preheader93
  %110 = phi i32 [ %56, %.preheader93 ], [ %17, %.preheader96 ], [ %106, %.loopexit ]
  %111 = add nsw i32 %110, -1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [300 x i32], ptr @dp, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %114)
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %115, ptr noundef nonnull @.str.8)
  ret i32 0

.preheader91:                                     ; preds = %.preheader92, %._crit_edge114
  %indvars.iv149 = phi i64 [ %indvars.iv.next150, %._crit_edge114 ], [ %indvars.iv141, %.preheader92 ]
  %117 = trunc nuw i64 %indvars.iv149 to i32
  %sext = shl i64 %indvars.iv149, 32
  %118 = ashr exact i64 %sext, 32
  %.not121 = icmp sgt i64 %indvars.iv152, %118
  br i1 %.not121, label %.preheader, label %.lr.ph109

.lr.ph109:                                        ; preds = %.preheader91
  %119 = getelementptr inbounds [300 x [300 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next153, i64 %indvars.iv149
  br label %121

.preheader:                                       ; preds = %121, %.preheader91
  %.not110 = icmp sgt i64 %indvars.iv.next153, %118
  br i1 %.not110, label %._crit_edge114, label %.lr.ph113

.lr.ph113:                                        ; preds = %.preheader
  %120 = getelementptr inbounds [300 x [300 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next153, i64 %indvars.iv149
  br label %133

121:                                              ; preds = %.lr.ph109, %121
  %indvars.iv143 = phi i64 [ %indvars.iv141, %.lr.ph109 ], [ %indvars.iv.next144, %121 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %122 = getelementptr inbounds [300 x [300 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next153, i64 %indvars.iv143
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
  %124 = getelementptr inbounds [300 x [300 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next144, i64 %indvars.iv149
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = add nsw i32 %125, %123
  store i32 %126, ptr %3, align 4, !tbaa !5
  %127 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %119, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %128 = trunc nuw i64 %indvars.iv.next144 to i32
  %129 = icmp slt i32 %128, %117
  br i1 %129, label %121, label %.preheader, !llvm.loop !17

._crit_edge114:                                   ; preds = %155, %.preheader
  %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
  %130 = load i32, ptr @N, align 4, !tbaa !5
  %131 = trunc nuw i64 %indvars.iv.next150 to i32
  %132 = icmp sgt i32 %130, %131
  br i1 %132, label %.preheader91, label %.loopexit, !llvm.loop !18

133:                                              ; preds = %.lr.ph113, %155
  %indvars.iv146 = phi i64 [ %indvars.iv141, %.lr.ph113 ], [ %indvars.iv.next147, %155 ]
  %134 = getelementptr inbounds [300 x [300 x [300 x i32]]], ptr @mx, i64 0, i64 %indvars.iv146, i64 %indvars.iv.next153, i64 %indvars.iv149
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %.not87 = icmp eq i32 %135, 0
  br i1 %.not87, label %._crit_edge156, label %136

._crit_edge156:                                   ; preds = %133
  %.pre158 = trunc nuw i64 %indvars.iv146 to i32
  br label %155

136:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 %135, ptr %4, align 4, !tbaa !5
  %137 = trunc nuw i64 %indvars.iv146 to i32
  %sext160 = shl i64 %indvars.iv146, 32
  %138 = ashr exact i64 %sext160, 32
  %.not88 = icmp slt i64 %138, %indvars.iv152
  br i1 %.not88, label %145, label %139

139:                                              ; preds = %136
  %140 = add i64 %indvars.iv146, 4294967295
  %141 = and i64 %140, 4294967295
  %142 = getelementptr inbounds [300 x [300 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next153, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = add nsw i32 %143, %135
  store i32 %144, ptr %4, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %139, %136
  %146 = phi i32 [ %144, %139 ], [ %135, %136 ]
  %147 = icmp slt i32 %137, %117
  br i1 %147, label %148, label %153

148:                                              ; preds = %145
  %149 = add nuw nsw i64 %indvars.iv146, 1
  %150 = getelementptr inbounds [300 x [300 x i32]], ptr @dp, i64 0, i64 %149, i64 %indvars.iv149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = add nsw i32 %146, %151
  store i32 %152, ptr %4, align 4, !tbaa !5
  br label %153

153:                                              ; preds = %148, %145
  %154 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %120, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %155

155:                                              ; preds = %._crit_edge156, %153
  %.pre-phi = phi i32 [ %.pre158, %._crit_edge156 ], [ %137, %153 ]
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %.not.not = icmp slt i32 %.pre-phi, %117
  br i1 %.not.not, label %133, label %._crit_edge114, !llvm.loop !19
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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 nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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


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