; LLVM IR from Aryansh-S/USACO :: USACO/2019/Dec/Gold (moortal)

; 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::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.Floyd = type { [26 x [26 x i32]] }
%"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 }

@CLK = external dso_local global %"class.std::chrono::time_point", align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@_Z6secondB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@first = external dso_local global %struct.Floyd, align 4
@dist = external dso_local global [100005 x [26 x i32]], align 16
@dp = external dso_local global [100005 x [26 x i32]], align 16
@psum = external dso_local global [100005 x [26 x i32]], align 16
@mins = external dso_local global [100005 x i32], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = 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

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

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

; Function Attrs: nounwind
declare i64 @_ZNSt6chrono3_V212steady_clock3nowEv() #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::chrono::time_point", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.6)
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %19

14:                                               ; preds = %0
  %15 = load ptr, ptr @stdin, align 8, !tbaa !5
  %16 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.6, ptr noundef %15)
  %17 = load ptr, ptr @stdout, align 8, !tbaa !5
  %18 = call ptr @freopen(ptr noundef @.str.7, ptr noundef @.str.8, ptr noundef %17)
  br label %19

19:                                               ; preds = %14, %0
  %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)
  %25 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #9
  %26 = call i64 @_ZNSt6chrono3_V212steady_clock3nowEv() #9
  %27 = getelementptr inbounds %"class.std::chrono::time_point", ptr %2, i32 0, i32 0
  %28 = getelementptr inbounds %"class.std::chrono::duration", ptr %27, i32 0, i32 0
  store i64 %26, ptr %28, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @CLK, ptr align 8 %2, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #9
  call void @_ZN7aryansh9io_macros2inIiJiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) @m, ptr noundef nonnull align 4 dereferenceable(4) @k, ptr noundef nonnull align 8 dereferenceable(32) @_Z6secondB5cxx11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  %29 = load i32, ptr @m, align 4, !tbaa !14
  %30 = icmp sgt i32 0, %29
  %31 = zext i1 %30 to i32
  %32 = sub nsw i32 0, %31
  store i32 %32, ptr %3, align 4, !tbaa !14
  br label %33

33:                                               ; preds = %81, %19
  %34 = load i32, ptr %3, align 4, !tbaa !14
  %35 = load i32, ptr @m, align 4, !tbaa !14
  %36 = load i32, ptr @m, align 4, !tbaa !14
  %37 = icmp sgt i32 0, %36
  %38 = zext i1 %37 to i32
  %39 = sub nsw i32 %35, %38
  %40 = icmp ne i32 %34, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %33
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  br label %83

42:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  %43 = load i32, ptr @m, align 4, !tbaa !14
  %44 = icmp sgt i32 0, %43
  %45 = zext i1 %44 to i32
  %46 = sub nsw i32 0, %45
  store i32 %46, ptr %5, align 4, !tbaa !14
  br label %47

47:                                               ; preds = %69, %42
  %48 = load i32, ptr %5, align 4, !tbaa !14
  %49 = load i32, ptr @m, align 4, !tbaa !14
  %50 = load i32, ptr @m, align 4, !tbaa !14
  %51 = icmp sgt i32 0, %50
  %52 = zext i1 %51 to i32
  %53 = sub nsw i32 %49, %52
  %54 = icmp ne i32 %48, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %47
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  br label %71

56:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  call void @_ZN7aryansh9io_macros2inIivEEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %6)
  %57 = load i32, ptr %3, align 4, !tbaa !14
  %58 = load i32, ptr %5, align 4, !tbaa !14
  %59 = load i32, ptr %6, align 4, !tbaa !14
  call void @_ZN5FloydIiLi26EE4add_Eiii(ptr noundef nonnull align 4 dereferenceable(2704) @first, i32 noundef %57, i32 noundef %58, i32 noundef %59)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %60

60:                                               ; preds = %56
  %61 = load i32, ptr @m, align 4, !tbaa !14
  %62 = icmp sgt i32 0, %61
  br i1 %62, label %63, label %66

63:                                               ; preds = %60
  %64 = load i32, ptr %5, align 4, !tbaa !14
  %65 = add nsw i32 %64, -1
  store i32 %65, ptr %5, align 4, !tbaa !14
  br label %69

66:                                               ; preds = %60
  %67 = load i32, ptr %5, align 4, !tbaa !14
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %5, align 4, !tbaa !14
  br label %69

69:                                               ; preds = %66, %63
  %70 = phi ptr [ %5, %63 ], [ %5, %66 ]
  br label %47, !llvm.loop !16

71:                                               ; preds = %55
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr @m, align 4, !tbaa !14
  %74 = icmp sgt i32 0, %73
  br i1 %74, label %75, label %78

75:                                               ; preds = %72
  %76 = load i32, ptr %3, align 4, !tbaa !14
  %77 = add nsw i32 %76, -1
  store i32 %77, ptr %3, align 4, !tbaa !14
  br label %81

78:                                               ; preds = %72
  %79 = load i32, ptr %3, align 4, !tbaa !14
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %3, align 4, !tbaa !14
  br label %81

81:                                               ; preds = %78, %75
  %82 = phi ptr [ %3, %75 ], [ %3, %78 ]
  br label %33, !llvm.loop !18

83:                                               ; preds = %41
  call void @_ZN5FloydIiLi26EE3updEv(ptr noundef nonnull align 4 dereferenceable(2704) @first)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  %84 = load i32, ptr @n, align 4, !tbaa !14
  %85 = add nsw i32 %84, 1
  %86 = icmp sgt i32 1, %85
  %87 = zext i1 %86 to i32
  %88 = sub nsw i32 1, %87
  store i32 %88, ptr %7, align 4, !tbaa !14
  br label %89

89:                                               ; preds = %174, %83
  %90 = load i32, ptr %7, align 4, !tbaa !14
  %91 = load i32, ptr @n, align 4, !tbaa !14
  %92 = add nsw i32 %91, 1
  %93 = load i32, ptr @n, align 4, !tbaa !14
  %94 = add nsw i32 %93, 1
  %95 = icmp sgt i32 1, %94
  %96 = zext i1 %95 to i32
  %97 = sub nsw i32 %92, %96
  %98 = icmp ne i32 %90, %97
  br i1 %98, label %100, label %99

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

100:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %101 = load i32, ptr @m, align 4, !tbaa !14
  %102 = icmp sgt i32 0, %101
  %103 = zext i1 %102 to i32
  %104 = sub nsw i32 0, %103
  store i32 %104, ptr %8, align 4, !tbaa !14
  br label %105

105:                                              ; preds = %161, %100
  %106 = load i32, ptr %8, align 4, !tbaa !14
  %107 = load i32, ptr @m, align 4, !tbaa !14
  %108 = load i32, ptr @m, align 4, !tbaa !14
  %109 = icmp sgt i32 0, %108
  %110 = zext i1 %109 to i32
  %111 = sub nsw i32 %107, %110
  %112 = icmp ne i32 %106, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %105
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %163

114:                                              ; preds = %105
  %115 = load i32, ptr %7, align 4, !tbaa !14
  %116 = sub nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z6secondB5cxx11, i64 noundef %117)
  %119 = load i8, ptr %118, align 1, !tbaa !19
  %120 = sext i8 %119 to i32
  %121 = sub nsw i32 %120, 97
  %122 = load i32, ptr %8, align 4, !tbaa !14
  %123 = call noundef i32 @_ZN5FloydIiLi26EE5queryEii(ptr noundef nonnull align 4 dereferenceable(2704) @first, i32 noundef %121, i32 noundef %122)
  %124 = load i32, ptr %7, align 4, !tbaa !14
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100005 x [26 x i32]], ptr @dist, i64 0, i64 %125
  %127 = load i32, ptr %8, align 4, !tbaa !14
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [26 x i32], ptr %126, i64 0, i64 %128
  store i32 %123, ptr %129, align 4, !tbaa !14
  %130 = load i32, ptr %7, align 4, !tbaa !14
  %131 = sub nsw i32 %130, 1
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100005 x [26 x i32]], ptr @psum, i64 0, i64 %132
  %134 = load i32, ptr %8, align 4, !tbaa !14
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [26 x i32], ptr %133, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !14
  %138 = load i32, ptr %7, align 4, !tbaa !14
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [100005 x [26 x i32]], ptr @dist, i64 0, i64 %139
  %141 = load i32, ptr %8, align 4, !tbaa !14
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [26 x i32], ptr %140, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !14
  %145 = add nsw i32 %137, %144
  %146 = load i32, ptr %7, align 4, !tbaa !14
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [100005 x [26 x i32]], ptr @psum, i64 0, i64 %147
  %149 = load i32, ptr %8, align 4, !tbaa !14
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [26 x i32], ptr %148, i64 0, i64 %150
  store i32 %145, ptr %151, align 4, !tbaa !14
  br label %152

152:                                              ; preds = %114
  %153 = load i32, ptr @m, align 4, !tbaa !14
  %154 = icmp sgt i32 0, %153
  br i1 %154, label %155, label %158

155:                                              ; preds = %152
  %156 = load i32, ptr %8, align 4, !tbaa !14
  %157 = add nsw i32 %156, -1
  store i32 %157, ptr %8, align 4, !tbaa !14
  br label %161

158:                                              ; preds = %152
  %159 = load i32, ptr %8, align 4, !tbaa !14
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %8, align 4, !tbaa !14
  br label %161

161:                                              ; preds = %158, %155
  %162 = phi ptr [ %8, %155 ], [ %8, %158 ]
  br label %105, !llvm.loop !20

163:                                              ; preds = %113
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr @n, align 4, !tbaa !14
  %166 = add nsw i32 %165, 1
  %167 = icmp sgt i32 1, %166
  br i1 %167, label %168, label %171

168:                                              ; preds = %164
  %169 = load i32, ptr %7, align 4, !tbaa !14
  %170 = add nsw i32 %169, -1
  store i32 %170, ptr %7, align 4, !tbaa !14
  br label %174

171:                                              ; preds = %164
  %172 = load i32, ptr %7, align 4, !tbaa !14
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %7, align 4, !tbaa !14
  br label %174

174:                                              ; preds = %171, %168
  %175 = phi ptr [ %7, %168 ], [ %7, %171 ]
  br label %89, !llvm.loop !21

176:                                              ; preds = %99
  call void @llvm.memset.p0.i64(ptr align 16 @dp, i8 63, i64 10400520, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @mins, i8 63, i64 400020, i1 false)
  store i32 0, ptr @mins, align 16, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  %177 = load i32, ptr @n, align 4, !tbaa !14
  %178 = add nsw i32 %177, 1
  %179 = icmp sgt i32 1, %178
  %180 = zext i1 %179 to i32
  %181 = sub nsw i32 1, %180
  store i32 %181, ptr %9, align 4, !tbaa !14
  br label %182

182:                                              ; preds = %295, %176
  %183 = load i32, ptr %9, align 4, !tbaa !14
  %184 = load i32, ptr @n, align 4, !tbaa !14
  %185 = add nsw i32 %184, 1
  %186 = load i32, ptr @n, align 4, !tbaa !14
  %187 = add nsw i32 %186, 1
  %188 = icmp sgt i32 1, %187
  %189 = zext i1 %188 to i32
  %190 = sub nsw i32 %185, %189
  %191 = icmp ne i32 %183, %190
  br i1 %191, label %193, label %192

192:                                              ; preds = %182
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %297

193:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  %194 = load i32, ptr @m, align 4, !tbaa !14
  %195 = icmp sgt i32 0, %194
  %196 = zext i1 %195 to i32
  %197 = sub nsw i32 0, %196
  store i32 %197, ptr %10, align 4, !tbaa !14
  br label %198

198:                                              ; preds = %282, %193
  %199 = load i32, ptr %10, align 4, !tbaa !14
  %200 = load i32, ptr @m, align 4, !tbaa !14
  %201 = load i32, ptr @m, align 4, !tbaa !14
  %202 = icmp sgt i32 0, %201
  %203 = zext i1 %202 to i32
  %204 = sub nsw i32 %200, %203
  %205 = icmp ne i32 %199, %204
  br i1 %205, label %207, label %206

206:                                              ; preds = %198
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  br label %284

207:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  %208 = load i32, ptr %9, align 4, !tbaa !14
  %209 = sub nsw i32 %208, 1
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [100005 x [26 x i32]], ptr @dp, i64 0, i64 %210
  %212 = load i32, ptr %10, align 4, !tbaa !14
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [26 x i32], ptr %211, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !14
  %216 = load i32, ptr %9, align 4, !tbaa !14
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [100005 x [26 x i32]], ptr @dist, i64 0, i64 %217
  %219 = load i32, ptr %10, align 4, !tbaa !14
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [26 x i32], ptr %218, i64 0, i64 %220
  %222 = load i32, ptr %221, align 4, !tbaa !14
  %223 = add nsw i32 %215, %222
  store i32 %223, ptr %11, align 4, !tbaa !14
  %224 = load i32, ptr %9, align 4, !tbaa !14
  %225 = load i32, ptr @k, align 4, !tbaa !14
  %226 = icmp sge i32 %224, %225
  br i1 %226, label %227, label %253

227:                                              ; preds = %207
  %228 = load i32, ptr %9, align 4, !tbaa !14
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [100005 x [26 x i32]], ptr @psum, i64 0, i64 %229
  %231 = load i32, ptr %10, align 4, !tbaa !14
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [26 x i32], ptr %230, i64 0, i64 %232
  %234 = load i32, ptr %233, align 4, !tbaa !14
  %235 = load i32, ptr %9, align 4, !tbaa !14
  %236 = load i32, ptr @k, align 4, !tbaa !14
  %237 = sub nsw i32 %235, %236
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [100005 x [26 x i32]], ptr @psum, i64 0, i64 %238
  %240 = load i32, ptr %10, align 4, !tbaa !14
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [26 x i32], ptr %239, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !14
  %244 = sub nsw i32 %234, %243
  %245 = load i32, ptr %9, align 4, !tbaa !14
  %246 = load i32, ptr @k, align 4, !tbaa !14
  %247 = sub nsw i32 %245, %246
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [100005 x i32], ptr @mins, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !14
  %251 = add nsw i32 %244, %250
  %252 = call noundef zeroext i1 @_ZN7aryansh11math_macros5ckminIiiEEbRT_T0_(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef %251)
  br label %253

253:                                              ; preds = %227, %207
  %254 = load i32, ptr %9, align 4, !tbaa !14
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [100005 x [26 x i32]], ptr @dp, i64 0, i64 %255
  %257 = load i32, ptr %10, align 4, !tbaa !14
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [26 x i32], ptr %256, i64 0, i64 %258
  %260 = load i32, ptr %11, align 4, !tbaa !14
  %261 = call noundef zeroext i1 @_ZN7aryansh11math_macros5ckminIiiEEbRT_T0_(ptr noundef nonnull align 4 dereferenceable(4) %259, i32 noundef %260)
  %262 = load i32, ptr %9, align 4, !tbaa !14
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [100005 x i32], ptr @mins, i64 0, i64 %263
  %265 = load i32, ptr %9, align 4, !tbaa !14
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [100005 x [26 x i32]], ptr @dp, i64 0, i64 %266
  %268 = load i32, ptr %10, align 4, !tbaa !14
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [26 x i32], ptr %267, i64 0, i64 %269
  %271 = load i32, ptr %270, align 4, !tbaa !14
  %272 = call noundef zeroext i1 @_ZN7aryansh11math_macros5ckminIiiEEbRT_T0_(ptr noundef nonnull align 4 dereferenceable(4) %264, i32 noundef %271)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %273

273:                                              ; preds = %253
  %274 = load i32, ptr @m, align 4, !tbaa !14
  %275 = icmp sgt i32 0, %274
  br i1 %275, label %276, label %279

276:                                              ; preds = %273
  %277 = load i32, ptr %10, align 4, !tbaa !14
  %278 = add nsw i32 %277, -1
  store i32 %278, ptr %10, align 4, !tbaa !14
  br label %282

279:                                              ; preds = %273
  %280 = load i32, ptr %10, align 4, !tbaa !14
  %281 = add nsw i32 %280, 1
  store i32 %281, ptr %10, align 4, !tbaa !14
  br label %282

282:                                              ; preds = %279, %276
  %283 = phi ptr [ %10, %276 ], [ %10, %279 ]
  br label %198, !llvm.loop !22

284:                                              ; preds = %206
  br label %285

285:                                              ; preds = %284
  %286 = load i32, ptr @n, align 4, !tbaa !14
  %287 = add nsw i32 %286, 1
  %288 = icmp sgt i32 1, %287
  br i1 %288, label %289, label %292

289:                                              ; preds = %285
  %290 = load i32, ptr %9, align 4, !tbaa !14
  %291 = add nsw i32 %290, -1
  store i32 %291, ptr %9, align 4, !tbaa !14
  br label %295

292:                                              ; preds = %285
  %293 = load i32, ptr %9, align 4, !tbaa !14
  %294 = add nsw i32 %293, 1
  store i32 %294, ptr %9, align 4, !tbaa !14
  br label %295

295:                                              ; preds = %292, %289
  %296 = phi ptr [ %9, %289 ], [ %9, %292 ]
  br label %182, !llvm.loop !23

297:                                              ; preds = %192
  %298 = load i32, ptr @n, align 4, !tbaa !14
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [100005 x i32], ptr @mins, i64 0, i64 %299
  %301 = load i32, ptr %300, align 4, !tbaa !14
  call void @_ZN7aryansh9io_macros3outIivEEvT_(i32 noundef %301)
  %302 = load i32, ptr %1, align 4
  ret i32 %302
}

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5FloydIiLi26EE4add_Eiii(ptr noundef nonnull align 4 dereferenceable(2704), i32 noundef, i32 noundef, i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5FloydIiLi26EE3updEv(ptr noundef nonnull align 4 dereferenceable(2704)) #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN5FloydIiLi26EE5queryEii(ptr noundef nonnull align 4 dereferenceable(2704), i32 noundef, i32 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #4 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7aryansh9io_macros3outIivEEvT_(i32 noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "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 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { 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 = !{i64 0, i64 8, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !17}


; 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::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.Floyd = type { [26 x [26 x i32]] }
%"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 }

@CLK = external dso_local local_unnamed_addr global %"class.std::chrono::time_point", align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@_Z6secondB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@first = external dso_local global %struct.Floyd, align 4
@dist = external dso_local local_unnamed_addr global [100005 x [26 x i32]], align 16
@dp = external dso_local global [100005 x [26 x i32]], align 16
@psum = external dso_local local_unnamed_addr global [100005 x [26 x i32]], align 16
@mins = external dso_local global [100005 x i32], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = 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

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

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

; Function Attrs: nounwind
declare i64 @_ZNSt6chrono3_V212steady_clock3nowEv() local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.6)
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %9, label %4

4:                                                ; preds = %0
  %5 = load ptr, ptr @stdin, align 8, !tbaa !5
  %6 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.6, ptr noundef %5)
  %7 = load ptr, ptr @stdout, align 8, !tbaa !5
  %8 = tail call ptr @freopen(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, ptr noundef %7)
  br label %9

9:                                                ; preds = %4, %0
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !9
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = tail call i64 @_ZNSt6chrono3_V212steady_clock3nowEv() #9
  store i64 %16, ptr @CLK, align 8, !tbaa !11
  tail call void @_ZN7aryansh9io_macros2inIiJiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) @m, ptr noundef nonnull align 4 dereferenceable(4) @k, ptr noundef nonnull align 8 dereferenceable(32) @_Z6secondB5cxx11)
  %17 = load i32, ptr @m, align 4, !tbaa !13
  %.not5787 = icmp eq i32 %17, 0
  br i1 %.not5787, label %._crit_edge90, label %.preheader.preheader

.preheader.preheader:                             ; preds = %9
  %.lobit.neg = ashr i32 %17, 31
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %18 = phi i32 [ %24, %._crit_edge ], [ %17, %.preheader.preheader ]
  %.lobit.neg7389 = phi i32 [ %.lobit.neg73.pre-phi, %._crit_edge ], [ %.lobit.neg, %.preheader.preheader ]
  %.05488 = phi i32 [ %.155, %._crit_edge ], [ %.lobit.neg, %.preheader.preheader ]
  %.lobit.neg7483 = ashr i32 %18, 31
  %19 = add i32 %.lobit.neg7483, %18
  %.not7584 = icmp eq i32 %.lobit.neg7389, %19
  br i1 %.not7584, label %._crit_edge, label %.lr.ph

._crit_edge90:                                    ; preds = %._crit_edge, %9
  call void @_ZN5FloydIiLi26EE3updEv(ptr noundef nonnull align 4 dereferenceable(2704) @first)
  %20 = load i32, ptr @n, align 4, !tbaa !13
  %isnotneg = icmp sgt i32 %20, -1
  %21 = zext i1 %isnotneg to i32
  %22 = add nsw i32 %20, 1
  %.lobit59.neg97 = ashr i32 %20, 31
  %23 = add nsw i32 %22, %.lobit59.neg97
  %.not6098 = icmp eq i32 %23, %21
  br i1 %.not6098, label %._crit_edge102, label %.lr.ph101.preheader

.lr.ph101.preheader:                              ; preds = %._crit_edge90
  %.pre = load i32, ptr @m, align 4, !tbaa !13
  br label %.lr.ph101

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %.pre-phi127 = phi i32 [ %19, %.preheader ], [ %27, %.lr.ph ]
  %.lobit.neg73.pre-phi = phi i32 [ %.lobit.neg7483, %.preheader ], [ %.lobit.neg74, %.lr.ph ]
  %24 = phi i32 [ %18, %.preheader ], [ %26, %.lr.ph ]
  %.inv76 = icmp sgt i32 %24, -1
  %.155.v = select i1 %.inv76, i32 1, i32 -1
  %.155 = add nsw i32 %.155.v, %.05488
  %.not57 = icmp eq i32 %.155, %.pre-phi127
  br i1 %.not57, label %._crit_edge90, label %.preheader, !llvm.loop !15

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.05285 = phi i32 [ %.153, %.lr.ph ], [ %.lobit.neg7389, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  call void @_ZN7aryansh9io_macros2inIivEEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %1)
  %25 = load i32, ptr %1, align 4, !tbaa !13
  call void @_ZN5FloydIiLi26EE4add_Eiii(ptr noundef nonnull align 4 dereferenceable(2704) @first, i32 noundef %.05488, i32 noundef %.05285, i32 noundef %25)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  %26 = load i32, ptr @m, align 4, !tbaa !13
  %.inv = icmp sgt i32 %26, -1
  %.153.v = select i1 %.inv, i32 1, i32 -1
  %.153 = add nsw i32 %.153.v, %.05285
  %.lobit.neg74 = ashr i32 %26, 31
  %27 = add i32 %.lobit.neg74, %26
  %.not75 = icmp eq i32 %.153, %27
  br i1 %.not75, label %._crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge102.loopexit:                          ; preds = %._crit_edge96
  %.pre124 = zext i1 %.inv78 to i32
  br label %._crit_edge102

._crit_edge102:                                   ; preds = %._crit_edge102.loopexit, %._crit_edge90
  %.pre-phi126 = phi i32 [ %37, %._crit_edge102.loopexit ], [ %23, %._crit_edge90 ]
  %.pre-phi = phi i32 [ %.pre124, %._crit_edge102.loopexit ], [ %21, %._crit_edge90 ]
  %28 = phi i32 [ %34, %._crit_edge102.loopexit ], [ %20, %._crit_edge90 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10400520) @dp, i8 63, i64 10400520, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400020) @mins, i8 63, i64 400020, i1 false)
  store i32 0, ptr @mins, align 16, !tbaa !13
  %.not64111 = icmp eq i32 %.pre-phi126, %.pre-phi
  br i1 %.not64111, label %._crit_edge115, label %.lr.ph114.preheader

.lr.ph114.preheader:                              ; preds = %._crit_edge102
  %.pre121 = load i32, ptr @m, align 4, !tbaa !13
  br label %.lr.ph114

.lr.ph101:                                        ; preds = %.lr.ph101.preheader, %._crit_edge96
  %29 = phi i32 [ %34, %._crit_edge96 ], [ %20, %.lr.ph101.preheader ]
  %30 = phi i32 [ %35, %._crit_edge96 ], [ %.pre, %.lr.ph101.preheader ]
  %.05099 = phi i32 [ %.151, %._crit_edge96 ], [ %21, %.lr.ph101.preheader ]
  %.not7192 = icmp eq i32 %30, 0
  br i1 %.not7192, label %._crit_edge96, label %.lr.ph95

.lr.ph95:                                         ; preds = %.lr.ph101
  %.lobit69.neg = ashr i32 %30, 31
  %31 = add nsw i32 %.05099, -1
  %32 = sext i32 %31 to i64
  %33 = sext i32 %.05099 to i64
  br label %38

._crit_edge96.loopexit:                           ; preds = %38
  %.pre120 = load i32, ptr @n, align 4, !tbaa !13
  br label %._crit_edge96

._crit_edge96:                                    ; preds = %._crit_edge96.loopexit, %.lr.ph101
  %34 = phi i32 [ %.pre120, %._crit_edge96.loopexit ], [ %29, %.lr.ph101 ]
  %35 = phi i32 [ %50, %._crit_edge96.loopexit ], [ 0, %.lr.ph101 ]
  %.inv78 = icmp sgt i32 %34, -1
  %.151.v = select i1 %.inv78, i32 1, i32 -1
  %.151 = add nsw i32 %.151.v, %.05099
  %36 = add nsw i32 %34, 1
  %.lobit59.neg = ashr i32 %34, 31
  %37 = add nsw i32 %36, %.lobit59.neg
  %.not60 = icmp eq i32 %.151, %37
  br i1 %.not60, label %._crit_edge102.loopexit, label %.lr.ph101, !llvm.loop !18

38:                                               ; preds = %.lr.ph95, %38
  %.04893 = phi i32 [ %.lobit69.neg, %.lr.ph95 ], [ %.149, %38 ]
  %39 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z6secondB5cxx11, i64 noundef %32)
  %40 = load i8, ptr %39, align 1, !tbaa !19
  %41 = sext i8 %40 to i32
  %42 = add nsw i32 %41, -97
  %43 = call noundef i32 @_ZN5FloydIiLi26EE5queryEii(ptr noundef nonnull align 4 dereferenceable(2704) @first, i32 noundef %42, i32 noundef %.04893)
  %44 = sext i32 %.04893 to i64
  %45 = getelementptr inbounds [100005 x [26 x i32]], ptr @dist, i64 0, i64 %33, i64 %44
  store i32 %43, ptr %45, align 4, !tbaa !13
  %46 = getelementptr inbounds [100005 x [26 x i32]], ptr @psum, i64 0, i64 %32, i64 %44
  %47 = load i32, ptr %46, align 4, !tbaa !13
  %48 = add nsw i32 %47, %43
  %49 = getelementptr inbounds [100005 x [26 x i32]], ptr @psum, i64 0, i64 %33, i64 %44
  store i32 %48, ptr %49, align 4, !tbaa !13
  %50 = load i32, ptr @m, align 4, !tbaa !13
  %.inv77 = icmp sgt i32 %50, -1
  %.149.v = select i1 %.inv77, i32 1, i32 -1
  %.149 = add nsw i32 %.149.v, %.04893
  %.lobit70.neg = ashr i32 %50, 31
  %51 = add i32 %.lobit70.neg, %50
  %.not71 = icmp eq i32 %.149, %51
  br i1 %.not71, label %._crit_edge96.loopexit, label %38, !llvm.loop !20

._crit_edge115:                                   ; preds = %._crit_edge109, %._crit_edge102
  %.lcssa = phi i32 [ %28, %._crit_edge102 ], [ %61, %._crit_edge109 ]
  %52 = sext i32 %.lcssa to i64
  %53 = getelementptr inbounds [100005 x i32], ptr @mins, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !13
  call void @_ZN7aryansh9io_macros3outIivEEvT_(i32 noundef %54)
  ret i32 0

.lr.ph114:                                        ; preds = %.lr.ph114.preheader, %._crit_edge109
  %55 = phi i32 [ %61, %._crit_edge109 ], [ %28, %.lr.ph114.preheader ]
  %56 = phi i32 [ %62, %._crit_edge109 ], [ %.pre121, %.lr.ph114.preheader ]
  %.046112 = phi i32 [ %.147, %._crit_edge109 ], [ %.pre-phi, %.lr.ph114.preheader ]
  %.not67105 = icmp eq i32 %56, 0
  br i1 %.not67105, label %._crit_edge109, label %.lr.ph108

.lr.ph108:                                        ; preds = %.lr.ph114
  %.lobit65.neg = ashr i32 %56, 31
  %57 = add nsw i32 %.046112, -1
  %58 = sext i32 %57 to i64
  %59 = sext i32 %.046112 to i64
  %60 = getelementptr inbounds [100005 x i32], ptr @mins, i64 0, i64 %59
  br label %65

._crit_edge109.loopexit:                          ; preds = %85
  %.pre123 = load i32, ptr @n, align 4, !tbaa !13
  br label %._crit_edge109

._crit_edge109:                                   ; preds = %._crit_edge109.loopexit, %.lr.ph114
  %61 = phi i32 [ %.pre123, %._crit_edge109.loopexit ], [ %55, %.lr.ph114 ]
  %62 = phi i32 [ %91, %._crit_edge109.loopexit ], [ 0, %.lr.ph114 ]
  %.inv80 = icmp sgt i32 %61, -1
  %.147.v = select i1 %.inv80, i32 1, i32 -1
  %.147 = add nsw i32 %.147.v, %.046112
  %63 = add nsw i32 %61, 1
  %.lobit63.neg = ashr i32 %61, 31
  %64 = add nsw i32 %63, %.lobit63.neg
  %.not64 = icmp eq i32 %.147, %64
  br i1 %.not64, label %._crit_edge115, label %.lr.ph114, !llvm.loop !21

65:                                               ; preds = %.lr.ph108, %85
  %.0106 = phi i32 [ %.lobit65.neg, %.lr.ph108 ], [ %.1, %85 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %66 = sext i32 %.0106 to i64
  %67 = getelementptr inbounds [100005 x [26 x i32]], ptr @dp, i64 0, i64 %58, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !13
  %69 = getelementptr inbounds [100005 x [26 x i32]], ptr @dist, i64 0, i64 %59, i64 %66
  %70 = load i32, ptr %69, align 4, !tbaa !13
  %71 = add nsw i32 %70, %68
  store i32 %71, ptr %2, align 4, !tbaa !13
  %72 = load i32, ptr @k, align 4, !tbaa !13
  %.not68 = icmp slt i32 %.046112, %72
  br i1 %.not68, label %85, label %73

73:                                               ; preds = %65
  %74 = getelementptr inbounds [100005 x [26 x i32]], ptr @psum, i64 0, i64 %59, i64 %66
  %75 = load i32, ptr %74, align 4, !tbaa !13
  %76 = sub nsw i32 %.046112, %72
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100005 x [26 x i32]], ptr @psum, i64 0, i64 %77, i64 %66
  %79 = load i32, ptr %78, align 4, !tbaa !13
  %80 = sub i32 %75, %79
  %81 = getelementptr inbounds [100005 x i32], ptr @mins, i64 0, i64 %77
  %82 = load i32, ptr %81, align 4, !tbaa !13
  %83 = add nsw i32 %80, %82
  %84 = call noundef zeroext i1 @_ZN7aryansh11math_macros5ckminIiiEEbRT_T0_(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %83)
  %.pre122 = load i32, ptr %2, align 4, !tbaa !13
  br label %85

85:                                               ; preds = %73, %65
  %86 = phi i32 [ %.pre122, %73 ], [ %71, %65 ]
  %87 = getelementptr inbounds [100005 x [26 x i32]], ptr @dp, i64 0, i64 %59, i64 %66
  %88 = call noundef zeroext i1 @_ZN7aryansh11math_macros5ckminIiiEEbRT_T0_(ptr noundef nonnull align 4 dereferenceable(4) %87, i32 noundef %86)
  %89 = load i32, ptr %87, align 4, !tbaa !13
  %90 = call noundef zeroext i1 @_ZN7aryansh11math_macros5ckminIiiEEbRT_T0_(ptr noundef nonnull align 4 dereferenceable(4) %60, i32 noundef %89)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  %91 = load i32, ptr @m, align 4, !tbaa !13
  %.inv79 = icmp sgt i32 %91, -1
  %.1.v = select i1 %.inv79, i32 1, i32 -1
  %.1 = add nsw i32 %.1.v, %.0106
  %.lobit66.neg = ashr i32 %91, 31
  %92 = add i32 %.lobit66.neg, %91
  %.not67 = icmp eq i32 %.1, %92
  br i1 %.not67, label %._crit_edge109.loopexit, label %65, !llvm.loop !22
}

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5FloydIiLi26EE4add_Eiii(ptr noundef nonnull align 4 dereferenceable(2704), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5FloydIiLi26EE3updEv(ptr noundef nonnull align 4 dereferenceable(2704)) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN5FloydIiLi26EE5queryEii(ptr noundef nonnull align 4 dereferenceable(2704), i32 noundef, i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7aryansh9io_macros3outIivEEvT_(i32 noundef) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "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 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 #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { 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 #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { 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 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}
!22 = distinct !{!22, !16}


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