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

; 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 }
%"struct.std::array" = type { [20 x %struct.mi] }
%struct.mi = type { i32 }
%"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 }
%"struct.std::array.3" = type { [20 x %"struct.std::array"] }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@Q = external dso_local global i32, align 4
@A = external dso_local global %"class.std::vector", align 8
@sto = external dso_local global [50005 x %"struct.std::array"], align 16
@isto = external dso_local global [50005 x %"struct.std::array"], align 16
@i2 = external dso_local global %struct.mi, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 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 uwtable
declare dso_local i32 @_Zpl2miS_(i32, i32) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2miC2Ex(ptr noundef nonnull align 4 dereferenceable(4), i64 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_Zmi2miS_(i32, i32) #0

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_Zml2miS_(i32, i32) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80), i64 noundef) #2 align 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) #4

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 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 %"struct.std::array.3", align 4
  %8 = alloca %"struct.std::array.3", align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.mi, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.mi, align 4
  %16 = alloca %struct.mi, align 4
  %17 = alloca %struct.mi, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %struct.mi, align 4
  %23 = alloca %struct.mi, align 4
  %24 = alloca %struct.mi, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %struct.mi, align 4
  %28 = alloca %struct.mi, align 4
  %29 = alloca %struct.mi, align 4
  %30 = alloca %struct.mi, align 4
  %31 = alloca %struct.mi, align 4
  %32 = alloca i32, align 4
  %33 = alloca %struct.mi, align 4
  %34 = alloca %struct.mi, align 4
  %35 = alloca %struct.mi, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca %struct.mi, align 4
  %40 = alloca i32, align 4
  %41 = alloca %struct.mi, align 4
  %42 = alloca %struct.mi, align 4
  %43 = alloca %struct.mi, align 4
  %44 = alloca %struct.mi, align 4
  %45 = alloca %struct.mi, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef @.str.10, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %46 unwind label %57

46:                                               ; preds = %0
  invoke void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %2)
          to label %47 unwind label %61

47:                                               ; preds = %46
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %50 = load i32, ptr @N, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %51)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %71, %47
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = load i32, ptr @N, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %66, label %56

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

57:                                               ; preds = %0
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %4, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %5, align 4
  br label %65

61:                                               ; preds = %46
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %4, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  br label %65

65:                                               ; preds = %61, %57
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  br label %361

66:                                               ; preds = %52
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %68) #7
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %69)
  br label %71

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

74:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 1600, ptr %7) #7
  call void @_ZNSt5arrayIS_I2miLm20EELm20EEC2Ev(ptr noundef nonnull align 4 dereferenceable(1600) %7)
  call void @llvm.lifetime.start.p0(i64 1600, ptr %8) #7
  call void @_ZNSt5arrayIS_I2miLm20EELm20EEC2Ev(ptr noundef nonnull align 4 dereferenceable(1600) %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %93, %74
  %76 = load i32, ptr %9, align 4, !tbaa !5
  %77 = load i32, ptr @K, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %96

80:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @_ZN2miC2Ex(ptr noundef nonnull align 4 dereferenceable(4) %10, i64 noundef 1)
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %8, i64 noundef %82) #7
  %84 = load i32, ptr %9, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %83, i64 noundef %85) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %86, ptr align 4 %10, i64 4, i1 false), !tbaa.struct !11
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %7, i64 noundef %88) #7
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %89, i64 noundef %91) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %92, ptr align 4 %86, i64 4, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %93

93:                                               ; preds = %80
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %9, align 4, !tbaa !5
  br label %75, !llvm.loop !12

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

97:                                               ; preds = %303, %96
  %98 = load i32, ptr %11, align 4, !tbaa !5
  %99 = load i32, ptr @N, align 4, !tbaa !5
  %100 = icmp sle i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 8, ptr %12, align 4
  br label %306

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %144, %102
  %104 = load i32, ptr %13, align 4, !tbaa !5
  %105 = load i32, ptr @K, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %103
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %147

108:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %109 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %109, ptr %14, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %140, %108
  %111 = load i32, ptr %14, align 4, !tbaa !5
  %112 = load i32, ptr @K, align 4, !tbaa !5
  %113 = icmp slt i32 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %110
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %143

115:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %116 = load i32, ptr %11, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [50005 x %"struct.std::array"], ptr @sto, i64 0, i64 %117
  %119 = load i32, ptr %13, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %118, i64 noundef %120) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %121, i64 4, i1 false), !tbaa.struct !11
  %122 = load i32, ptr %13, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %7, i64 noundef %123) #7
  %125 = load i32, ptr %14, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %124, i64 noundef %126) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %127, i64 4, i1 false), !tbaa.struct !11
  %128 = getelementptr inbounds %struct.mi, ptr %16, i32 0, i32 0
  %129 = load i32, ptr %128, align 4
  %130 = getelementptr inbounds %struct.mi, ptr %17, i32 0, i32 0
  %131 = load i32, ptr %130, align 4
  %132 = call i32 @_Zpl2miS_(i32 %129, i32 %131)
  %133 = getelementptr inbounds %struct.mi, ptr %15, i32 0, i32 0
  store i32 %132, ptr %133, align 4
  %134 = load i32, ptr %11, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [50005 x %"struct.std::array"], ptr @sto, i64 0, i64 %135
  %137 = load i32, ptr %13, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %136, i64 noundef %138) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %139, ptr align 4 %15, i64 4, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %140

140:                                              ; preds = %115
  %141 = load i32, ptr %14, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %14, align 4, !tbaa !5
  br label %110, !llvm.loop !13

143:                                              ; preds = %114
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %13, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %13, align 4, !tbaa !5
  br label %103, !llvm.loop !14

147:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %164, %147
  %149 = load i32, ptr %18, align 4, !tbaa !5
  %150 = load i32, ptr @K, align 4, !tbaa !5
  %151 = icmp slt i32 %149, %150
  br i1 %151, label %153, label %152

152:                                              ; preds = %148
  store i32 17, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %167

153:                                              ; preds = %148
  %154 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %8, i64 noundef 0) #7
  %155 = load i32, ptr %18, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %154, i64 noundef %156) #7
  %158 = load i32, ptr %11, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [50005 x %"struct.std::array"], ptr @isto, i64 0, i64 %159
  %161 = load i32, ptr %18, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %160, i64 noundef %162) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %163, ptr align 4 %157, i64 4, i1 false), !tbaa.struct !11
  br label %164

164:                                              ; preds = %153
  %165 = load i32, ptr %18, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %18, align 4, !tbaa !5
  br label %148, !llvm.loop !15

167:                                              ; preds = %152
  %168 = load i32, ptr %11, align 4, !tbaa !5
  %169 = load i32, ptr @N, align 4, !tbaa !5
  %170 = icmp eq i32 %168, %169
  br i1 %170, label %171, label %172

171:                                              ; preds = %167
  store i32 8, ptr %12, align 4
  br label %306

172:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %173 = load i32, ptr %11, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %174) #7
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = sub nsw i32 %176, 1
  store i32 %177, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %178

178:                                              ; preds = %219, %172
  %179 = load i32, ptr %20, align 4, !tbaa !5
  %180 = load i32, ptr %19, align 4, !tbaa !5
  %181 = icmp sle i32 %179, %180
  br i1 %181, label %183, label %182

182:                                              ; preds = %178
  store i32 20, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %222

183:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %184 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %184, ptr %21, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %215, %183
  %186 = load i32, ptr %21, align 4, !tbaa !5
  %187 = load i32, ptr %20, align 4, !tbaa !5
  %188 = icmp sge i32 %186, %187
  br i1 %188, label %190, label %189

189:                                              ; preds = %185
  store i32 23, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %218

190:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %191 = load i32, ptr %20, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %7, i64 noundef %192) #7
  %194 = load i32, ptr %19, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %193, i64 noundef %195) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %196, i64 4, i1 false), !tbaa.struct !11
  %197 = load i32, ptr %20, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %7, i64 noundef %198) #7
  %200 = load i32, ptr %21, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %199, i64 noundef %201) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %202, i64 4, i1 false), !tbaa.struct !11
  %203 = getelementptr inbounds %struct.mi, ptr %23, i32 0, i32 0
  %204 = load i32, ptr %203, align 4
  %205 = getelementptr inbounds %struct.mi, ptr %24, i32 0, i32 0
  %206 = load i32, ptr %205, align 4
  %207 = call i32 @_Zpl2miS_(i32 %204, i32 %206)
  %208 = getelementptr inbounds %struct.mi, ptr %22, i32 0, i32 0
  store i32 %207, ptr %208, align 4
  %209 = load i32, ptr %20, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %7, i64 noundef %210) #7
  %212 = load i32, ptr %19, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %211, i64 noundef %213) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %214, ptr align 4 %22, i64 4, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %215

215:                                              ; preds = %190
  %216 = load i32, ptr %21, align 4, !tbaa !5
  %217 = add nsw i32 %216, -1
  store i32 %217, ptr %21, align 4, !tbaa !5
  br label %185, !llvm.loop !16

218:                                              ; preds = %189
  br label %219

219:                                              ; preds = %218
  %220 = load i32, ptr %20, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %20, align 4, !tbaa !5
  br label %178, !llvm.loop !17

222:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %270, %222
  %224 = load i32, ptr %25, align 4, !tbaa !5
  %225 = load i32, ptr %19, align 4, !tbaa !5
  %226 = icmp slt i32 %224, %225
  br i1 %226, label %228, label %227

227:                                              ; preds = %223
  store i32 26, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %273

228:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %229 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %229, ptr %26, align 4, !tbaa !5
  br label %230

230:                                              ; preds = %266, %228
  %231 = load i32, ptr %26, align 4, !tbaa !5
  %232 = load i32, ptr @K, align 4, !tbaa !5
  %233 = icmp slt i32 %231, %232
  br i1 %233, label %235, label %234

234:                                              ; preds = %230
  store i32 29, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %269

235:                                              ; preds = %230
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %236 = load i32, ptr %25, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %8, i64 noundef %237) #7
  %239 = load i32, ptr %26, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %238, i64 noundef %240) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %241, i64 4, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 @i2, i64 4, i1 false), !tbaa.struct !11
  %242 = load i32, ptr %19, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %8, i64 noundef %243) #7
  %245 = load i32, ptr %26, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %244, i64 noundef %246) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %247, i64 4, i1 false), !tbaa.struct !11
  %248 = getelementptr inbounds %struct.mi, ptr %30, i32 0, i32 0
  %249 = load i32, ptr %248, align 4
  %250 = getelementptr inbounds %struct.mi, ptr %31, i32 0, i32 0
  %251 = load i32, ptr %250, align 4
  %252 = call i32 @_Zml2miS_(i32 %249, i32 %251)
  %253 = getelementptr inbounds %struct.mi, ptr %29, i32 0, i32 0
  store i32 %252, ptr %253, align 4
  %254 = getelementptr inbounds %struct.mi, ptr %28, i32 0, i32 0
  %255 = load i32, ptr %254, align 4
  %256 = getelementptr inbounds %struct.mi, ptr %29, i32 0, i32 0
  %257 = load i32, ptr %256, align 4
  %258 = call i32 @_Zmi2miS_(i32 %255, i32 %257)
  %259 = getelementptr inbounds %struct.mi, ptr %27, i32 0, i32 0
  store i32 %258, ptr %259, align 4
  %260 = load i32, ptr %25, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %8, i64 noundef %261) #7
  %263 = load i32, ptr %26, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %262, i64 noundef %264) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %265, ptr align 4 %27, i64 4, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %266

266:                                              ; preds = %235
  %267 = load i32, ptr %26, align 4, !tbaa !5
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %26, align 4, !tbaa !5
  br label %230, !llvm.loop !18

269:                                              ; preds = %234
  br label %270

270:                                              ; preds = %269
  %271 = load i32, ptr %25, align 4, !tbaa !5
  %272 = add nsw i32 %271, 1
  store i32 %272, ptr %25, align 4, !tbaa !5
  br label %223, !llvm.loop !19

273:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  %274 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %274, ptr %32, align 4, !tbaa !5
  br label %275

275:                                              ; preds = %299, %273
  %276 = load i32, ptr %32, align 4, !tbaa !5
  %277 = load i32, ptr @K, align 4, !tbaa !5
  %278 = icmp slt i32 %276, %277
  br i1 %278, label %280, label %279

279:                                              ; preds = %275
  store i32 32, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  br label %302

280:                                              ; preds = %275
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  %281 = load i32, ptr %19, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %8, i64 noundef %282) #7
  %284 = load i32, ptr %32, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %283, i64 noundef %285) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 4 %286, i64 4, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 @i2, i64 4, i1 false), !tbaa.struct !11
  %287 = getelementptr inbounds %struct.mi, ptr %34, i32 0, i32 0
  %288 = load i32, ptr %287, align 4
  %289 = getelementptr inbounds %struct.mi, ptr %35, i32 0, i32 0
  %290 = load i32, ptr %289, align 4
  %291 = call i32 @_Zml2miS_(i32 %288, i32 %290)
  %292 = getelementptr inbounds %struct.mi, ptr %33, i32 0, i32 0
  store i32 %291, ptr %292, align 4
  %293 = load i32, ptr %19, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %8, i64 noundef %294) #7
  %296 = load i32, ptr %32, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %295, i64 noundef %297) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %298, ptr align 4 %33, i64 4, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %299

299:                                              ; preds = %280
  %300 = load i32, ptr %32, align 4, !tbaa !5
  %301 = add nsw i32 %300, 1
  store i32 %301, ptr %32, align 4, !tbaa !5
  br label %275, !llvm.loop !20

302:                                              ; preds = %279
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %303

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

306:                                              ; preds = %171, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %307

307:                                              ; preds = %306
  %308 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  store i32 0, ptr %36, align 4, !tbaa !5
  br label %309

309:                                              ; preds = %356, %307
  %310 = load i32, ptr %36, align 4, !tbaa !5
  %311 = load i32, ptr @Q, align 4, !tbaa !5
  %312 = icmp slt i32 %310, %311
  br i1 %312, label %314, label %313

313:                                              ; preds = %309
  store i32 35, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  br label %359

314:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #7
  %315 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %37)
  %316 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %315, ptr noundef nonnull align 4 dereferenceable(4) %38)
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #7
  call void @_ZN2miC2Ex(ptr noundef nonnull align 4 dereferenceable(4) %39, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #7
  store i32 0, ptr %40, align 4, !tbaa !5
  br label %317

317:                                              ; preds = %348, %314
  %318 = load i32, ptr %40, align 4, !tbaa !5
  %319 = load i32, ptr @K, align 4, !tbaa !5
  %320 = icmp slt i32 %318, %319
  br i1 %320, label %322, label %321

321:                                              ; preds = %317
  store i32 38, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #7
  br label %351

322:                                              ; preds = %317
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %42, ptr align 4 %39, i64 4, i1 false), !tbaa.struct !11
  %323 = load i32, ptr %37, align 4, !tbaa !5
  %324 = sub nsw i32 %323, 1
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [50005 x %"struct.std::array"], ptr @isto, i64 0, i64 %325
  %327 = load i32, ptr %40, align 4, !tbaa !5
  %328 = sext i32 %327 to i64
  %329 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %326, i64 noundef %328) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %44, ptr align 4 %329, i64 4, i1 false), !tbaa.struct !11
  %330 = load i32, ptr %38, align 4, !tbaa !5
  %331 = sext i32 %330 to i64
  %332 = getelementptr inbounds [50005 x %"struct.std::array"], ptr @sto, i64 0, i64 %331
  %333 = load i32, ptr %40, align 4, !tbaa !5
  %334 = sext i32 %333 to i64
  %335 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %332, i64 noundef %334) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %45, ptr align 4 %335, i64 4, i1 false), !tbaa.struct !11
  %336 = getelementptr inbounds %struct.mi, ptr %44, i32 0, i32 0
  %337 = load i32, ptr %336, align 4
  %338 = getelementptr inbounds %struct.mi, ptr %45, i32 0, i32 0
  %339 = load i32, ptr %338, align 4
  %340 = call i32 @_Zml2miS_(i32 %337, i32 %339)
  %341 = getelementptr inbounds %struct.mi, ptr %43, i32 0, i32 0
  store i32 %340, ptr %341, align 4
  %342 = getelementptr inbounds %struct.mi, ptr %42, i32 0, i32 0
  %343 = load i32, ptr %342, align 4
  %344 = getelementptr inbounds %struct.mi, ptr %43, i32 0, i32 0
  %345 = load i32, ptr %344, align 4
  %346 = call i32 @_Zpl2miS_(i32 %343, i32 %345)
  %347 = getelementptr inbounds %struct.mi, ptr %41, i32 0, i32 0
  store i32 %346, ptr %347, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %39, ptr align 4 %41, i64 4, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #7
  br label %348

348:                                              ; preds = %322
  %349 = load i32, ptr %40, align 4, !tbaa !5
  %350 = add nsw i32 %349, 1
  store i32 %350, ptr %40, align 4, !tbaa !5
  br label %317, !llvm.loop !22

351:                                              ; preds = %321
  %352 = getelementptr inbounds %struct.mi, ptr %39, i32 0, i32 0
  %353 = load i32, ptr %352, align 4, !tbaa !23
  %354 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %353)
  %355 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %354, ptr noundef @.str.8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  br label %356

356:                                              ; preds = %351
  %357 = load i32, ptr %36, align 4, !tbaa !5
  %358 = add nsw i32 %357, 1
  store i32 %358, ptr %36, align 4, !tbaa !5
  br label %309, !llvm.loop !25

359:                                              ; preds = %313
  call void @llvm.lifetime.end.p0(i64 1600, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 1600, ptr %7) #7
  %360 = load i32, ptr %1, align 4
  ret i32 %360

361:                                              ; preds = %65
  %362 = load ptr, ptr %4, align 8
  %363 = load i32, ptr %5, align 4
  %364 = insertvalue { ptr, i32 } poison, ptr %362, 0
  %365 = insertvalue { ptr, i32 } %364, i32 %363, 1
  resume { ptr, i32 } %365
}

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

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt5arrayIS_I2miLm20EELm20EEC2Ev(ptr noundef nonnull align 4 dereferenceable(1600)) unnamed_addr #4 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; 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 = { "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 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 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{i64 0, i64 4, !5}
!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}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = !{!24, !6, i64 0}
!24 = !{!"_ZTS2mi", !6, i64 0}
!25 = distinct !{!25, !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 }
%"struct.std::array" = type { [20 x %struct.mi] }
%struct.mi = type { i32 }
%"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 }
%"struct.std::array.3" = type { [20 x %"struct.std::array"] }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@Q = external dso_local global i32, align 4
@A = external dso_local global %"class.std::vector", align 8
@sto = external dso_local global [50005 x %"struct.std::array"], align 16
@isto = external dso_local global [50005 x %"struct.std::array"], align 16
@i2 = external dso_local local_unnamed_addr global %struct.mi, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 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 uwtable
declare dso_local i32 @_Zpl2miS_(i32, i32) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2miC2Ex(ptr noundef nonnull align 4 dereferenceable(4), i64 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_Zmi2miS_(i32, i32) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_Zml2miS_(i32, i32) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80), i64 noundef) local_unnamed_addr #2 align 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 #4

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca %"struct.std::array.3", align 4
  %4 = alloca %"struct.std::array.3", align 4
  %5 = alloca %struct.mi, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.mi, 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.10, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %9 unwind label %19

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

10:                                               ; preds = %9
  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
  %11 = 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)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %13 = load i32, ptr @N, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %14)
  %15 = load i32, ptr @N, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %10
  call void @llvm.lifetime.start.p0(i64 1600, ptr nonnull %3) #6
  call void @_ZNSt5arrayIS_I2miLm20EELm20EEC2Ev(ptr noundef nonnull align 4 dereferenceable(1600) %3)
  call void @llvm.lifetime.start.p0(i64 1600, ptr nonnull %4) #6
  call void @_ZNSt5arrayIS_I2miLm20EELm20EEC2Ev(ptr noundef nonnull align 4 dereferenceable(1600) %4)
  %17 = load i32, ptr @K, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph115, label %.preheader111

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

21:                                               ; preds = %9
  %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.ph:                                           ; preds = %10, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %10 ]
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %indvars.iv) #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)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i32, ptr @N, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader111:                                    ; preds = %.lr.ph115, %._crit_edge
  %29 = phi i32 [ %17, %._crit_edge ], [ %37, %.lr.ph115 ]
  %30 = load i32, ptr @N, align 4, !tbaa !5
  %.not136 = icmp slt i32 %30, 0
  br i1 %.not136, label %._crit_edge138, label %.preheader110

.lr.ph115:                                        ; preds = %._crit_edge, %.lr.ph115
  %indvars.iv153 = phi i64 [ %indvars.iv.next154, %.lr.ph115 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @_ZN2miC2Ex(ptr noundef nonnull align 4 dereferenceable(4) %5, i64 noundef 1)
  %31 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %4, i64 noundef %indvars.iv153) #6
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %31, i64 noundef %indvars.iv153) #6
  %33 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %33, ptr %32, align 4, !tbaa !5
  %34 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %3, i64 noundef %indvars.iv153) #6
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %34, i64 noundef %indvars.iv153) #6
  %36 = load i32, ptr %32, align 4, !tbaa !5
  store i32 %36, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1
  %37 = load i32, ptr @K, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = icmp slt i64 %indvars.iv.next154, %38
  br i1 %39, label %.lr.ph115, label %.preheader111, !llvm.loop !11

.preheader110:                                    ; preds = %.preheader111, %._crit_edge135
  %40 = phi i32 [ %99, %._crit_edge135 ], [ %29, %.preheader111 ]
  %indvars.iv182 = phi i64 [ %indvars.iv.next183, %._crit_edge135 ], [ 0, %.preheader111 ]
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.preheader106.lr.ph, label %._crit_edge122

.preheader106.lr.ph:                              ; preds = %.preheader110
  %42 = getelementptr inbounds [50005 x %"struct.std::array"], ptr @sto, i64 0, i64 %indvars.iv182
  br label %.preheader106

.preheader109:                                    ; preds = %._crit_edge118
  %43 = icmp sgt i32 %48, 0
  br i1 %43, label %.lr.ph121, label %._crit_edge122

.lr.ph121:                                        ; preds = %.preheader109
  %44 = getelementptr inbounds [50005 x %"struct.std::array"], ptr @isto, i64 0, i64 %indvars.iv182
  br label %61

.preheader106:                                    ; preds = %.preheader106.lr.ph, %._crit_edge118
  %45 = phi i32 [ %40, %.preheader106.lr.ph ], [ %48, %._crit_edge118 ]
  %indvars.iv156 = phi i64 [ 0, %.preheader106.lr.ph ], [ %indvars.iv.next157, %._crit_edge118 ]
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv156, %46
  br i1 %47, label %.lr.ph117, label %._crit_edge118

._crit_edge118.loopexit:                          ; preds = %.lr.ph117
  %.pre190 = sext i32 %55 to i64
  br label %._crit_edge118

._crit_edge118:                                   ; preds = %._crit_edge118.loopexit, %.preheader106
  %.pre-phi = phi i64 [ %.pre190, %._crit_edge118.loopexit ], [ %46, %.preheader106 ]
  %48 = phi i32 [ %55, %._crit_edge118.loopexit ], [ %45, %.preheader106 ]
  %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1
  %49 = icmp slt i64 %indvars.iv.next157, %.pre-phi
  br i1 %49, label %.preheader106, label %.preheader109, !llvm.loop !12

.lr.ph117:                                        ; preds = %.preheader106, %.lr.ph117
  %indvars.iv158 = phi i64 [ %indvars.iv.next159, %.lr.ph117 ], [ %indvars.iv156, %.preheader106 ]
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %42, i64 noundef %indvars.iv156) #6
  %.sroa.058.0.copyload = load i32, ptr %50, align 4, !tbaa !5
  %51 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %3, i64 noundef %indvars.iv156) #6
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %51, i64 noundef %indvars.iv158) #6
  %.sroa.057.0.copyload = load i32, ptr %52, align 4, !tbaa !5
  %53 = call i32 @_Zpl2miS_(i32 %.sroa.058.0.copyload, i32 %.sroa.057.0.copyload)
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %42, i64 noundef %indvars.iv156) #6
  store i32 %53, ptr %54, align 4, !tbaa !5
  %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
  %55 = load i32, ptr @K, align 4, !tbaa !5
  %56 = trunc nuw i64 %indvars.iv.next159 to i32
  %57 = icmp sgt i32 %55, %56
  br i1 %57, label %.lr.ph117, label %._crit_edge118.loopexit, !llvm.loop !13

._crit_edge122:                                   ; preds = %61, %.preheader110, %.preheader109
  %58 = load i32, ptr @N, align 4, !tbaa !5
  %59 = zext i32 %58 to i64
  %60 = icmp eq i64 %indvars.iv182, %59
  br i1 %60, label %._crit_edge138, label %69

61:                                               ; preds = %.lr.ph121, %61
  %indvars.iv162 = phi i64 [ 0, %.lr.ph121 ], [ %indvars.iv.next163, %61 ]
  %62 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %4, i64 noundef 0) #6
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %62, i64 noundef %indvars.iv162) #6
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %44, i64 noundef %indvars.iv162) #6
  %65 = load i32, ptr %63, align 4, !tbaa !5
  store i32 %65, ptr %64, align 4, !tbaa !5
  %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
  %66 = load i32, ptr @K, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = icmp slt i64 %indvars.iv.next163, %67
  br i1 %68, label %61, label %._crit_edge122, !llvm.loop !14

69:                                               ; preds = %._crit_edge122
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @A, i64 noundef %indvars.iv182) #6
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = add i32 %71, -1
  %.not103.not127 = icmp sgt i32 %71, 0
  br i1 %.not103.not127, label %.preheader105.lr.ph, label %.preheader108.thread

.preheader108.thread:                             ; preds = %69
  %.pre191 = load i32, ptr @K, align 4, !tbaa !5
  br label %.preheader107

.preheader105.lr.ph:                              ; preds = %69
  %73 = zext nneg i32 %72 to i64
  %74 = zext nneg i32 %71 to i64
  %wide.trip.count = zext nneg i32 %71 to i64
  br label %.lr.ph125

.preheader108:                                    ; preds = %._crit_edge126
  %.not = icmp eq i32 %71, 1
  %.pre = load i32, ptr @K, align 4, !tbaa !5
  br i1 %.not, label %.preheader107, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader108
  %75 = zext nneg i32 %72 to i64
  %.not148 = icmp sgt i32 %71, %.pre
  br i1 %.not148, label %.preheader107, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %wide.trip.count177 = zext nneg i32 %72 to i64
  br label %.preheader

.lr.ph125:                                        ; preds = %._crit_edge126, %.preheader105.lr.ph
  %indvars.iv168 = phi i64 [ 0, %.preheader105.lr.ph ], [ %indvars.iv.next169, %._crit_edge126 ]
  br label %76

._crit_edge126:                                   ; preds = %76
  %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next169, %wide.trip.count
  br i1 %exitcond.not, label %.preheader108, label %.lr.ph125, !llvm.loop !15

76:                                               ; preds = %.lr.ph125, %76
  %indvars.iv165.in = phi i64 [ %74, %.lr.ph125 ], [ %indvars.iv165, %76 ]
  %indvars.iv165 = add nsw i64 %indvars.iv165.in, -1
  %77 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %3, i64 noundef %indvars.iv168) #6
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %77, i64 noundef %73) #6
  %.sroa.032.0.copyload = load i32, ptr %78, align 4, !tbaa !5
  %79 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %3, i64 noundef %indvars.iv168) #6
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %79, i64 noundef %indvars.iv165) #6
  %.sroa.031.0.copyload = load i32, ptr %80, align 4, !tbaa !5
  %81 = call i32 @_Zpl2miS_(i32 %.sroa.032.0.copyload, i32 %.sroa.031.0.copyload)
  %82 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %3, i64 noundef %indvars.iv168) #6
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %82, i64 noundef %73) #6
  store i32 %81, ptr %83, align 4, !tbaa !5
  %.not104.not = icmp sgt i64 %indvars.iv165, %indvars.iv168
  br i1 %.not104.not, label %76, label %._crit_edge126, !llvm.loop !16

.preheader107:                                    ; preds = %._crit_edge131, %.preheader.lr.ph, %.preheader108.thread, %.preheader108
  %84 = phi i32 [ %.pre, %.preheader108 ], [ %.pre191, %.preheader108.thread ], [ %.pre, %.preheader.lr.ph ], [ %87, %._crit_edge131 ]
  %.not150 = icmp sgt i32 %71, %84
  br i1 %.not150, label %._crit_edge135, label %.lr.ph134

.lr.ph134:                                        ; preds = %.preheader107
  %85 = sext i32 %72 to i64
  br label %102

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge131
  %86 = phi i32 [ %.pre, %.preheader.preheader ], [ %87, %._crit_edge131 ]
  %indvars.iv174 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next175, %._crit_edge131 ]
  %.not149 = icmp sgt i32 %71, %86
  br i1 %.not149, label %._crit_edge131, label %.lr.ph130

._crit_edge131:                                   ; preds = %.lr.ph130, %.preheader
  %87 = phi i32 [ %86, %.preheader ], [ %96, %.lr.ph130 ]
  %indvars.iv.next175 = add nuw nsw i64 %indvars.iv174, 1
  %exitcond178.not = icmp eq i64 %indvars.iv.next175, %wide.trip.count177
  br i1 %exitcond178.not, label %.preheader107, label %.preheader, !llvm.loop !17

.lr.ph130:                                        ; preds = %.preheader, %.lr.ph130
  %indvars.iv171 = phi i64 [ %indvars.iv.next172, %.lr.ph130 ], [ %75, %.preheader ]
  %88 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %4, i64 noundef %indvars.iv174) #6
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %88, i64 noundef %indvars.iv171) #6
  %.sroa.020.0.copyload = load i32, ptr %89, align 4, !tbaa !5
  %.sroa.018.0.copyload = load i32, ptr @i2, align 4, !tbaa !5
  %90 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %4, i64 noundef %75) #6
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %90, i64 noundef %indvars.iv171) #6
  %.sroa.017.0.copyload = load i32, ptr %91, align 4, !tbaa !5
  %92 = call i32 @_Zml2miS_(i32 %.sroa.018.0.copyload, i32 %.sroa.017.0.copyload)
  %93 = call i32 @_Zmi2miS_(i32 %.sroa.020.0.copyload, i32 %92)
  %94 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %4, i64 noundef %indvars.iv174) #6
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %94, i64 noundef %indvars.iv171) #6
  store i32 %93, ptr %95, align 4, !tbaa !5
  %indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
  %96 = load i32, ptr @K, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = icmp slt i64 %indvars.iv.next172, %97
  br i1 %98, label %.lr.ph130, label %._crit_edge131, !llvm.loop !19

._crit_edge135:                                   ; preds = %102, %.preheader107
  %99 = phi i32 [ %84, %.preheader107 ], [ %108, %102 ]
  %indvars.iv.next183 = add nuw nsw i64 %indvars.iv182, 1
  %100 = load i32, ptr @N, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %.not.not = icmp slt i64 %indvars.iv182, %101
  br i1 %.not.not, label %.preheader110, label %._crit_edge138, !llvm.loop !20

102:                                              ; preds = %.lr.ph134, %102
  %indvars.iv179 = phi i64 [ %85, %.lr.ph134 ], [ %indvars.iv.next180, %102 ]
  %103 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %4, i64 noundef %85) #6
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %103, i64 noundef %indvars.iv179) #6
  %.sroa.011.0.copyload = load i32, ptr %104, align 4, !tbaa !5
  %.sroa.010.0.copyload = load i32, ptr @i2, align 4, !tbaa !5
  %105 = call i32 @_Zml2miS_(i32 %.sroa.011.0.copyload, i32 %.sroa.010.0.copyload)
  %106 = call noundef nonnull align 4 dereferenceable(80) ptr @_ZNSt5arrayIS_I2miLm20EELm20EEixEm(ptr noundef nonnull align 4 dereferenceable(1600) %4, i64 noundef %85) #6
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %106, i64 noundef %indvars.iv179) #6
  store i32 %105, ptr %107, align 4, !tbaa !5
  %indvars.iv.next180 = add nsw i64 %indvars.iv179, 1
  %108 = load i32, ptr @K, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = icmp slt i64 %indvars.iv.next180, %109
  br i1 %110, label %102, label %._crit_edge135, !llvm.loop !21

._crit_edge138:                                   ; preds = %._crit_edge135, %._crit_edge122, %.preheader111
  %111 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  %112 = load i32, ptr @Q, align 4, !tbaa !5
  %113 = icmp sgt i32 %112, 0
  br i1 %113, label %.lr.ph146, label %._crit_edge147

._crit_edge147:                                   ; preds = %._crit_edge143, %._crit_edge138
  call void @llvm.lifetime.end.p0(i64 1600, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 1600, ptr nonnull %3) #6
  ret i32 0

.lr.ph146:                                        ; preds = %._crit_edge138, %._crit_edge143
  %.092144 = phi i32 [ %121, %._crit_edge143 ], [ 0, %._crit_edge138 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %114 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %115 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %114, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  call void @_ZN2miC2Ex(ptr noundef nonnull align 4 dereferenceable(4) %8, i64 noundef 0)
  %116 = load i32, ptr @K, align 4, !tbaa !5
  %117 = icmp sgt i32 %116, 0
  %.pre189 = load i32, ptr %8, align 4, !tbaa !5
  br i1 %117, label %.lr.ph142, label %._crit_edge143

._crit_edge143:                                   ; preds = %.lr.ph142, %.lr.ph146
  %118 = phi i32 [ %.pre189, %.lr.ph146 ], [ %134, %.lr.ph142 ]
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %118)
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %119, ptr noundef nonnull @.str.8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %121 = add nuw nsw i32 %.092144, 1
  %122 = load i32, ptr @Q, align 4, !tbaa !5
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %.lr.ph146, label %._crit_edge147, !llvm.loop !22

.lr.ph142:                                        ; preds = %.lr.ph146, %.lr.ph142
  %.sroa.03.0.copyload = phi i32 [ %134, %.lr.ph142 ], [ %.pre189, %.lr.ph146 ]
  %indvars.iv185 = phi i64 [ %indvars.iv.next186, %.lr.ph142 ], [ 0, %.lr.ph146 ]
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = add nsw i32 %124, -1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [50005 x %"struct.std::array"], ptr @isto, i64 0, i64 %126
  %128 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %127, i64 noundef %indvars.iv185) #6
  %.sroa.01.0.copyload = load i32, ptr %128, align 4, !tbaa !5
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [50005 x %"struct.std::array"], ptr @sto, i64 0, i64 %130
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI2miLm20EEixEm(ptr noundef nonnull align 4 dereferenceable(80) %131, i64 noundef %indvars.iv185) #6
  %.sroa.0.0.copyload = load i32, ptr %132, align 4, !tbaa !5
  %133 = call i32 @_Zml2miS_(i32 %.sroa.01.0.copyload, i32 %.sroa.0.0.copyload)
  %134 = call i32 @_Zpl2miS_(i32 %.sroa.03.0.copyload, i32 %133)
  store i32 %134, ptr %8, align 4, !tbaa !5
  %indvars.iv.next186 = add nuw nsw i64 %indvars.iv185, 1
  %135 = load i32, ptr @K, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = icmp slt i64 %indvars.iv.next186, %136
  br i1 %137, label %.lr.ph142, label %._crit_edge143, !llvm.loop !23
}

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

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt5arrayIS_I2miLm20EELm20EEC2Ev(ptr noundef nonnull align 4 dereferenceable(1600)) unnamed_addr #4 align 2

; 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 = { "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 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 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 #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}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}


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