; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/393 Division 1/Problem D (D)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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] }

@dp = external dso_local global [5100 x [26 x i64]], align 16
@charsum = external dso_local global [5100 x [26 x i64]], align 16
@sum = external dso_local global [5100 x i64], align 16
@sumsum = external dso_local global [5100 x i64], align 16
@last = external dso_local global [26 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca ptr, align 8
  %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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  %11 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %12 unwind label %18

12:                                               ; preds = %0
  store i64 1, ptr @sumsum, align 16, !tbaa !5
  store i64 1, ptr @sum, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %201, %12
  %14 = load i32, ptr %6, align 4, !tbaa !9
  %15 = load i32, ptr %2, align 4, !tbaa !9
  %16 = icmp sle i32 %14, %15
  br i1 %16, label %22, label %17

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

18:                                               ; preds = %210, %204, %0
  %19 = landingpad { ptr, i32 }
          cleanup
  %20 = extractvalue { ptr, i32 } %19, 0
  store ptr %20, ptr %4, align 8
  %21 = extractvalue { ptr, i32 } %19, 1
  store i32 %21, ptr %5, align 4
  br label %214

22:                                               ; preds = %13
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = sub nsw i32 %24, 1
  %26 = sext i32 %25 to i64
  %27 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %26)
          to label %28 unwind label %38

28:                                               ; preds = %22
  %29 = load i8, ptr %27, align 1, !tbaa !11
  %30 = sext i8 %29 to i32
  %31 = sub nsw i32 %30, 97
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [26 x i32], ptr @last, i64 0, i64 %32
  store i32 %23, ptr %33, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %97, %28
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = icmp slt i32 %35, 26
  br i1 %36, label %42, label %37

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

38:                                               ; preds = %22
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %4, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %214

42:                                               ; preds = %34
  %43 = load i32, ptr %8, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [26 x i32], ptr @last, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = load i32, ptr %6, align 4, !tbaa !9
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %49, label %96

49:                                               ; preds = %42
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [26 x i32], ptr @last, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = sub nsw i32 %53, 1
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [5100 x i64], ptr @sumsum, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = load i32, ptr %8, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [26 x i32], ptr @last, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !9
  %62 = sub nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [5100 x [26 x i64]], ptr @charsum, i64 0, i64 %63
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [26 x i64], ptr %64, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !5
  %69 = sub nsw i64 %57, %68
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [5100 x [26 x i64]], ptr @dp, i64 0, i64 %71
  %73 = load i32, ptr %8, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [26 x i64], ptr %72, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = add nsw i64 %76, %69
  store i64 %77, ptr %75, align 8, !tbaa !5
  %78 = load i32, ptr %6, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [5100 x [26 x i64]], ptr @dp, i64 0, i64 %79
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [26 x i64], ptr %80, i64 0, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = icmp sge i64 %84, 1000000007
  br i1 %85, label %86, label %95

86:                                               ; preds = %49
  %87 = load i32, ptr %6, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [5100 x [26 x i64]], ptr @dp, i64 0, i64 %88
  %90 = load i32, ptr %8, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [26 x i64], ptr %89, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !5
  %94 = sub nsw i64 %93, 1000000007
  store i64 %94, ptr %92, align 8, !tbaa !5
  br label %95

95:                                               ; preds = %86, %49
  br label %96

96:                                               ; preds = %95, %42
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %8, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %8, align 4, !tbaa !9
  br label %34, !llvm.loop !12

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

101:                                              ; preds = %170, %100
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = icmp slt i32 %102, 26
  br i1 %103, label %105, label %104

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

105:                                              ; preds = %101
  %106 = load i32, ptr %6, align 4, !tbaa !9
  %107 = sub nsw i32 %106, 1
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [5100 x [26 x i64]], ptr @charsum, i64 0, i64 %108
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [26 x i64], ptr %109, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !5
  %114 = load i32, ptr %6, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [5100 x [26 x i64]], ptr @dp, i64 0, i64 %115
  %117 = load i32, ptr %9, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [26 x i64], ptr %116, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !5
  %121 = add nsw i64 %113, %120
  %122 = load i32, ptr %6, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [5100 x [26 x i64]], ptr @charsum, i64 0, i64 %123
  %125 = load i32, ptr %9, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [26 x i64], ptr %124, i64 0, i64 %126
  store i64 %121, ptr %127, align 8, !tbaa !5
  %128 = load i32, ptr %6, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [5100 x [26 x i64]], ptr @charsum, i64 0, i64 %129
  %131 = load i32, ptr %9, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [26 x i64], ptr %130, i64 0, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !5
  %135 = icmp sge i64 %134, 1000000007
  br i1 %135, label %136, label %145

136:                                              ; preds = %105
  %137 = load i32, ptr %6, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [5100 x [26 x i64]], ptr @charsum, i64 0, i64 %138
  %140 = load i32, ptr %9, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [26 x i64], ptr %139, i64 0, i64 %141
  %143 = load i64, ptr %142, align 8, !tbaa !5
  %144 = sub nsw i64 %143, 1000000007
  store i64 %144, ptr %142, align 8, !tbaa !5
  br label %145

145:                                              ; preds = %136, %105
  %146 = load i32, ptr %6, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [5100 x [26 x i64]], ptr @dp, i64 0, i64 %147
  %149 = load i32, ptr %9, align 4, !tbaa !9
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [26 x i64], ptr %148, i64 0, i64 %150
  %152 = load i64, ptr %151, align 8, !tbaa !5
  %153 = load i32, ptr %6, align 4, !tbaa !9
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [5100 x i64], ptr @sum, i64 0, i64 %154
  %156 = load i64, ptr %155, align 8, !tbaa !5
  %157 = add nsw i64 %156, %152
  store i64 %157, ptr %155, align 8, !tbaa !5
  %158 = load i32, ptr %6, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [5100 x i64], ptr @sum, i64 0, i64 %159
  %161 = load i64, ptr %160, align 8, !tbaa !5
  %162 = icmp sge i64 %161, 1000000007
  br i1 %162, label %163, label %169

163:                                              ; preds = %145
  %164 = load i32, ptr %6, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [5100 x i64], ptr @sum, i64 0, i64 %165
  %167 = load i64, ptr %166, align 8, !tbaa !5
  %168 = sub nsw i64 %167, 1000000007
  store i64 %168, ptr %166, align 8, !tbaa !5
  br label %169

169:                                              ; preds = %163, %145
  br label %170

170:                                              ; preds = %169
  %171 = load i32, ptr %9, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %9, align 4, !tbaa !9
  br label %101, !llvm.loop !14

173:                                              ; preds = %104
  %174 = load i32, ptr %6, align 4, !tbaa !9
  %175 = sub nsw i32 %174, 1
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [5100 x i64], ptr @sumsum, i64 0, i64 %176
  %178 = load i64, ptr %177, align 8, !tbaa !5
  %179 = load i32, ptr %6, align 4, !tbaa !9
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [5100 x i64], ptr @sum, i64 0, i64 %180
  %182 = load i64, ptr %181, align 8, !tbaa !5
  %183 = add nsw i64 %178, %182
  %184 = load i32, ptr %6, align 4, !tbaa !9
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [5100 x i64], ptr @sumsum, i64 0, i64 %185
  %187 = load i64, ptr %186, align 8, !tbaa !5
  %188 = add nsw i64 %187, %183
  store i64 %188, ptr %186, align 8, !tbaa !5
  %189 = load i32, ptr %6, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [5100 x i64], ptr @sumsum, i64 0, i64 %190
  %192 = load i64, ptr %191, align 8, !tbaa !5
  %193 = icmp sge i64 %192, 1000000007
  br i1 %193, label %194, label %200

194:                                              ; preds = %173
  %195 = load i32, ptr %6, align 4, !tbaa !9
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [5100 x i64], ptr @sumsum, i64 0, i64 %196
  %198 = load i64, ptr %197, align 8, !tbaa !5
  %199 = sub nsw i64 %198, 1000000007
  store i64 %199, ptr %197, align 8, !tbaa !5
  br label %200

200:                                              ; preds = %194, %173
  br label %201

201:                                              ; preds = %200
  %202 = load i32, ptr %6, align 4, !tbaa !9
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %6, align 4, !tbaa !9
  br label %13, !llvm.loop !15

204:                                              ; preds = %17
  %205 = load i32, ptr %2, align 4, !tbaa !9
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [5100 x i64], ptr @sum, i64 0, i64 %206
  %208 = load i64, ptr %207, align 8, !tbaa !5
  %209 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %208)
          to label %210 unwind label %18

210:                                              ; preds = %204
  %211 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %209, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %212 unwind label %18

212:                                              ; preds = %210
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %213 = load i32, ptr %1, align 4
  ret i32 %213

214:                                              ; preds = %38, %18
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %215

215:                                              ; preds = %214
  %216 = load ptr, ptr %4, align 8
  %217 = load i32, ptr %5, align 4
  %218 = insertvalue { ptr, i32 } poison, ptr %216, 0
  %219 = insertvalue { ptr, i32 } %218, i32 %217, 1
  resume { ptr, i32 } %219
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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

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

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


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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] }

@dp = external dso_local local_unnamed_addr global [5100 x [26 x i64]], align 16
@charsum = external dso_local local_unnamed_addr global [5100 x [26 x i64]], align 16
@sum = external dso_local local_unnamed_addr global [5100 x i64], align 16
@sumsum = external dso_local local_unnamed_addr global [5100 x i64], align 16
@last = external dso_local local_unnamed_addr global [26 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %3 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  %4 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %5 unwind label %10

5:                                                ; preds = %0
  store i64 1, ptr @sumsum, align 16, !tbaa !5
  store i64 1, ptr @sum, align 16, !tbaa !5
  %6 = load i32, ptr %1, align 4, !tbaa !9
  %.not57 = icmp slt i32 %6, 1
  br i1 %.not57, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %5
  %.pre = sext i32 %6 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %39, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %49, %39 ]
  %7 = getelementptr inbounds [5100 x i64], ptr @sum, i64 0, i64 %.pre-phi
  %8 = load i64, ptr %7, align 8, !tbaa !5
  %9 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %8)
          to label %62 unwind label %10

10:                                               ; preds = %62, %._crit_edge, %0
  %11 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %11

.lr.ph:                                           ; preds = %5, %39
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %39 ], [ 1, %5 ]
  %12 = add nsw i64 %indvars.iv65, -1
  %13 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %12)
  %14 = load i8, ptr %13, align 1, !tbaa !11
  %15 = sext i8 %14 to i64
  %16 = add nsw i64 %15, -97
  %17 = getelementptr inbounds [26 x i32], ptr @last, i64 0, i64 %16
  %18 = trunc nuw nsw i64 %indvars.iv65 to i32
  store i32 %18, ptr %17, align 4, !tbaa !9
  br label %20

.preheader:                                       ; preds = %38
  %19 = getelementptr inbounds [5100 x i64], ptr @sum, i64 0, i64 %indvars.iv65
  %.promoted = load i64, ptr %19, align 8, !tbaa !5
  br label %50

20:                                               ; preds = %.lr.ph, %38
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %38 ]
  %21 = getelementptr inbounds [26 x i32], ptr @last, i64 0, i64 %indvars.iv
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = sext i32 %22 to i64
  %.not51 = icmp slt i64 %indvars.iv65, %23
  br i1 %.not51, label %38, label %24

24:                                               ; preds = %20
  %25 = add nsw i32 %22, -1
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [5100 x i64], ptr @sumsum, i64 0, i64 %26
  %28 = load i64, ptr %27, align 8, !tbaa !5
  %29 = getelementptr inbounds [5100 x [26 x i64]], ptr @charsum, i64 0, i64 %26, i64 %indvars.iv
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = sub nsw i64 %28, %30
  %32 = getelementptr inbounds [5100 x [26 x i64]], ptr @dp, i64 0, i64 %indvars.iv65, i64 %indvars.iv
  %33 = load i64, ptr %32, align 8, !tbaa !5
  %34 = add nsw i64 %33, %31
  store i64 %34, ptr %32, align 8, !tbaa !5
  %35 = icmp sgt i64 %34, 1000000006
  br i1 %35, label %36, label %38

36:                                               ; preds = %24
  %37 = add nsw i64 %34, -1000000007
  store i64 %37, ptr %32, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %20, %36, %24
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 26
  br i1 %exitcond.not, label %.preheader, label %20, !llvm.loop !12

39:                                               ; preds = %50
  store i64 %storemerge50, ptr %19, align 8, !tbaa !5
  %40 = getelementptr inbounds [5100 x i64], ptr @sumsum, i64 0, i64 %12
  %41 = load i64, ptr %40, align 8, !tbaa !5
  %42 = add nsw i64 %storemerge50, %41
  %43 = getelementptr inbounds [5100 x i64], ptr @sumsum, i64 0, i64 %indvars.iv65
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = add nsw i64 %42, %44
  %46 = icmp sgt i64 %45, 1000000006
  %47 = add nsw i64 %45, -1000000007
  %spec.select = select i1 %46, i64 %47, i64 %45
  store i64 %spec.select, ptr %43, align 8, !tbaa !5
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %48 = load i32, ptr %1, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %.not.not = icmp slt i64 %indvars.iv65, %49
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !14

50:                                               ; preds = %.preheader, %50
  %indvars.iv61 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next62, %50 ]
  %storemerge505455 = phi i64 [ %.promoted, %.preheader ], [ %storemerge50, %50 ]
  %51 = getelementptr inbounds [5100 x [26 x i64]], ptr @charsum, i64 0, i64 %12, i64 %indvars.iv61
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = getelementptr inbounds [5100 x [26 x i64]], ptr @dp, i64 0, i64 %indvars.iv65, i64 %indvars.iv61
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = add nsw i64 %54, %52
  %56 = getelementptr inbounds [5100 x [26 x i64]], ptr @charsum, i64 0, i64 %indvars.iv65, i64 %indvars.iv61
  %57 = icmp sgt i64 %55, 1000000006
  %58 = add nsw i64 %55, -1000000007
  %spec.select52 = select i1 %57, i64 %58, i64 %55
  store i64 %spec.select52, ptr %56, align 8, !tbaa !5
  %59 = add nsw i64 %storemerge505455, %54
  %60 = icmp sgt i64 %59, 1000000006
  %61 = add nsw i64 %59, -1000000007
  %storemerge50 = select i1 %60, i64 %61, i64 %59
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond64.not = icmp eq i64 %indvars.iv.next62, 26
  br i1 %exitcond64.not, label %39, label %50, !llvm.loop !15

62:                                               ; preds = %._crit_edge
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %64 unwind label %10

64:                                               ; preds = %62
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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

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

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


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