; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2017.01 (hps)

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

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

@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@dp = external dso_local global [100000 x [22 x [3 x i32]]], align 16
@fj = external dso_local global [100000 x i32], align 16
@mp = external dso_local global [128 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i8, align 1
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = load ptr, ptr @stdin, align 8, !tbaa !5
  %16 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %15)
  %17 = load ptr, ptr @stdout, align 8, !tbaa !5
  %18 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %17)
  %19 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %20 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !9
  %21 = getelementptr i8, ptr %20, i64 -24
  %22 = load i64, ptr %21, align 8
  %23 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %22
  %24 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %23, ptr noundef null)
  store i32 0, ptr getelementptr inbounds ([128 x i32], ptr @mp, i64 0, i64 72), align 16, !tbaa !11
  store i32 1, ptr getelementptr inbounds ([128 x i32], ptr @mp, i64 0, i64 80), align 16, !tbaa !11
  store i32 2, ptr getelementptr inbounds ([128 x i32], ptr @mp, i64 0, i64 83), align 4, !tbaa !11
  %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) @N)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) @K)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !11
  br label %27

27:                                               ; preds = %43, %0
  %28 = load i32, ptr %2, align 4, !tbaa !11
  %29 = load i32, ptr @N, align 4, !tbaa !11
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %46

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %3)
  %34 = load i8, ptr %3, align 1, !tbaa !13
  %35 = sext i8 %34 to i64
  %36 = getelementptr inbounds [128 x i32], ptr @mp, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !11
  %38 = add nsw i32 %37, 1
  %39 = srem i32 %38, 3
  %40 = load i32, ptr %2, align 4, !tbaa !11
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100000 x i32], ptr @fj, i64 0, i64 %41
  store i32 %39, ptr %42, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  br label %43

43:                                               ; preds = %32
  %44 = load i32, ptr %2, align 4, !tbaa !11
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %2, align 4, !tbaa !11
  br label %27, !llvm.loop !14

46:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 -1, ptr %4, align 4, !tbaa !11
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @dp, ptr noundef getelementptr inbounds (i32, ptr getelementptr inbounds ([22 x [3 x i32]], ptr getelementptr inbounds ([100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 99999), i64 0, i64 21), i64 3), ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  store i32 0, ptr getelementptr inbounds ([3 x i32], ptr @dp, i64 0, i64 2), align 8, !tbaa !11
  store i32 0, ptr getelementptr inbounds ([3 x i32], ptr @dp, i64 0, i64 1), align 4, !tbaa !11
  store i32 0, ptr @dp, align 16, !tbaa !11
  %47 = load i32, ptr @fj, align 16, !tbaa !11
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [3 x i32], ptr @dp, i64 0, i64 %48
  store i32 1, ptr %49, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !11
  br label %50

50:                                               ; preds = %187, %46
  %51 = load i32, ptr %5, align 4, !tbaa !11
  %52 = load i32, ptr @N, align 4, !tbaa !11
  %53 = sub nsw i32 %52, 1
  %54 = icmp slt i32 %51, %53
  br i1 %54, label %56, label %55

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

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

57:                                               ; preds = %183, %56
  %58 = load i32, ptr %7, align 4, !tbaa !11
  %59 = load i32, ptr @K, align 4, !tbaa !11
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %63

63:                                               ; preds = %179, %62
  %64 = load i32, ptr %8, align 4, !tbaa !11
  %65 = icmp slt i32 %64, 3
  br i1 %65, label %67, label %66

66:                                               ; preds = %63
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %182

67:                                               ; preds = %63
  %68 = load i32, ptr %5, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %69
  %71 = load i32, ptr %7, align 4, !tbaa !11
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [22 x [3 x i32]], ptr %70, i64 0, i64 %72
  %74 = load i32, ptr %8, align 4, !tbaa !11
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [3 x i32], ptr %73, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !11
  %78 = icmp sge i32 %77, 0
  br i1 %78, label %79, label %178

79:                                               ; preds = %67
  %80 = load i32, ptr %5, align 4, !tbaa !11
  %81 = add nsw i32 %80, 1
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %82
  %84 = load i32, ptr %7, align 4, !tbaa !11
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [22 x [3 x i32]], ptr %83, i64 0, i64 %85
  %87 = load i32, ptr %8, align 4, !tbaa !11
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [3 x i32], ptr %86, i64 0, i64 %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %90 = load i32, ptr %5, align 4, !tbaa !11
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %91
  %93 = load i32, ptr %7, align 4, !tbaa !11
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [22 x [3 x i32]], ptr %92, i64 0, i64 %94
  %96 = load i32, ptr %8, align 4, !tbaa !11
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [3 x i32], ptr %95, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !11
  %100 = load i32, ptr %5, align 4, !tbaa !11
  %101 = add nsw i32 %100, 1
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100000 x i32], ptr @fj, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !11
  %105 = load i32, ptr %8, align 4, !tbaa !11
  %106 = icmp eq i32 %104, %105
  %107 = zext i1 %106 to i32
  %108 = add nsw i32 %99, %107
  store i32 %108, ptr %9, align 4, !tbaa !11
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %89, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %110 = load i32, ptr %109, align 4, !tbaa !11
  %111 = load i32, ptr %5, align 4, !tbaa !11
  %112 = add nsw i32 %111, 1
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %113
  %115 = load i32, ptr %7, align 4, !tbaa !11
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [22 x [3 x i32]], ptr %114, i64 0, i64 %116
  %118 = load i32, ptr %8, align 4, !tbaa !11
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [3 x i32], ptr %117, i64 0, i64 %119
  store i32 %110, ptr %120, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %121

121:                                              ; preds = %174, %79
  %122 = load i32, ptr %10, align 4, !tbaa !11
  %123 = icmp slt i32 %122, 3
  br i1 %123, label %125, label %124

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

125:                                              ; preds = %121
  %126 = load i32, ptr %8, align 4, !tbaa !11
  %127 = load i32, ptr %10, align 4, !tbaa !11
  %128 = icmp eq i32 %126, %127
  br i1 %128, label %129, label %130

129:                                              ; preds = %125
  br label %174

130:                                              ; preds = %125
  %131 = load i32, ptr %5, align 4, !tbaa !11
  %132 = add nsw i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %133
  %135 = load i32, ptr %7, align 4, !tbaa !11
  %136 = add nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [22 x [3 x i32]], ptr %134, i64 0, i64 %137
  %139 = load i32, ptr %10, align 4, !tbaa !11
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [3 x i32], ptr %138, i64 0, i64 %140
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %142 = load i32, ptr %5, align 4, !tbaa !11
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %143
  %145 = load i32, ptr %7, align 4, !tbaa !11
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [22 x [3 x i32]], ptr %144, i64 0, i64 %146
  %148 = load i32, ptr %8, align 4, !tbaa !11
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [3 x i32], ptr %147, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !11
  %152 = load i32, ptr %5, align 4, !tbaa !11
  %153 = add nsw i32 %152, 1
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [100000 x i32], ptr @fj, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !11
  %157 = load i32, ptr %10, align 4, !tbaa !11
  %158 = icmp eq i32 %156, %157
  %159 = zext i1 %158 to i32
  %160 = add nsw i32 %151, %159
  store i32 %160, ptr %11, align 4, !tbaa !11
  %161 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %141, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %162 = load i32, ptr %161, align 4, !tbaa !11
  %163 = load i32, ptr %5, align 4, !tbaa !11
  %164 = add nsw i32 %163, 1
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %165
  %167 = load i32, ptr %7, align 4, !tbaa !11
  %168 = add nsw i32 %167, 1
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [22 x [3 x i32]], ptr %166, i64 0, i64 %169
  %171 = load i32, ptr %10, align 4, !tbaa !11
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [3 x i32], ptr %170, i64 0, i64 %172
  store i32 %162, ptr %173, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %174

174:                                              ; preds = %130, %129
  %175 = load i32, ptr %10, align 4, !tbaa !11
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %10, align 4, !tbaa !11
  br label %121, !llvm.loop !16

177:                                              ; preds = %124
  br label %178

178:                                              ; preds = %177, %67
  br label %179

179:                                              ; preds = %178
  %180 = load i32, ptr %8, align 4, !tbaa !11
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %8, align 4, !tbaa !11
  br label %63, !llvm.loop !17

182:                                              ; preds = %66
  br label %183

183:                                              ; preds = %182
  %184 = load i32, ptr %7, align 4, !tbaa !11
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %7, align 4, !tbaa !11
  br label %57, !llvm.loop !18

186:                                              ; preds = %61
  br label %187

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

190:                                              ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %191

191:                                              ; preds = %218, %190
  %192 = load i32, ptr %13, align 4, !tbaa !11
  %193 = load i32, ptr @K, align 4, !tbaa !11
  %194 = icmp sle i32 %192, %193
  br i1 %194, label %196, label %195

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

196:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %197

197:                                              ; preds = %214, %196
  %198 = load i32, ptr %14, align 4, !tbaa !11
  %199 = icmp slt i32 %198, 3
  br i1 %199, label %201, label %200

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

201:                                              ; preds = %197
  %202 = load i32, ptr @N, align 4, !tbaa !11
  %203 = sub nsw i32 %202, 1
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %204
  %206 = load i32, ptr %13, align 4, !tbaa !11
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [22 x [3 x i32]], ptr %205, i64 0, i64 %207
  %209 = load i32, ptr %14, align 4, !tbaa !11
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [3 x i32], ptr %208, i64 0, i64 %210
  %212 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %211)
  %213 = load i32, ptr %212, align 4, !tbaa !11
  store i32 %213, ptr %12, align 4, !tbaa !11
  br label %214

214:                                              ; preds = %201
  %215 = load i32, ptr %14, align 4, !tbaa !11
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %14, align 4, !tbaa !11
  br label %197, !llvm.loop !20

217:                                              ; preds = %200
  br label %218

218:                                              ; preds = %217
  %219 = load i32, ptr %13, align 4, !tbaa !11
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %13, align 4, !tbaa !11
  br label %191, !llvm.loop !21

221:                                              ; preds = %195
  %222 = load i32, ptr %12, align 4, !tbaa !11
  %223 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %222)
  %224 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %223, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  %225 = load i32, ptr %1, align 4
  ret i32 %225
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

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


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

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

@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@dp = external dso_local global [100000 x [22 x [3 x i32]]], align 16
@fj = external dso_local local_unnamed_addr global [100000 x i32], align 16
@mp = external dso_local local_unnamed_addr global [128 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i8, align 1
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = load ptr, ptr @stdin, align 8, !tbaa !5
  %7 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %6)
  %8 = load ptr, ptr @stdout, align 8, !tbaa !5
  %9 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %8)
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !9
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %13
  %15 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  store i32 0, ptr getelementptr inbounds (i8, ptr @mp, i64 288), align 16, !tbaa !11
  store i32 1, ptr getelementptr inbounds (i8, ptr @mp, i64 320), align 16, !tbaa !11
  store i32 2, ptr getelementptr inbounds (i8, ptr @mp, i64 332), align 4, !tbaa !11
  %16 = tail 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)
  %17 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %18 = load i32, ptr @N, align 4, !tbaa !11
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 -1, ptr %2, align 4, !tbaa !11
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @dp, ptr noundef nonnull getelementptr inbounds (i8, ptr @dp, i64 26400000), ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !11
  store i32 0, ptr getelementptr inbounds (i8, ptr @dp, i64 4), align 4, !tbaa !11
  store i32 0, ptr @dp, align 16, !tbaa !11
  %20 = load i32, ptr @fj, align 16, !tbaa !11
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [3 x i32], ptr @dp, i64 0, i64 %21
  store i32 1, ptr %22, align 4, !tbaa !11
  %23 = load i32, ptr @N, align 4, !tbaa !11
  %24 = icmp sgt i32 %23, 1
  %.pre90 = load i32, ptr @K, align 4, !tbaa !11
  br i1 %24, label %.preheader53.lr.ph, label %._crit_edge61

.preheader53.lr.ph:                               ; preds = %._crit_edge
  %25 = icmp slt i32 %.pre90, 0
  br i1 %25, label %._crit_edge61.thread, label %.preheader53

._crit_edge61.thread:                             ; preds = %.preheader53.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr %5, align 4, !tbaa !11
  br label %._crit_edge65

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #7
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %1)
  %27 = load i8, ptr %1, align 1, !tbaa !13
  %28 = sext i8 %27 to i64
  %29 = getelementptr inbounds [128 x i32], ptr @mp, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !11
  %31 = add nsw i32 %30, 1
  %32 = srem i32 %31, 3
  %33 = getelementptr inbounds [100000 x i32], ptr @fj, i64 0, i64 %indvars.iv
  store i32 %32, ptr %33, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr @N, align 4, !tbaa !11
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next, %35
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.preheader53:                                     ; preds = %.preheader53.lr.ph, %._crit_edge59
  %37 = phi i32 [ %44, %._crit_edge59 ], [ %23, %.preheader53.lr.ph ]
  %38 = phi i32 [ %45, %._crit_edge59 ], [ %.pre90, %.preheader53.lr.ph ]
  %indvars.iv77 = phi i64 [ %.pre91, %._crit_edge59 ], [ 0, %.preheader53.lr.ph ]
  %.not5157 = icmp slt i32 %38, 0
  %.pre91 = add nuw nsw i64 %indvars.iv77, 1
  br i1 %.not5157, label %._crit_edge59, label %.preheader52.lr.ph

.preheader52.lr.ph:                               ; preds = %.preheader53
  %39 = getelementptr inbounds [100000 x i32], ptr @fj, i64 0, i64 %.pre91
  br label %.preheader52

._crit_edge61:                                    ; preds = %._crit_edge59, %._crit_edge
  %40 = phi i32 [ %.pre90, %._crit_edge ], [ %45, %._crit_edge59 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr %5, align 4, !tbaa !11
  %.not63 = icmp slt i32 %40, 0
  br i1 %.not63, label %._crit_edge65, label %.preheader

.preheader52:                                     ; preds = %.preheader52.lr.ph, %.loopexit.2
  %indvars.iv74 = phi i64 [ 0, %.preheader52.lr.ph ], [ %indvars.iv.next75, %.loopexit.2 ]
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %41 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %indvars.iv77, i64 %indvars.iv74, i64 0
  %42 = load i32, ptr %41, align 4, !tbaa !11
  %43 = icmp sgt i32 %42, -1
  br i1 %43, label %.loopexit.loopexit, label %.loopexit

._crit_edge59.loopexit:                           ; preds = %.loopexit.2
  %.pre = load i32, ptr @N, align 4, !tbaa !11
  br label %._crit_edge59

._crit_edge59:                                    ; preds = %.preheader53, %._crit_edge59.loopexit
  %44 = phi i32 [ %.pre, %._crit_edge59.loopexit ], [ %37, %.preheader53 ]
  %45 = phi i32 [ %124, %._crit_edge59.loopexit ], [ %38, %.preheader53 ]
  %46 = add nsw i32 %44, -1
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %.pre91, %47
  br i1 %48, label %.preheader53, label %._crit_edge61, !llvm.loop !16

.loopexit.loopexit:                               ; preds = %.preheader52
  %49 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %.pre91, i64 %indvars.iv74, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %50 = load i32, ptr %39, align 4, !tbaa !11
  %51 = icmp eq i32 %50, 0
  %52 = zext i1 %51 to i32
  %53 = add nuw nsw i32 %42, %52
  store i32 %53, ptr %3, align 4, !tbaa !11
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %49, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %55 = load i32, ptr %54, align 4, !tbaa !11
  store i32 %55, ptr %49, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %56 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %.pre91, i64 %indvars.iv.next75, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %57 = load i32, ptr %41, align 4, !tbaa !11
  %58 = load i32, ptr %39, align 4, !tbaa !11
  %59 = icmp eq i32 %58, 1
  %60 = zext i1 %59 to i32
  %61 = add nsw i32 %57, %60
  store i32 %61, ptr %4, align 4, !tbaa !11
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %56, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %63 = load i32, ptr %62, align 4, !tbaa !11
  store i32 %63, ptr %56, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %64 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %.pre91, i64 %indvars.iv.next75, i64 2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %65 = load i32, ptr %41, align 4, !tbaa !11
  %66 = load i32, ptr %39, align 4, !tbaa !11
  %67 = icmp eq i32 %66, 2
  %68 = zext i1 %67 to i32
  %69 = add nsw i32 %65, %68
  store i32 %69, ptr %4, align 4, !tbaa !11
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %64, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %71 = load i32, ptr %70, align 4, !tbaa !11
  store i32 %71, ptr %64, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.preheader52
  %72 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %indvars.iv77, i64 %indvars.iv74, i64 1
  %73 = load i32, ptr %72, align 4, !tbaa !11
  %74 = icmp sgt i32 %73, -1
  br i1 %74, label %.loopexit.loopexit.1, label %.loopexit.1

.loopexit.loopexit.1:                             ; preds = %.loopexit
  %75 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %.pre91, i64 %indvars.iv74, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %76 = load i32, ptr %39, align 4, !tbaa !11
  %77 = icmp eq i32 %76, 1
  %78 = zext i1 %77 to i32
  %79 = add nuw nsw i32 %73, %78
  store i32 %79, ptr %3, align 4, !tbaa !11
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %75, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %81 = load i32, ptr %80, align 4, !tbaa !11
  store i32 %81, ptr %75, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %82 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %.pre91, i64 %indvars.iv.next75, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %83 = load i32, ptr %72, align 4, !tbaa !11
  %84 = load i32, ptr %39, align 4, !tbaa !11
  %85 = icmp eq i32 %84, 0
  %86 = zext i1 %85 to i32
  %87 = add nsw i32 %83, %86
  store i32 %87, ptr %4, align 4, !tbaa !11
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %82, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %89 = load i32, ptr %88, align 4, !tbaa !11
  store i32 %89, ptr %82, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %90 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %.pre91, i64 %indvars.iv.next75, i64 2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %91 = load i32, ptr %72, align 4, !tbaa !11
  %92 = load i32, ptr %39, align 4, !tbaa !11
  %93 = icmp eq i32 %92, 2
  %94 = zext i1 %93 to i32
  %95 = add nsw i32 %91, %94
  store i32 %95, ptr %4, align 4, !tbaa !11
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %90, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %97 = load i32, ptr %96, align 4, !tbaa !11
  store i32 %97, ptr %90, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %.loopexit.1

.loopexit.1:                                      ; preds = %.loopexit.loopexit.1, %.loopexit
  %98 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %indvars.iv77, i64 %indvars.iv74, i64 2
  %99 = load i32, ptr %98, align 4, !tbaa !11
  %100 = icmp sgt i32 %99, -1
  br i1 %100, label %.loopexit.loopexit.2, label %.loopexit.2

.loopexit.loopexit.2:                             ; preds = %.loopexit.1
  %101 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %.pre91, i64 %indvars.iv74, i64 2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %102 = load i32, ptr %39, align 4, !tbaa !11
  %103 = icmp eq i32 %102, 2
  %104 = zext i1 %103 to i32
  %105 = add nuw nsw i32 %99, %104
  store i32 %105, ptr %3, align 4, !tbaa !11
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %101, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %107 = load i32, ptr %106, align 4, !tbaa !11
  store i32 %107, ptr %101, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %108 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %.pre91, i64 %indvars.iv.next75, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %109 = load i32, ptr %98, align 4, !tbaa !11
  %110 = load i32, ptr %39, align 4, !tbaa !11
  %111 = icmp eq i32 %110, 0
  %112 = zext i1 %111 to i32
  %113 = add nsw i32 %109, %112
  store i32 %113, ptr %4, align 4, !tbaa !11
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %108, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %115 = load i32, ptr %114, align 4, !tbaa !11
  store i32 %115, ptr %108, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %116 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %.pre91, i64 %indvars.iv.next75, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %117 = load i32, ptr %98, align 4, !tbaa !11
  %118 = load i32, ptr %39, align 4, !tbaa !11
  %119 = icmp eq i32 %118, 1
  %120 = zext i1 %119 to i32
  %121 = add nsw i32 %117, %120
  store i32 %121, ptr %4, align 4, !tbaa !11
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %116, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %123 = load i32, ptr %122, align 4, !tbaa !11
  store i32 %123, ptr %116, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %.loopexit.2

.loopexit.2:                                      ; preds = %.loopexit.loopexit.2, %.loopexit.1
  %124 = load i32, ptr @K, align 4, !tbaa !11
  %125 = sext i32 %124 to i64
  %.not51.not = icmp slt i64 %indvars.iv74, %125
  br i1 %.not51.not, label %.preheader52, label %._crit_edge59.loopexit, !llvm.loop !18

.preheader:                                       ; preds = %._crit_edge61, %.preheader
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %.preheader ], [ 0, %._crit_edge61 ]
  %126 = load i32, ptr @N, align 4, !tbaa !11
  %127 = add nsw i32 %126, -1
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %128, i64 %indvars.iv83, i64 0
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %129)
  %131 = load i32, ptr %130, align 4, !tbaa !11
  store i32 %131, ptr %5, align 4, !tbaa !11
  %132 = load i32, ptr @N, align 4, !tbaa !11
  %133 = add nsw i32 %132, -1
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %134, i64 %indvars.iv83, i64 1
  %136 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %135)
  %137 = load i32, ptr %136, align 4, !tbaa !11
  store i32 %137, ptr %5, align 4, !tbaa !11
  %138 = load i32, ptr @N, align 4, !tbaa !11
  %139 = add nsw i32 %138, -1
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [100000 x [22 x [3 x i32]]], ptr @dp, i64 0, i64 %140, i64 %indvars.iv83, i64 2
  %142 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %141)
  %143 = load i32, ptr %142, align 4, !tbaa !11
  store i32 %143, ptr %5, align 4, !tbaa !11
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %144 = load i32, ptr @K, align 4, !tbaa !11
  %145 = sext i32 %144 to i64
  %.not.not = icmp slt i64 %indvars.iv83, %145
  br i1 %.not.not, label %.preheader, label %._crit_edge65, !llvm.loop !19

._crit_edge65:                                    ; preds = %.preheader, %._crit_edge61.thread, %._crit_edge61
  %146 = phi i32 [ 0, %._crit_edge61 ], [ 0, %._crit_edge61.thread ], [ %143, %.preheader ]
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %146)
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %147, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

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


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