; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2019-20/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::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::__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] }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@a = external dso_local global [26 x [26 x i32]], align 16
@dp = external dso_local global [200005 x i32], align 16
@bes = external dso_local global [26 x i32], align 16
@need = external dso_local global [26 x [200005 x i32]], align 16
@_Z1SB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", 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

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 norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %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
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %18 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %19 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %21
  %23 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  call void @_ZN5input2reIiJiiNSt7__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) @_Z1SB5cxx11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %24

24:                                               ; preds = %46, %0
  %25 = load i32, ptr %2, align 4, !tbaa !8
  %26 = load i32, ptr @M, align 4, !tbaa !8
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %49

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %30

30:                                               ; preds = %42, %29
  %31 = load i32, ptr %4, align 4, !tbaa !8
  %32 = load i32, ptr @M, align 4, !tbaa !8
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %45

35:                                               ; preds = %30
  %36 = load i32, ptr %2, align 4, !tbaa !8
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [26 x [26 x i32]], ptr @a, i64 0, i64 %37
  %39 = load i32, ptr %4, align 4, !tbaa !8
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [26 x i32], ptr %38, i64 0, i64 %40
  call void @_ZN5input2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %41)
  br label %42

42:                                               ; preds = %35
  %43 = load i32, ptr %4, align 4, !tbaa !8
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %4, align 4, !tbaa !8
  br label %30, !llvm.loop !11

45:                                               ; preds = %34
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %2, align 4, !tbaa !8
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %2, align 4, !tbaa !8
  br label %24, !llvm.loop !13

49:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %50

50:                                               ; preds = %98, %49
  %51 = load i32, ptr %5, align 4, !tbaa !8
  %52 = load i32, ptr @M, align 4, !tbaa !8
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

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

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

56:                                               ; preds = %94, %55
  %57 = load i32, ptr %6, align 4, !tbaa !8
  %58 = load i32, ptr @M, align 4, !tbaa !8
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %97

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

62:                                               ; preds = %90, %61
  %63 = load i32, ptr %7, align 4, !tbaa !8
  %64 = load i32, ptr @M, align 4, !tbaa !8
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %67, label %66

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

67:                                               ; preds = %62
  %68 = load i32, ptr %6, align 4, !tbaa !8
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [26 x [26 x i32]], ptr @a, i64 0, i64 %69
  %71 = load i32, ptr %7, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [26 x i32], ptr %70, i64 0, i64 %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %74 = load i32, ptr %6, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [26 x [26 x i32]], ptr @a, i64 0, i64 %75
  %77 = load i32, ptr %5, align 4, !tbaa !8
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [26 x i32], ptr %76, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !8
  %81 = load i32, ptr %5, align 4, !tbaa !8
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [26 x [26 x i32]], ptr @a, i64 0, i64 %82
  %84 = load i32, ptr %7, align 4, !tbaa !8
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [26 x i32], ptr %83, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !8
  %88 = add nsw i32 %80, %87
  store i32 %88, ptr %8, align 4, !tbaa !8
  %89 = call noundef zeroext i1 @_Z5ckminIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %73, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %90

90:                                               ; preds = %67
  %91 = load i32, ptr %7, align 4, !tbaa !8
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %7, align 4, !tbaa !8
  br label %62, !llvm.loop !14

93:                                               ; preds = %66
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %6, align 4, !tbaa !8
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %6, align 4, !tbaa !8
  br label %56, !llvm.loop !15

97:                                               ; preds = %60
  br label %98

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

101:                                              ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %102

102:                                              ; preds = %145, %101
  %103 = load i32, ptr %9, align 4, !tbaa !8
  %104 = load i32, ptr @M, align 4, !tbaa !8
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %148

107:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !8
  br label %108

108:                                              ; preds = %141, %107
  %109 = load i32, ptr %10, align 4, !tbaa !8
  %110 = load i32, ptr @N, align 4, !tbaa !8
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %144

113:                                              ; preds = %108
  %114 = load i32, ptr %9, align 4, !tbaa !8
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [26 x [200005 x i32]], ptr @need, i64 0, i64 %115
  %117 = load i32, ptr %10, align 4, !tbaa !8
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [200005 x i32], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !8
  %121 = load i32, ptr %10, align 4, !tbaa !8
  %122 = sext i32 %121 to i64
  %123 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %122)
  %124 = load i8, ptr %123, align 1, !tbaa !17
  %125 = sext i8 %124 to i32
  %126 = sub nsw i32 %125, 97
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [26 x [26 x i32]], ptr @a, i64 0, i64 %127
  %129 = load i32, ptr %9, align 4, !tbaa !8
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [26 x i32], ptr %128, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !8
  %133 = add nsw i32 %120, %132
  %134 = load i32, ptr %9, align 4, !tbaa !8
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [26 x [200005 x i32]], ptr @need, i64 0, i64 %135
  %137 = load i32, ptr %10, align 4, !tbaa !8
  %138 = add nsw i32 %137, 1
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [200005 x i32], ptr %136, i64 0, i64 %139
  store i32 %133, ptr %140, align 4, !tbaa !8
  br label %141

141:                                              ; preds = %113
  %142 = load i32, ptr %10, align 4, !tbaa !8
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %10, align 4, !tbaa !8
  br label %108, !llvm.loop !18

144:                                              ; preds = %112
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %9, align 4, !tbaa !8
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %9, align 4, !tbaa !8
  br label %102, !llvm.loop !19

148:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !8
  br label %149

149:                                              ; preds = %158, %148
  %150 = load i32, ptr %11, align 4, !tbaa !8
  %151 = load i32, ptr @M, align 4, !tbaa !8
  %152 = icmp slt i32 %150, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %149
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %161

154:                                              ; preds = %149
  %155 = load i32, ptr %11, align 4, !tbaa !8
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [26 x i32], ptr @bes, i64 0, i64 %156
  store i32 1000000007, ptr %157, align 4, !tbaa !8
  br label %158

158:                                              ; preds = %154
  %159 = load i32, ptr %11, align 4, !tbaa !8
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %11, align 4, !tbaa !8
  br label %149, !llvm.loop !20

161:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !8
  br label %162

162:                                              ; preds = %269, %161
  %163 = load i32, ptr %12, align 4, !tbaa !8
  %164 = load i32, ptr @N, align 4, !tbaa !8
  %165 = icmp slt i32 %163, %164
  br i1 %165, label %167, label %166

166:                                              ; preds = %162
  store i32 26, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %272

167:                                              ; preds = %162
  %168 = load i32, ptr %12, align 4, !tbaa !8
  %169 = add nsw i32 %168, 1
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [200005 x i32], ptr @dp, i64 0, i64 %170
  store i32 1000000007, ptr %171, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %172

172:                                              ; preds = %202, %167
  %173 = load i32, ptr %13, align 4, !tbaa !8
  %174 = load i32, ptr @M, align 4, !tbaa !8
  %175 = icmp slt i32 %173, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %172
  store i32 29, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %205

177:                                              ; preds = %172
  %178 = load i32, ptr %13, align 4, !tbaa !8
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [26 x i32], ptr @bes, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !8
  %182 = icmp ne i32 %181, 1000000007
  br i1 %182, label %183, label %201

183:                                              ; preds = %177
  %184 = load i32, ptr %12, align 4, !tbaa !8
  %185 = sext i32 %184 to i64
  %186 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %185)
  %187 = load i8, ptr %186, align 1, !tbaa !17
  %188 = sext i8 %187 to i32
  %189 = sub nsw i32 %188, 97
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [26 x [26 x i32]], ptr @a, i64 0, i64 %190
  %192 = load i32, ptr %13, align 4, !tbaa !8
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [26 x i32], ptr %191, i64 0, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !8
  %196 = load i32, ptr %13, align 4, !tbaa !8
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [26 x i32], ptr @bes, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !8
  %200 = add nsw i32 %199, %195
  store i32 %200, ptr %198, align 4, !tbaa !8
  br label %201

201:                                              ; preds = %183, %177
  br label %202

202:                                              ; preds = %201
  %203 = load i32, ptr %13, align 4, !tbaa !8
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %13, align 4, !tbaa !8
  br label %172, !llvm.loop !21

205:                                              ; preds = %176
  %206 = load i32, ptr %12, align 4, !tbaa !8
  %207 = load i32, ptr @K, align 4, !tbaa !8
  %208 = sub nsw i32 %207, 1
  %209 = icmp sge i32 %206, %208
  br i1 %209, label %210, label %250

210:                                              ; preds = %205
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %211 = load i32, ptr %12, align 4, !tbaa !8
  %212 = load i32, ptr @K, align 4, !tbaa !8
  %213 = sub nsw i32 %212, 1
  %214 = sub nsw i32 %211, %213
  store i32 %214, ptr %14, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !8
  br label %215

215:                                              ; preds = %246, %210
  %216 = load i32, ptr %15, align 4, !tbaa !8
  %217 = load i32, ptr @M, align 4, !tbaa !8
  %218 = icmp slt i32 %216, %217
  br i1 %218, label %220, label %219

219:                                              ; preds = %215
  store i32 32, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %249

220:                                              ; preds = %215
  %221 = load i32, ptr %15, align 4, !tbaa !8
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [26 x i32], ptr @bes, i64 0, i64 %222
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %224 = load i32, ptr %14, align 4, !tbaa !8
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [200005 x i32], ptr @dp, i64 0, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !8
  %228 = load i32, ptr %15, align 4, !tbaa !8
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [26 x [200005 x i32]], ptr @need, i64 0, i64 %229
  %231 = load i32, ptr %12, align 4, !tbaa !8
  %232 = add nsw i32 %231, 1
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [200005 x i32], ptr %230, i64 0, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !8
  %236 = add nsw i32 %227, %235
  %237 = load i32, ptr %15, align 4, !tbaa !8
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [26 x [200005 x i32]], ptr @need, i64 0, i64 %238
  %240 = load i32, ptr %14, align 4, !tbaa !8
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [200005 x i32], ptr %239, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !8
  %244 = sub nsw i32 %236, %243
  store i32 %244, ptr %16, align 4, !tbaa !8
  %245 = call noundef zeroext i1 @_Z5ckminIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %223, ptr noundef nonnull align 4 dereferenceable(4) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %246

246:                                              ; preds = %220
  %247 = load i32, ptr %15, align 4, !tbaa !8
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %15, align 4, !tbaa !8
  br label %215, !llvm.loop !22

249:                                              ; preds = %219
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %250

250:                                              ; preds = %249, %205
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !8
  br label %251

251:                                              ; preds = %265, %250
  %252 = load i32, ptr %17, align 4, !tbaa !8
  %253 = load i32, ptr @M, align 4, !tbaa !8
  %254 = icmp slt i32 %252, %253
  br i1 %254, label %256, label %255

255:                                              ; preds = %251
  store i32 35, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %268

256:                                              ; preds = %251
  %257 = load i32, ptr %12, align 4, !tbaa !8
  %258 = add nsw i32 %257, 1
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [200005 x i32], ptr @dp, i64 0, i64 %259
  %261 = load i32, ptr %17, align 4, !tbaa !8
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [26 x i32], ptr @bes, i64 0, i64 %262
  %264 = call noundef zeroext i1 @_Z5ckminIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %260, ptr noundef nonnull align 4 dereferenceable(4) %263)
  br label %265

265:                                              ; preds = %256
  %266 = load i32, ptr %17, align 4, !tbaa !8
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %17, align 4, !tbaa !8
  br label %251, !llvm.loop !23

268:                                              ; preds = %255
  br label %269

269:                                              ; preds = %268
  %270 = load i32, ptr %12, align 4, !tbaa !8
  %271 = add nsw i32 %270, 1
  store i32 %271, ptr %12, align 4, !tbaa !8
  br label %162, !llvm.loop !24

272:                                              ; preds = %166
  %273 = load i32, ptr @N, align 4, !tbaa !8
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [200005 x i32], ptr @dp, i64 0, i64 %274
  call void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %275)
  %276 = load i32, ptr %1, align 4
  ret i32 %276
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5input2reIiJiiNSt7__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)) #4

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

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

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

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


; 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::__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] }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@a = external dso_local global [26 x [26 x i32]], align 16
@dp = external dso_local global [200005 x i32], align 16
@bes = external dso_local global [26 x i32], align 16
@need = external dso_local local_unnamed_addr global [26 x [200005 x i32]], align 16
@_Z1SB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", 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

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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  tail call void @_ZN5input2reIiJiiNSt7__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) @_Z1SB5cxx11)
  %9 = load i32, ptr @M, align 4, !tbaa !8
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.preheader76, label %.preheader

.preheader76:                                     ; preds = %0, %._crit_edge
  %11 = phi i32 [ %14, %._crit_edge ], [ %9, %0 ]
  %indvars.iv113 = phi i64 [ %indvars.iv.next114, %._crit_edge ], [ 0, %0 ]
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %.preheader76.._crit_edge_crit_edge

.preheader76.._crit_edge_crit_edge:               ; preds = %.preheader76
  %.pre148 = sext i32 %11 to i64
  br label %._crit_edge

.preheader75:                                     ; preds = %._crit_edge
  %13 = icmp sgt i32 %14, 0
  br i1 %13, label %.preheader74, label %.preheader

._crit_edge:                                      ; preds = %.lr.ph, %.preheader76.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre148, %.preheader76.._crit_edge_crit_edge ], [ %18, %.lr.ph ]
  %14 = phi i32 [ %11, %.preheader76.._crit_edge_crit_edge ], [ %17, %.lr.ph ]
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %15 = icmp slt i64 %indvars.iv.next114, %.pre-phi
  br i1 %15, label %.preheader76, label %.preheader75, !llvm.loop !11

.lr.ph:                                           ; preds = %.preheader76, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader76 ]
  %16 = getelementptr inbounds [26 x [26 x i32]], ptr @a, i64 0, i64 %indvars.iv113, i64 %indvars.iv
  tail call void @_ZN5input2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %16)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr @M, align 4, !tbaa !8
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next, %18
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.preheader74:                                     ; preds = %.preheader75, %._crit_edge84
  %20 = phi i32 [ %29, %._crit_edge84 ], [ %14, %.preheader75 ]
  %indvars.iv122 = phi i64 [ %indvars.iv.next123, %._crit_edge84 ], [ 0, %.preheader75 ]
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.preheader73, label %._crit_edge84

.preheader72:                                     ; preds = %._crit_edge84
  %22 = icmp sgt i32 %29, 0
  br i1 %22, label %.preheader71.lr.ph, label %.preheader

.preheader71.lr.ph:                               ; preds = %.preheader72
  %23 = load i32, ptr @N, align 4, !tbaa !8
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.preheader71, label %.lr.ph91.preheader

.preheader73:                                     ; preds = %.preheader74, %._crit_edge82
  %25 = phi i32 [ %32, %._crit_edge82 ], [ %20, %.preheader74 ]
  %26 = phi i32 [ %33, %._crit_edge82 ], [ %20, %.preheader74 ]
  %indvars.iv119 = phi i64 [ %indvars.iv.next120, %._crit_edge82 ], [ 0, %.preheader74 ]
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph81, label %.preheader73.._crit_edge82_crit_edge

.preheader73.._crit_edge82_crit_edge:             ; preds = %.preheader73
  %.pre149 = sext i32 %26 to i64
  br label %._crit_edge82

.lr.ph81:                                         ; preds = %.preheader73
  %28 = getelementptr inbounds [26 x [26 x i32]], ptr @a, i64 0, i64 %indvars.iv119, i64 %indvars.iv122
  br label %35

._crit_edge84:                                    ; preds = %._crit_edge82, %.preheader74
  %29 = phi i32 [ %20, %.preheader74 ], [ %32, %._crit_edge82 ]
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next123, %30
  br i1 %31, label %.preheader74, label %.preheader72, !llvm.loop !15

._crit_edge82:                                    ; preds = %35, %.preheader73.._crit_edge82_crit_edge
  %.pre-phi150 = phi i64 [ %.pre149, %.preheader73.._crit_edge82_crit_edge ], [ %43, %35 ]
  %32 = phi i32 [ %25, %.preheader73.._crit_edge82_crit_edge ], [ %42, %35 ]
  %33 = phi i32 [ %26, %.preheader73.._crit_edge82_crit_edge ], [ %42, %35 ]
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %34 = icmp slt i64 %indvars.iv.next120, %.pre-phi150
  br i1 %34, label %.preheader73, label %._crit_edge84, !llvm.loop !16

35:                                               ; preds = %.lr.ph81, %35
  %indvars.iv116 = phi i64 [ 0, %.lr.ph81 ], [ %indvars.iv.next117, %35 ]
  %36 = getelementptr inbounds [26 x [26 x i32]], ptr @a, i64 0, i64 %indvars.iv119, i64 %indvars.iv116
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %37 = load i32, ptr %28, align 4, !tbaa !8
  %38 = getelementptr inbounds [26 x [26 x i32]], ptr @a, i64 0, i64 %indvars.iv122, i64 %indvars.iv116
  %39 = load i32, ptr %38, align 4, !tbaa !8
  %40 = add nsw i32 %39, %37
  store i32 %40, ptr %1, align 4, !tbaa !8
  %41 = call noundef zeroext i1 @_Z5ckminIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %36, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %42 = load i32, ptr @M, align 4, !tbaa !8
  %43 = sext i32 %42 to i64
  %44 = icmp slt i64 %indvars.iv.next117, %43
  br i1 %44, label %35, label %._crit_edge82, !llvm.loop !17

.preheader71:                                     ; preds = %.preheader71.lr.ph, %._crit_edge88
  %45 = phi i32 [ %52, %._crit_edge88 ], [ %29, %.preheader71.lr.ph ]
  %46 = phi i32 [ %53, %._crit_edge88 ], [ %23, %.preheader71.lr.ph ]
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %._crit_edge88 ], [ 0, %.preheader71.lr.ph ]
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph87, label %._crit_edge88

.lr.ph87:                                         ; preds = %.preheader71
  %.phi.trans.insert = getelementptr inbounds [26 x [200005 x i32]], ptr @need, i64 0, i64 %indvars.iv128, i64 0
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !8
  br label %56

.preheader70:                                     ; preds = %._crit_edge88
  %48 = icmp sgt i32 %52, 0
  br i1 %48, label %.lr.ph91.preheader, label %.preheader

.lr.ph91.preheader:                               ; preds = %.preheader71.lr.ph, %.preheader70
  %.lcssa77157 = phi i32 [ %52, %.preheader70 ], [ %29, %.preheader71.lr.ph ]
  %wide.trip.count = zext nneg i32 %.lcssa77157 to i64
  %min.iters.check = icmp ult i32 %.lcssa77157, 8
  br i1 %min.iters.check, label %.lr.ph91.preheader188, label %vector.ph

.lr.ph91.preheader188:                            ; preds = %middle.block, %.lr.ph91.preheader
  %indvars.iv131.ph = phi i64 [ 0, %.lr.ph91.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph91

vector.ph:                                        ; preds = %.lr.ph91.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %49 = getelementptr inbounds [26 x i32], ptr @bes, i64 0, i64 %index
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %49, align 16, !tbaa !8
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %50, align 16, !tbaa !8
  %index.next = add nuw i64 %index, 8
  %51 = icmp eq i64 %index.next, %n.vec
  br i1 %51, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader, label %.lr.ph91.preheader188

._crit_edge88.loopexit:                           ; preds = %56
  %.pre146 = load i32, ptr @M, align 4, !tbaa !8
  br label %._crit_edge88

._crit_edge88:                                    ; preds = %._crit_edge88.loopexit, %.preheader71
  %52 = phi i32 [ %.pre146, %._crit_edge88.loopexit ], [ %45, %.preheader71 ]
  %53 = phi i32 [ %66, %._crit_edge88.loopexit ], [ %46, %.preheader71 ]
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %54 = sext i32 %52 to i64
  %55 = icmp slt i64 %indvars.iv.next129, %54
  br i1 %55, label %.preheader71, label %.preheader70, !llvm.loop !21

56:                                               ; preds = %.lr.ph87, %56
  %57 = phi i32 [ %.pre, %.lr.ph87 ], [ %64, %56 ]
  %indvars.iv125 = phi i64 [ 0, %.lr.ph87 ], [ %indvars.iv.next126, %56 ]
  %58 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %indvars.iv125)
  %59 = load i8, ptr %58, align 1, !tbaa !22
  %60 = sext i8 %59 to i64
  %61 = add nsw i64 %60, -97
  %62 = getelementptr inbounds [26 x [26 x i32]], ptr @a, i64 0, i64 %61, i64 %indvars.iv128
  %63 = load i32, ptr %62, align 4, !tbaa !8
  %64 = add nsw i32 %63, %57
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %65 = getelementptr inbounds [26 x [200005 x i32]], ptr @need, i64 0, i64 %indvars.iv128, i64 %indvars.iv.next126
  store i32 %64, ptr %65, align 4, !tbaa !8
  %66 = load i32, ptr @N, align 4, !tbaa !8
  %67 = sext i32 %66 to i64
  %68 = icmp slt i64 %indvars.iv.next126, %67
  br i1 %68, label %56, label %._crit_edge88.loopexit, !llvm.loop !23

.preheader:                                       ; preds = %.lr.ph91, %middle.block, %0, %.preheader75, %.preheader72, %.preheader70
  %.lcssa77154 = phi i32 [ %52, %.preheader70 ], [ %29, %.preheader72 ], [ %14, %.preheader75 ], [ %9, %0 ], [ %.lcssa77157, %middle.block ], [ %.lcssa77157, %.lr.ph91 ]
  %69 = load i32, ptr @N, align 4, !tbaa !8
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.lr.ph103, label %.preheader.._crit_edge104_crit_edge

.preheader.._crit_edge104_crit_edge:              ; preds = %.preheader
  %.pre151 = sext i32 %69 to i64
  br label %._crit_edge104

.lr.ph91:                                         ; preds = %.lr.ph91.preheader188, %.lr.ph91
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %.lr.ph91 ], [ %indvars.iv131.ph, %.lr.ph91.preheader188 ]
  %71 = getelementptr inbounds [26 x i32], ptr @bes, i64 0, i64 %indvars.iv131
  store i32 1000000007, ptr %71, align 4, !tbaa !8
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph91, !llvm.loop !24

.loopexit:                                        ; preds = %.lr.ph101, %.loopexit69
  %72 = phi i32 [ %121, %.loopexit69 ], [ %125, %.lr.ph101 ]
  %73 = load i32, ptr @N, align 4, !tbaa !8
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next144, %74
  br i1 %75, label %.lr.ph103, label %._crit_edge104, !llvm.loop !25

._crit_edge104:                                   ; preds = %.loopexit, %.preheader.._crit_edge104_crit_edge
  %.pre-phi152 = phi i64 [ %.pre151, %.preheader.._crit_edge104_crit_edge ], [ %74, %.loopexit ]
  %76 = getelementptr inbounds [200005 x i32], ptr @dp, i64 0, i64 %.pre-phi152
  call void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %76)
  ret i32 0

.lr.ph103:                                        ; preds = %.preheader, %.loopexit
  %77 = phi i32 [ %72, %.loopexit ], [ %.lcssa77154, %.preheader ]
  %indvars.iv143 = phi i64 [ %indvars.iv.next144, %.loopexit ], [ 0, %.preheader ]
  %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
  %78 = getelementptr inbounds [200005 x i32], ptr @dp, i64 0, i64 %indvars.iv.next144
  store i32 1000000007, ptr %78, align 4, !tbaa !8
  %79 = icmp sgt i32 %77, 0
  br i1 %79, label %.lr.ph94, label %._crit_edge95

._crit_edge95:                                    ; preds = %99, %.lr.ph103
  %80 = phi i32 [ %77, %.lr.ph103 ], [ %100, %99 ]
  %81 = phi i32 [ %77, %.lr.ph103 ], [ %101, %99 ]
  %82 = load i32, ptr @K, align 4, !tbaa !8
  %83 = add nsw i32 %82, -1
  %84 = sext i32 %83 to i64
  %.not = icmp sge i64 %indvars.iv143, %84
  %85 = icmp sgt i32 %81, 0
  %or.cond = and i1 %.not, %85
  br i1 %or.cond, label %.lr.ph98, label %.loopexit69

.lr.ph94:                                         ; preds = %.lr.ph103, %99
  %86 = phi i32 [ %100, %99 ], [ %77, %.lr.ph103 ]
  %87 = phi i32 [ %101, %99 ], [ %77, %.lr.ph103 ]
  %indvars.iv134 = phi i64 [ %indvars.iv.next135, %99 ], [ 0, %.lr.ph103 ]
  %88 = getelementptr inbounds [26 x i32], ptr @bes, i64 0, i64 %indvars.iv134
  %89 = load i32, ptr %88, align 4, !tbaa !8
  %.not68 = icmp eq i32 %89, 1000000007
  br i1 %.not68, label %99, label %90

90:                                               ; preds = %.lr.ph94
  %91 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %indvars.iv143)
  %92 = load i8, ptr %91, align 1, !tbaa !22
  %93 = sext i8 %92 to i64
  %94 = add nsw i64 %93, -97
  %95 = getelementptr inbounds [26 x [26 x i32]], ptr @a, i64 0, i64 %94, i64 %indvars.iv134
  %96 = load i32, ptr %95, align 4, !tbaa !8
  %97 = load i32, ptr %88, align 4, !tbaa !8
  %98 = add nsw i32 %97, %96
  store i32 %98, ptr %88, align 4, !tbaa !8
  %.pre147 = load i32, ptr @M, align 4, !tbaa !8
  br label %99

99:                                               ; preds = %.lr.ph94, %90
  %100 = phi i32 [ %86, %.lr.ph94 ], [ %.pre147, %90 ]
  %101 = phi i32 [ %87, %.lr.ph94 ], [ %.pre147, %90 ]
  %indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1
  %102 = sext i32 %101 to i64
  %103 = icmp slt i64 %indvars.iv.next135, %102
  br i1 %103, label %.lr.ph94, label %._crit_edge95, !llvm.loop !26

.lr.ph98:                                         ; preds = %._crit_edge95
  %104 = trunc nuw nsw i64 %indvars.iv143 to i32
  %105 = sub nsw i32 %104, %83
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [200005 x i32], ptr @dp, i64 0, i64 %106
  br label %108

108:                                              ; preds = %.lr.ph98, %108
  %indvars.iv137 = phi i64 [ 0, %.lr.ph98 ], [ %indvars.iv.next138, %108 ]
  %109 = getelementptr inbounds [26 x i32], ptr @bes, i64 0, i64 %indvars.iv137
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %110 = load i32, ptr %107, align 4, !tbaa !8
  %111 = getelementptr inbounds [26 x [200005 x i32]], ptr @need, i64 0, i64 %indvars.iv137, i64 %indvars.iv.next144
  %112 = load i32, ptr %111, align 4, !tbaa !8
  %113 = add nsw i32 %112, %110
  %114 = getelementptr inbounds [26 x [200005 x i32]], ptr @need, i64 0, i64 %indvars.iv137, i64 %106
  %115 = load i32, ptr %114, align 4, !tbaa !8
  %116 = sub i32 %113, %115
  store i32 %116, ptr %2, align 4, !tbaa !8
  %117 = call noundef zeroext i1 @_Z5ckminIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %109, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %118 = load i32, ptr @M, align 4, !tbaa !8
  %119 = sext i32 %118 to i64
  %120 = icmp slt i64 %indvars.iv.next138, %119
  br i1 %120, label %108, label %.loopexit69, !llvm.loop !27

.loopexit69:                                      ; preds = %108, %._crit_edge95
  %121 = phi i32 [ %80, %._crit_edge95 ], [ %118, %108 ]
  %122 = icmp sgt i32 %121, 0
  br i1 %122, label %.lr.ph101, label %.loopexit

.lr.ph101:                                        ; preds = %.loopexit69, %.lr.ph101
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %.lr.ph101 ], [ 0, %.loopexit69 ]
  %123 = getelementptr inbounds [26 x i32], ptr @bes, i64 0, i64 %indvars.iv140
  %124 = call noundef zeroext i1 @_Z5ckminIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %78, ptr noundef nonnull align 4 dereferenceable(4) %123)
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %125 = load i32, ptr @M, align 4, !tbaa !8
  %126 = sext i32 %125 to i64
  %127 = icmp slt i64 %indvars.iv.next141, %126
  br i1 %127, label %.lr.ph101, label %.loopexit, !llvm.loop !28
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5input2reIiJiiNSt7__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 #4

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12, !13}
!16 = distinct !{!16, !12, !13}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !12, !13}
!22 = !{!10, !10, i64 0}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12, !20, !19}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}


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