; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/67 Beta Division 2/Problem D (D)

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

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

@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@l = external dso_local global [51 x i64], align 16
@sum = external dso_local global [51 x i64], align 16
@psum = external dso_local global [51 x i64], align 16
@ssum = external dso_local global [51 x i64], align 16
@a = external dso_local global [51 x [5000 x i64]], align 16
@best = external dso_local global [51 x i64], align 16
@b = external dso_local global [250010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %16 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %17 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %19
  %21 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  %22 = load ptr, ptr @_ZSt4cerr, align 8, !tbaa !5
  %23 = getelementptr i8, ptr %22, i64 -24
  %24 = load i64, ptr %23, align 8
  %25 = getelementptr inbounds i8, ptr @_ZSt4cerr, i64 %24
  %26 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %25, ptr noundef null)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !8
  br label %29

29:                                               ; preds = %200, %0
  %30 = load i32, ptr %2, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = load i64, ptr @n, align 8, !tbaa !11
  %33 = icmp sle i64 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %29
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %203

35:                                               ; preds = %29
  %36 = load i32, ptr %2, align 4, !tbaa !8
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [51 x i64], ptr @l, i64 0, i64 %37
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %38)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %40

40:                                               ; preds = %69, %35
  %41 = load i32, ptr %4, align 4, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = load i32, ptr %2, align 4, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [51 x i64], ptr @l, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !11
  %47 = icmp slt i64 %42, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %40
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %72

49:                                               ; preds = %40
  %50 = load i32, ptr %2, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %51
  %53 = load i32, ptr %4, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [5000 x i64], ptr %52, i64 0, i64 %54
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %55)
  %57 = load i32, ptr %2, align 4, !tbaa !8
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %58
  %60 = load i32, ptr %4, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [5000 x i64], ptr %59, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !11
  %64 = load i32, ptr %2, align 4, !tbaa !8
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [51 x i64], ptr @sum, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !11
  %68 = add nsw i64 %67, %63
  store i64 %68, ptr %66, align 8, !tbaa !11
  br label %69

69:                                               ; preds = %49
  %70 = load i32, ptr %4, align 4, !tbaa !8
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %4, align 4, !tbaa !8
  br label %40, !llvm.loop !13

72:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %73 = load i32, ptr %2, align 4, !tbaa !8
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %74
  %76 = getelementptr inbounds [5000 x i64], ptr %75, i64 0, i64 0
  %77 = load i64, ptr %76, align 16, !tbaa !11
  %78 = load i32, ptr %2, align 4, !tbaa !8
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [51 x i64], ptr @psum, i64 0, i64 %79
  store i64 %77, ptr %80, align 8, !tbaa !11
  store i64 %77, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !8
  br label %81

81:                                               ; preds = %108, %72
  %82 = load i32, ptr %6, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = load i32, ptr %2, align 4, !tbaa !8
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [51 x i64], ptr @l, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !11
  %88 = icmp slt i64 %83, %87
  br i1 %88, label %90, label %89

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

90:                                               ; preds = %81
  %91 = load i32, ptr %2, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %92
  %94 = load i32, ptr %6, align 4, !tbaa !8
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [5000 x i64], ptr %93, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !11
  %98 = load i64, ptr %5, align 8, !tbaa !11
  %99 = add nsw i64 %98, %97
  store i64 %99, ptr %5, align 8, !tbaa !11
  %100 = load i32, ptr %2, align 4, !tbaa !8
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [51 x i64], ptr @psum, i64 0, i64 %101
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %104 = load i64, ptr %103, align 8, !tbaa !11
  %105 = load i32, ptr %2, align 4, !tbaa !8
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [51 x i64], ptr @psum, i64 0, i64 %106
  store i64 %104, ptr %107, align 8, !tbaa !11
  br label %108

108:                                              ; preds = %90
  %109 = load i32, ptr %6, align 4, !tbaa !8
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %6, align 4, !tbaa !8
  br label %81, !llvm.loop !15

111:                                              ; preds = %89
  %112 = load i32, ptr %2, align 4, !tbaa !8
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %113
  %115 = load i32, ptr %2, align 4, !tbaa !8
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [51 x i64], ptr @l, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !11
  %119 = sub nsw i64 %118, 1
  %120 = getelementptr inbounds [5000 x i64], ptr %114, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !11
  %122 = load i32, ptr %2, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [51 x i64], ptr @ssum, i64 0, i64 %123
  store i64 %121, ptr %124, align 8, !tbaa !11
  store i64 %121, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %125 = load i32, ptr %2, align 4, !tbaa !8
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [51 x i64], ptr @l, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !11
  %129 = sub nsw i64 %128, 2
  %130 = trunc i64 %129 to i32
  store i32 %130, ptr %7, align 4, !tbaa !8
  br label %131

131:                                              ; preds = %153, %111
  %132 = load i32, ptr %7, align 4, !tbaa !8
  %133 = icmp sge i32 %132, 0
  br i1 %133, label %135, label %134

134:                                              ; preds = %131
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %156

135:                                              ; preds = %131
  %136 = load i32, ptr %2, align 4, !tbaa !8
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %137
  %139 = load i32, ptr %7, align 4, !tbaa !8
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [5000 x i64], ptr %138, i64 0, i64 %140
  %142 = load i64, ptr %141, align 8, !tbaa !11
  %143 = load i64, ptr %5, align 8, !tbaa !11
  %144 = add nsw i64 %143, %142
  store i64 %144, ptr %5, align 8, !tbaa !11
  %145 = load i32, ptr %2, align 4, !tbaa !8
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [51 x i64], ptr @ssum, i64 0, i64 %146
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %147, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %149 = load i64, ptr %148, align 8, !tbaa !11
  %150 = load i32, ptr %2, align 4, !tbaa !8
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [51 x i64], ptr @ssum, i64 0, i64 %151
  store i64 %149, ptr %152, align 8, !tbaa !11
  br label %153

153:                                              ; preds = %135
  %154 = load i32, ptr %7, align 4, !tbaa !8
  %155 = add nsw i32 %154, -1
  store i32 %155, ptr %7, align 4, !tbaa !8
  br label %131, !llvm.loop !16

156:                                              ; preds = %134
  %157 = load i32, ptr %2, align 4, !tbaa !8
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %158
  %160 = getelementptr inbounds [5000 x i64], ptr %159, i64 0, i64 0
  %161 = load i64, ptr %160, align 16, !tbaa !11
  store i64 %161, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %162 = load i64, ptr %5, align 8, !tbaa !11
  store i64 %162, ptr %8, align 8, !tbaa !11
  %163 = load i64, ptr %5, align 8, !tbaa !11
  %164 = icmp slt i64 %163, 0
  br i1 %164, label %165, label %166

165:                                              ; preds = %156
  store i64 0, ptr %5, align 8, !tbaa !11
  br label %166

166:                                              ; preds = %165, %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !8
  br label %167

167:                                              ; preds = %192, %166
  %168 = load i32, ptr %9, align 4, !tbaa !8
  %169 = sext i32 %168 to i64
  %170 = load i32, ptr %2, align 4, !tbaa !8
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [51 x i64], ptr @l, i64 0, i64 %171
  %173 = load i64, ptr %172, align 8, !tbaa !11
  %174 = icmp slt i64 %169, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %167
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %195

176:                                              ; preds = %167
  %177 = load i32, ptr %2, align 4, !tbaa !8
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %178
  %180 = load i32, ptr %9, align 4, !tbaa !8
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [5000 x i64], ptr %179, i64 0, i64 %181
  %183 = load i64, ptr %182, align 8, !tbaa !11
  %184 = load i64, ptr %5, align 8, !tbaa !11
  %185 = add nsw i64 %184, %183
  store i64 %185, ptr %5, align 8, !tbaa !11
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %187 = load i64, ptr %186, align 8, !tbaa !11
  store i64 %187, ptr %8, align 8, !tbaa !11
  %188 = load i64, ptr %5, align 8, !tbaa !11
  %189 = icmp slt i64 %188, 0
  br i1 %189, label %190, label %191

190:                                              ; preds = %176
  store i64 0, ptr %5, align 8, !tbaa !11
  br label %191

191:                                              ; preds = %190, %176
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr %9, align 4, !tbaa !8
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %9, align 4, !tbaa !8
  br label %167, !llvm.loop !17

195:                                              ; preds = %175
  %196 = load i64, ptr %8, align 8, !tbaa !11
  %197 = load i32, ptr %2, align 4, !tbaa !8
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [51 x i64], ptr @best, i64 0, i64 %198
  store i64 %196, ptr %199, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %200

200:                                              ; preds = %195
  %201 = load i32, ptr %2, align 4, !tbaa !8
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %2, align 4, !tbaa !8
  br label %29, !llvm.loop !18

203:                                              ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !8
  br label %204

204:                                              ; preds = %215, %203
  %205 = load i32, ptr %10, align 4, !tbaa !8
  %206 = sext i32 %205 to i64
  %207 = load i64, ptr @m, align 8, !tbaa !11
  %208 = icmp sle i64 %206, %207
  br i1 %208, label %210, label %209

209:                                              ; preds = %204
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %218

210:                                              ; preds = %204
  %211 = load i32, ptr %10, align 4, !tbaa !8
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [250010 x i64], ptr @b, i64 0, i64 %212
  %214 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %213)
  br label %215

215:                                              ; preds = %210
  %216 = load i32, ptr %10, align 4, !tbaa !8
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %10, align 4, !tbaa !8
  br label %204, !llvm.loop !19

218:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %219 = load i64, ptr getelementptr inbounds ([250010 x i64], ptr @b, i64 0, i64 1), align 8, !tbaa !11
  %220 = getelementptr inbounds [51 x i64], ptr @ssum, i64 0, i64 %219
  %221 = load i64, ptr getelementptr inbounds ([250010 x i64], ptr @b, i64 0, i64 1), align 8, !tbaa !11
  %222 = getelementptr inbounds [51 x i64], ptr @psum, i64 0, i64 %221
  %223 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %220, ptr noundef nonnull align 8 dereferenceable(8) %222)
  %224 = load i64, ptr getelementptr inbounds ([250010 x i64], ptr @b, i64 0, i64 1), align 8, !tbaa !11
  %225 = getelementptr inbounds [51 x i64], ptr @sum, i64 0, i64 %224
  %226 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %223, ptr noundef nonnull align 8 dereferenceable(8) %225)
  %227 = load i64, ptr %226, align 8, !tbaa !11
  store i64 %227, ptr %11, align 8, !tbaa !11
  %228 = load i64, ptr getelementptr inbounds ([250010 x i64], ptr @b, i64 0, i64 1), align 8, !tbaa !11
  %229 = getelementptr inbounds [51 x i64], ptr @best, i64 0, i64 %228
  %230 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %229)
  %231 = load i64, ptr %230, align 8, !tbaa !11
  store i64 %231, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %232 = load i64, ptr getelementptr inbounds ([250010 x i64], ptr @b, i64 0, i64 1), align 8, !tbaa !11
  %233 = getelementptr inbounds [51 x i64], ptr @sum, i64 0, i64 %232
  %234 = load i64, ptr getelementptr inbounds ([250010 x i64], ptr @b, i64 0, i64 1), align 8, !tbaa !11
  %235 = getelementptr inbounds [51 x i64], ptr @ssum, i64 0, i64 %234
  %236 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %233, ptr noundef nonnull align 8 dereferenceable(8) %235)
  %237 = load i64, ptr %236, align 8, !tbaa !11
  store i64 %237, ptr %12, align 8, !tbaa !11
  %238 = load i64, ptr %12, align 8, !tbaa !11
  %239 = icmp slt i64 %238, 0
  br i1 %239, label %240, label %241

240:                                              ; preds = %218
  store i64 0, ptr %12, align 8, !tbaa !11
  br label %241

241:                                              ; preds = %240, %218
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 2, ptr %13, align 4, !tbaa !8
  br label %242

242:                                              ; preds = %300, %241
  %243 = load i32, ptr %13, align 4, !tbaa !8
  %244 = sext i32 %243 to i64
  %245 = load i64, ptr @m, align 8, !tbaa !11
  %246 = icmp sle i64 %244, %245
  br i1 %246, label %248, label %247

247:                                              ; preds = %242
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %303

248:                                              ; preds = %242
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %249 = load i64, ptr %12, align 8, !tbaa !11
  %250 = load i32, ptr %13, align 4, !tbaa !8
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [250010 x i64], ptr @b, i64 0, i64 %251
  %253 = load i64, ptr %252, align 8, !tbaa !11
  %254 = getelementptr inbounds [51 x i64], ptr @psum, i64 0, i64 %253
  %255 = load i64, ptr %254, align 8, !tbaa !11
  %256 = add nsw i64 %249, %255
  store i64 %256, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %257 = load i64, ptr %12, align 8, !tbaa !11
  %258 = load i32, ptr %13, align 4, !tbaa !8
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [250010 x i64], ptr @b, i64 0, i64 %259
  %261 = load i64, ptr %260, align 8, !tbaa !11
  %262 = getelementptr inbounds [51 x i64], ptr @sum, i64 0, i64 %261
  %263 = load i64, ptr %262, align 8, !tbaa !11
  %264 = add nsw i64 %257, %263
  store i64 %264, ptr %15, align 8, !tbaa !11
  %265 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %266 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %265)
  %267 = load i64, ptr %266, align 8, !tbaa !11
  store i64 %267, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %268 = load i32, ptr %13, align 4, !tbaa !8
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [250010 x i64], ptr @b, i64 0, i64 %269
  %271 = load i64, ptr %270, align 8, !tbaa !11
  %272 = getelementptr inbounds [51 x i64], ptr @sum, i64 0, i64 %271
  %273 = load i64, ptr %272, align 8, !tbaa !11
  %274 = load i64, ptr %12, align 8, !tbaa !11
  %275 = add nsw i64 %274, %273
  store i64 %275, ptr %12, align 8, !tbaa !11
  %276 = load i32, ptr %13, align 4, !tbaa !8
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [250010 x i64], ptr @b, i64 0, i64 %277
  %279 = load i64, ptr %278, align 8, !tbaa !11
  %280 = getelementptr inbounds [51 x i64], ptr @best, i64 0, i64 %279
  %281 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %280)
  %282 = load i64, ptr %281, align 8, !tbaa !11
  store i64 %282, ptr %11, align 8, !tbaa !11
  %283 = load i32, ptr %13, align 4, !tbaa !8
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [250010 x i64], ptr @b, i64 0, i64 %284
  %286 = load i64, ptr %285, align 8, !tbaa !11
  %287 = getelementptr inbounds [51 x i64], ptr @ssum, i64 0, i64 %286
  %288 = load i32, ptr %13, align 4, !tbaa !8
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [250010 x i64], ptr @b, i64 0, i64 %289
  %291 = load i64, ptr %290, align 8, !tbaa !11
  %292 = getelementptr inbounds [51 x i64], ptr @sum, i64 0, i64 %291
  %293 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %287, ptr noundef nonnull align 8 dereferenceable(8) %292)
  %294 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %293, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %295 = load i64, ptr %294, align 8, !tbaa !11
  store i64 %295, ptr %12, align 8, !tbaa !11
  %296 = load i64, ptr %12, align 8, !tbaa !11
  %297 = icmp slt i64 %296, 0
  br i1 %297, label %298, label %299

298:                                              ; preds = %248
  store i64 0, ptr %12, align 8, !tbaa !11
  br label %299

299:                                              ; preds = %298, %248
  br label %300

300:                                              ; preds = %299
  %301 = load i32, ptr %13, align 4, !tbaa !8
  %302 = add nsw i32 %301, 1
  store i32 %302, ptr %13, align 4, !tbaa !8
  br label %242, !llvm.loop !20

303:                                              ; preds = %247
  %304 = load i64, ptr %11, align 8, !tbaa !11
  %305 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %304)
  %306 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %305, ptr noundef @.str)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %307 = load i32, ptr %1, align 4
  ret i32 %307
}

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

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

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

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


; 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 i64, align 8
@m = external dso_local global i64, align 8
@l = external dso_local global [51 x i64], align 16
@sum = external dso_local global [51 x i64], align 16
@psum = external dso_local global [51 x i64], align 16
@ssum = external dso_local global [51 x i64], align 16
@a = external dso_local global [51 x [5000 x i64]], align 16
@best = external dso_local global [51 x i64], align 16
@b = external dso_local global [250010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = load ptr, ptr @_ZSt4cerr, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt4cerr, i64 %15
  %17 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  %18 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %19 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) @m)
  %20 = load i64, ptr @n, align 8, !tbaa !8
  %.not78 = icmp slt i64 %20, 1
  br i1 %.not78, label %.preheader, label %.lr.ph81

.preheader:                                       ; preds = %._crit_edge77, %0
  %21 = load i64, ptr @m, align 8, !tbaa !8
  %.not6382 = icmp slt i64 %21, 1
  br i1 %.not6382, label %._crit_edge85, label %.lr.ph84

.lr.ph81:                                         ; preds = %0, %._crit_edge77
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %._crit_edge77 ], [ 1, %0 ]
  %22 = getelementptr inbounds [51 x i64], ptr @l, i64 0, i64 %indvars.iv102
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %24 = load i64, ptr %22, align 8, !tbaa !8
  %25 = icmp sgt i64 %24, 0
  br i1 %25, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.lr.ph81
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %26 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %indvars.iv102
  %27 = load i64, ptr %26, align 16, !tbaa !8
  %28 = getelementptr inbounds [51 x i64], ptr @psum, i64 0, i64 %indvars.iv102
  store i64 %27, ptr %28, align 8, !tbaa !8
  br label %._crit_edge69

.lr.ph:                                           ; preds = %.lr.ph81
  %29 = getelementptr inbounds [51 x i64], ptr @sum, i64 0, i64 %indvars.iv102
  br label %34

._crit_edge:                                      ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %30 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %indvars.iv102
  %31 = load i64, ptr %30, align 16, !tbaa !8
  %32 = getelementptr inbounds [51 x i64], ptr @psum, i64 0, i64 %indvars.iv102
  store i64 %31, ptr %32, align 8, !tbaa !8
  store i64 %31, ptr %1, align 8, !tbaa !8
  %33 = icmp sgt i64 %40, 1
  br i1 %33, label %.lr.ph68, label %._crit_edge69

34:                                               ; preds = %.lr.ph, %34
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %34 ]
  %35 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %indvars.iv102, i64 %indvars.iv
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %35)
  %37 = load i64, ptr %35, align 8, !tbaa !8
  %38 = load i64, ptr %29, align 8, !tbaa !8
  %39 = add nsw i64 %38, %37
  store i64 %39, ptr %29, align 8, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = load i64, ptr %22, align 8, !tbaa !8
  %41 = icmp sgt i64 %40, %indvars.iv.next
  br i1 %41, label %34, label %._crit_edge, !llvm.loop !11

._crit_edge69:                                    ; preds = %.lr.ph68, %._crit_edge.thread, %._crit_edge
  %42 = phi ptr [ %30, %._crit_edge ], [ %26, %._crit_edge.thread ], [ %30, %.lr.ph68 ]
  %.lcssa = phi i64 [ %40, %._crit_edge ], [ %24, %._crit_edge.thread ], [ %57, %.lr.ph68 ]
  %43 = add nsw i64 %.lcssa, -1
  %44 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %indvars.iv102, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !8
  %46 = getelementptr inbounds [51 x i64], ptr @ssum, i64 0, i64 %indvars.iv102
  store i64 %45, ptr %46, align 8, !tbaa !8
  store i64 %45, ptr %1, align 8, !tbaa !8
  %47 = trunc i64 %.lcssa to i32
  %48 = add i32 %47, -2
  %49 = icmp sgt i32 %48, -1
  br i1 %49, label %.lr.ph72.preheader, label %._crit_edge73

.lr.ph72.preheader:                               ; preds = %._crit_edge69
  %50 = zext nneg i32 %48 to i64
  br label %.lr.ph72

.lr.ph68:                                         ; preds = %._crit_edge, %.lr.ph68
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %.lr.ph68 ], [ 1, %._crit_edge ]
  %51 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %indvars.iv102, i64 %indvars.iv93
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = load i64, ptr %1, align 8, !tbaa !8
  %54 = add nsw i64 %53, %52
  store i64 %54, ptr %1, align 8, !tbaa !8
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %56 = load i64, ptr %55, align 8, !tbaa !8
  store i64 %56, ptr %32, align 8, !tbaa !8
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %57 = load i64, ptr %22, align 8, !tbaa !8
  %58 = icmp sgt i64 %57, %indvars.iv.next94
  br i1 %58, label %.lr.ph68, label %._crit_edge69, !llvm.loop !13

._crit_edge73:                                    ; preds = %.lr.ph72, %._crit_edge69
  %59 = load i64, ptr %42, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  store i64 %59, ptr %2, align 8, !tbaa !8
  %60 = load i64, ptr %22, align 8, !tbaa !8
  %61 = icmp sgt i64 %60, 1
  br i1 %61, label %.lr.ph76.preheader, label %._crit_edge77

.lr.ph76.preheader:                               ; preds = %._crit_edge73
  %spec.select = call i64 @llvm.smax.i64(i64 %59, i64 0)
  br label %.lr.ph76

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %.lr.ph72
  %indvars.iv96 = phi i64 [ %50, %.lr.ph72.preheader ], [ %indvars.iv.next97, %.lr.ph72 ]
  %62 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %indvars.iv102, i64 %indvars.iv96
  %63 = load i64, ptr %62, align 8, !tbaa !8
  %64 = load i64, ptr %1, align 8, !tbaa !8
  %65 = add nsw i64 %64, %63
  store i64 %65, ptr %1, align 8, !tbaa !8
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %67 = load i64, ptr %66, align 8, !tbaa !8
  store i64 %67, ptr %46, align 8, !tbaa !8
  %indvars.iv.next97 = add nsw i64 %indvars.iv96, -1
  %.not = icmp eq i64 %indvars.iv96, 0
  br i1 %.not, label %._crit_edge73, label %.lr.ph72, !llvm.loop !14

._crit_edge77:                                    ; preds = %80, %._crit_edge73
  %68 = phi i64 [ %59, %._crit_edge73 ], [ %76, %80 ]
  %69 = getelementptr inbounds [51 x i64], ptr @best, i64 0, i64 %indvars.iv102
  store i64 %68, ptr %69, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %70 = load i64, ptr @n, align 8, !tbaa !8
  %.not.not = icmp sgt i64 %70, %indvars.iv102
  br i1 %.not.not, label %.lr.ph81, label %.preheader, !llvm.loop !15

.lr.ph76:                                         ; preds = %.lr.ph76.preheader, %80
  %71 = phi i64 [ %81, %80 ], [ %spec.select, %.lr.ph76.preheader ]
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %80 ], [ 1, %.lr.ph76.preheader ]
  %72 = getelementptr inbounds [51 x [5000 x i64]], ptr @a, i64 0, i64 %indvars.iv102, i64 %indvars.iv99
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %74 = add nsw i64 %71, %73
  store i64 %74, ptr %1, align 8, !tbaa !8
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %76 = load i64, ptr %75, align 8, !tbaa !8
  store i64 %76, ptr %2, align 8, !tbaa !8
  %77 = load i64, ptr %1, align 8, !tbaa !8
  %78 = icmp slt i64 %77, 0
  br i1 %78, label %79, label %80

79:                                               ; preds = %.lr.ph76
  store i64 0, ptr %1, align 8, !tbaa !8
  br label %80

80:                                               ; preds = %.lr.ph76, %79
  %81 = phi i64 [ %77, %.lr.ph76 ], [ 0, %79 ]
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %82 = load i64, ptr %22, align 8, !tbaa !8
  %83 = icmp sgt i64 %82, %indvars.iv.next100
  br i1 %83, label %.lr.ph76, label %._crit_edge77, !llvm.loop !16

._crit_edge85:                                    ; preds = %.lr.ph84, %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %84 = load i64, ptr getelementptr inbounds (i8, ptr @b, i64 8), align 8, !tbaa !8
  %85 = getelementptr inbounds [51 x i64], ptr @ssum, i64 0, i64 %84
  %86 = getelementptr inbounds [51 x i64], ptr @psum, i64 0, i64 %84
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %85, ptr noundef nonnull align 8 dereferenceable(8) %86)
  %88 = load i64, ptr getelementptr inbounds (i8, ptr @b, i64 8), align 8, !tbaa !8
  %89 = getelementptr inbounds [51 x i64], ptr @sum, i64 0, i64 %88
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %87, ptr noundef nonnull align 8 dereferenceable(8) %89)
  %91 = load i64, ptr %90, align 8, !tbaa !8
  store i64 %91, ptr %3, align 8, !tbaa !8
  %92 = load i64, ptr getelementptr inbounds (i8, ptr @b, i64 8), align 8, !tbaa !8
  %93 = getelementptr inbounds [51 x i64], ptr @best, i64 0, i64 %92
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %93)
  %95 = load i64, ptr %94, align 8, !tbaa !8
  store i64 %95, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %96 = load i64, ptr getelementptr inbounds (i8, ptr @b, i64 8), align 8, !tbaa !8
  %97 = getelementptr inbounds [51 x i64], ptr @sum, i64 0, i64 %96
  %98 = getelementptr inbounds [51 x i64], ptr @ssum, i64 0, i64 %96
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef nonnull align 8 dereferenceable(8) %98)
  %100 = load i64, ptr %99, align 8, !tbaa !8
  %spec.store.select1 = call i64 @llvm.smax.i64(i64 %100, i64 0)
  store i64 %spec.store.select1, ptr %4, align 8
  %101 = load i64, ptr @m, align 8, !tbaa !8
  %.not6486 = icmp slt i64 %101, 2
  br i1 %.not6486, label %._crit_edge90, label %.lr.ph89

.lr.ph84:                                         ; preds = %.preheader, %.lr.ph84
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %.lr.ph84 ], [ 1, %.preheader ]
  %102 = getelementptr inbounds [250010 x i64], ptr @b, i64 0, i64 %indvars.iv105
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %102)
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %104 = load i64, ptr @m, align 8, !tbaa !8
  %.not63.not = icmp sgt i64 %104, %indvars.iv105
  br i1 %.not63.not, label %.lr.ph84, label %._crit_edge85, !llvm.loop !17

._crit_edge90:                                    ; preds = %.lr.ph89, %._crit_edge85
  %105 = load i64, ptr %3, align 8, !tbaa !8
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %105)
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %106, ptr noundef nonnull @.str)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  ret i32 0

.lr.ph89:                                         ; preds = %._crit_edge85, %.lr.ph89
  %108 = phi i64 [ %spec.store.select, %.lr.ph89 ], [ %spec.store.select1, %._crit_edge85 ]
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.lr.ph89 ], [ 2, %._crit_edge85 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %109 = getelementptr inbounds [250010 x i64], ptr @b, i64 0, i64 %indvars.iv108
  %110 = load i64, ptr %109, align 8, !tbaa !8
  %111 = getelementptr inbounds [51 x i64], ptr @psum, i64 0, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !8
  %113 = add nsw i64 %112, %108
  store i64 %113, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %114 = getelementptr inbounds [51 x i64], ptr @sum, i64 0, i64 %110
  %115 = load i64, ptr %114, align 8, !tbaa !8
  %116 = add nsw i64 %115, %108
  store i64 %116, ptr %6, align 8, !tbaa !8
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %117)
  %119 = load i64, ptr %118, align 8, !tbaa !8
  store i64 %119, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  %120 = load i64, ptr %109, align 8, !tbaa !8
  %121 = getelementptr inbounds [51 x i64], ptr @sum, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !8
  %123 = load i64, ptr %4, align 8, !tbaa !8
  %124 = add nsw i64 %123, %122
  store i64 %124, ptr %4, align 8, !tbaa !8
  %125 = getelementptr inbounds [51 x i64], ptr @best, i64 0, i64 %120
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %125)
  %127 = load i64, ptr %126, align 8, !tbaa !8
  store i64 %127, ptr %3, align 8, !tbaa !8
  %128 = load i64, ptr %109, align 8, !tbaa !8
  %129 = getelementptr inbounds [51 x i64], ptr @ssum, i64 0, i64 %128
  %130 = getelementptr inbounds [51 x i64], ptr @sum, i64 0, i64 %128
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %129, ptr noundef nonnull align 8 dereferenceable(8) %130)
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %133 = load i64, ptr %132, align 8, !tbaa !8
  %spec.store.select = call i64 @llvm.smax.i64(i64 %133, i64 0)
  store i64 %spec.store.select, ptr %4, align 8
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %134 = load i64, ptr @m, align 8, !tbaa !8
  %.not64.not = icmp sgt i64 %134, %indvars.iv108
  br i1 %.not64.not, label %.lr.ph89, label %._crit_edge90, !llvm.loop !18
}

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #7

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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