; LLVM IR from lzyrapx/Competitive-Programming :: ACdream (1019（树状数组+Hash）)

; 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 }

@s = external dso_local global [1000010 x i8], align 16
@C = external dso_local global [2 x [1000010 x i64]], align 16
@Hash = external dso_local global [1000010 x i64], align 16
@len = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6updateiix(i32 noundef, i32 noundef, i64 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z7gethashiii(i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca [5 x i8], align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @_Z4initv()
  br label %9

9:                                                ; preds = %173, %0
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef getelementptr inbounds (i8, ptr @s, i64 1))
  %11 = xor i32 %10, -1
  %12 = icmp ne i32 %11, 0
  br i1 %12, label %13, label %174

13:                                               ; preds = %9
  call void @llvm.memset.p0.i64(ptr align 16 @C, i8 0, i64 16000160, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %14 = 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)
  %15 = call i64 @strlen(ptr noundef getelementptr inbounds (i8, ptr @s, i64 1)) #8
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr @len, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %55, %13
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = load i32, ptr @len, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %58

22:                                               ; preds = %17
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [1000010 x i8], ptr @s, i64 0, i64 %25
  %27 = load i8, ptr %26, align 1, !tbaa !9
  %28 = sext i8 %27 to i32
  %29 = sub nsw i32 %28, 97
  %30 = sext i32 %29 to i64
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !10
  %35 = mul nsw i64 %30, %34
  call void @_Z6updateiix(i32 noundef 0, i32 noundef %23, i64 noundef %35)
  %36 = load i32, ptr @len, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sub nsw i32 %37, %38
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1000010 x i8], ptr @s, i64 0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !9
  %44 = sext i8 %43 to i32
  %45 = sub nsw i32 %44, 97
  %46 = sext i32 %45 to i64
  %47 = load i32, ptr @len, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sub nsw i32 %48, %49
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !10
  %54 = mul nsw i64 %46, %53
  call void @_Z6updateiix(i32 noundef 1, i32 noundef %39, i64 noundef %54)
  br label %55

55:                                               ; preds = %22
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %3, align 4, !tbaa !5
  br label %17, !llvm.loop !12

58:                                               ; preds = %21
  br label %59

59:                                               ; preds = %172, %58
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = add nsw i32 %60, -1
  store i32 %61, ptr %2, align 4, !tbaa !5
  %62 = icmp ne i32 %60, 0
  br i1 %62, label %63, label %173

63:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #7
  %64 = call i32 @getchar()
  %65 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4)
  %66 = load i8, ptr %4, align 1, !tbaa !9
  %67 = sext i8 %66 to i32
  %68 = icmp eq i32 %67, 67
  br i1 %68, label %69, label %139

69:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 5, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %70 = getelementptr inbounds [5 x i8], ptr %5, i64 0, i64 0
  %71 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %6, ptr noundef %70)
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [1000010 x i8], ptr @s, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !9
  %77 = sext i8 %76 to i32
  %78 = sub nsw i32 %77, 97
  %79 = sub nsw i32 0, %78
  %80 = sext i32 %79 to i64
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !10
  %85 = mul nsw i64 %80, %84
  call void @_Z6updateiix(i32 noundef 0, i32 noundef %72, i64 noundef %85)
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = getelementptr inbounds [5 x i8], ptr %5, i64 0, i64 0
  %88 = load i8, ptr %87, align 1, !tbaa !9
  %89 = sext i8 %88 to i32
  %90 = sub nsw i32 %89, 97
  %91 = sext i32 %90 to i64
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !10
  %96 = mul nsw i64 %91, %95
  call void @_Z6updateiix(i32 noundef 0, i32 noundef %86, i64 noundef %96)
  %97 = load i32, ptr @len, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = sub nsw i32 %98, %99
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1000010 x i8], ptr @s, i64 0, i64 %102
  %104 = load i8, ptr %103, align 1, !tbaa !9
  %105 = sext i8 %104 to i32
  %106 = sub nsw i32 %105, 97
  %107 = sub nsw i32 0, %106
  %108 = sext i32 %107 to i64
  %109 = load i32, ptr @len, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = sub nsw i32 %110, %111
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !10
  %116 = mul nsw i64 %108, %115
  call void @_Z6updateiix(i32 noundef 1, i32 noundef %100, i64 noundef %116)
  %117 = load i32, ptr @len, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  %119 = load i32, ptr %6, align 4, !tbaa !5
  %120 = sub nsw i32 %118, %119
  %121 = getelementptr inbounds [5 x i8], ptr %5, i64 0, i64 0
  %122 = load i8, ptr %121, align 1, !tbaa !9
  %123 = sext i8 %122 to i32
  %124 = sub nsw i32 %123, 97
  %125 = sext i32 %124 to i64
  %126 = load i32, ptr @len, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  %128 = load i32, ptr %6, align 4, !tbaa !5
  %129 = sub nsw i32 %127, %128
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !10
  %133 = mul nsw i64 %125, %132
  call void @_Z6updateiix(i32 noundef 1, i32 noundef %120, i64 noundef %133)
  %134 = getelementptr inbounds [5 x i8], ptr %5, i64 0, i64 0
  %135 = load i8, ptr %134, align 1, !tbaa !9
  %136 = load i32, ptr %6, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [1000010 x i8], ptr @s, i64 0, i64 %137
  store i8 %135, ptr %138, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 5, ptr %5) #7
  br label %172

139:                                              ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %140 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %7, ptr noundef %8)
  %141 = load i32, ptr %7, align 4, !tbaa !5
  %142 = load i32, ptr %8, align 4, !tbaa !5
  %143 = call noundef i64 @_Z7gethashiii(i32 noundef 0, i32 noundef %141, i32 noundef %142)
  %144 = load i32, ptr @len, align 4, !tbaa !5
  %145 = load i32, ptr %7, align 4, !tbaa !5
  %146 = sub nsw i32 %144, %145
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !10
  %150 = mul nsw i64 %143, %149
  %151 = load i32, ptr @len, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  %153 = load i32, ptr %8, align 4, !tbaa !5
  %154 = sub nsw i32 %152, %153
  %155 = load i32, ptr @len, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  %157 = load i32, ptr %7, align 4, !tbaa !5
  %158 = sub nsw i32 %156, %157
  %159 = call noundef i64 @_Z7gethashiii(i32 noundef 1, i32 noundef %154, i32 noundef %158)
  %160 = load i32, ptr %8, align 4, !tbaa !5
  %161 = sub nsw i32 %160, 1
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %162
  %164 = load i64, ptr %163, align 8, !tbaa !10
  %165 = mul nsw i64 %159, %164
  %166 = icmp eq i64 %150, %165
  br i1 %166, label %167, label %169

167:                                              ; preds = %139
  %168 = call i32 @puts(ptr noundef @.str.4)
  br label %171

169:                                              ; preds = %139
  %170 = call i32 @puts(ptr noundef @.str.5)
  br label %171

171:                                              ; preds = %169, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %172

172:                                              ; preds = %171, %69
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  br label %59, !llvm.loop !14

173:                                              ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %9, !llvm.loop !15

174:                                              ; preds = %9
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @getchar() #6

declare i32 @puts(ptr noundef) #3

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !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 }

@s = external dso_local global [1000010 x i8], align 16
@C = external dso_local local_unnamed_addr global [2 x [1000010 x i64]], align 16
@Hash = external dso_local local_unnamed_addr global [1000010 x i64], align 16
@len = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() local_unnamed_addr #0

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

; 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 nounwind uwtable
declare dso_local void @_Z6updateiix(i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z7gethashiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i8, align 1
  %3 = alloca [5 x i8], align 1
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  tail call void @_Z4initv()
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @s, i64 1))
  %.not15 = icmp eq i32 %7, -1
  br i1 %.not15, label %._crit_edge18, label %.lr.ph17

.lr.ph17:                                         ; preds = %0, %._crit_edge
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16000160) @C, i8 0, i64 16000160, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %8 = 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)
  %9 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @s, i64 1)) #9
  %10 = trunc i64 %9 to i32
  store i32 %10, ptr @len, align 4, !tbaa !5
  %.not811 = icmp slt i32 %10, 1
  br i1 %.not811, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %.lr.ph17
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr %1, align 4, !tbaa !5
  %.not913 = icmp eq i32 %11, 0
  br i1 %.not913, label %._crit_edge, label %.lr.ph14

.lr.ph:                                           ; preds = %.lr.ph17, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph17 ]
  %13 = getelementptr inbounds [1000010 x i8], ptr @s, i64 0, i64 %indvars.iv
  %14 = load i8, ptr %13, align 1, !tbaa !9
  %15 = sext i8 %14 to i64
  %16 = add nsw i64 %15, -97
  %17 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %indvars.iv
  %18 = load i64, ptr %17, align 8, !tbaa !10
  %19 = mul nsw i64 %16, %18
  %20 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_Z6updateiix(i32 noundef 0, i32 noundef %20, i64 noundef %19)
  %21 = load i32, ptr @len, align 4, !tbaa !5
  %reass.sub = sub i32 %21, %20
  %22 = add i32 %reass.sub, 1
  %23 = load i8, ptr %13, align 1, !tbaa !9
  %24 = sext i8 %23 to i64
  %25 = add nsw i64 %24, -97
  %26 = sext i32 %22 to i64
  %27 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %26
  %28 = load i64, ptr %27, align 8, !tbaa !10
  %29 = mul nsw i64 %25, %28
  call void @_Z6updateiix(i32 noundef 1, i32 noundef %22, i64 noundef %29)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = load i32, ptr @len, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %.not8.not = icmp slt i64 %indvars.iv, %31
  br i1 %.not8.not, label %.lr.ph, label %.preheader, !llvm.loop !12

.lr.ph14:                                         ; preds = %.preheader, %108
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #8
  %32 = call i32 @getchar()
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2)
  %34 = load i8, ptr %2, align 1, !tbaa !9
  %35 = icmp eq i8 %34, 67
  br i1 %35, label %36, label %83

36:                                               ; preds = %.lr.ph14
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %4, ptr noundef nonnull %3)
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [1000010 x i8], ptr @s, i64 0, i64 %39
  %41 = load i8, ptr %40, align 1, !tbaa !9
  %42 = sext i8 %41 to i64
  %43 = sub nsw i64 97, %42
  %44 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %39
  %45 = load i64, ptr %44, align 8, !tbaa !10
  %46 = mul nsw i64 %43, %45
  call void @_Z6updateiix(i32 noundef 0, i32 noundef %38, i64 noundef %46)
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = load i8, ptr %3, align 1, !tbaa !9
  %49 = sext i8 %48 to i64
  %50 = add nsw i64 %49, -97
  %51 = sext i32 %47 to i64
  %52 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !10
  %54 = mul nsw i64 %50, %53
  call void @_Z6updateiix(i32 noundef 0, i32 noundef %47, i64 noundef %54)
  %55 = load i32, ptr @len, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sub i32 %56, %57
  %59 = sext i32 %57 to i64
  %60 = getelementptr inbounds [1000010 x i8], ptr @s, i64 0, i64 %59
  %61 = load i8, ptr %60, align 1, !tbaa !9
  %62 = sext i8 %61 to i64
  %63 = sub nsw i64 97, %62
  %64 = sext i32 %58 to i64
  %65 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !10
  %67 = mul nsw i64 %63, %66
  call void @_Z6updateiix(i32 noundef 1, i32 noundef %58, i64 noundef %67)
  %68 = load i32, ptr @len, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = sub i32 %69, %70
  %72 = load i8, ptr %3, align 1, !tbaa !9
  %73 = sext i8 %72 to i64
  %74 = add nsw i64 %73, -97
  %75 = sext i32 %71 to i64
  %76 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !10
  %78 = mul nsw i64 %74, %77
  call void @_Z6updateiix(i32 noundef 1, i32 noundef %71, i64 noundef %78)
  %79 = load i8, ptr %3, align 1, !tbaa !9
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [1000010 x i8], ptr @s, i64 0, i64 %81
  store i8 %79, ptr %82, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %3) #8
  br label %108

83:                                               ; preds = %.lr.ph14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  %84 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = call noundef i64 @_Z7gethashiii(i32 noundef 0, i32 noundef %85, i32 noundef %86)
  %88 = load i32, ptr @len, align 4, !tbaa !5
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = sub nsw i32 %88, %89
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !10
  %94 = mul nsw i64 %93, %87
  %95 = add nsw i32 %88, 1
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = sub nsw i32 %95, %96
  %98 = sub nsw i32 %95, %89
  %99 = call noundef i64 @_Z7gethashiii(i32 noundef 1, i32 noundef %97, i32 noundef %98)
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = add nsw i32 %100, -1
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1000010 x i64], ptr @Hash, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !10
  %105 = mul nsw i64 %104, %99
  %106 = icmp eq i64 %94, %105
  %.str.4..str.5 = select i1 %106, ptr @.str.4, ptr @.str.5
  %107 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.4..str.5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  br label %108

108:                                              ; preds = %83, %36
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #8
  %109 = load i32, ptr %1, align 4, !tbaa !5
  %110 = add nsw i32 %109, -1
  store i32 %110, ptr %1, align 4, !tbaa !5
  %.not9 = icmp eq i32 %109, 0
  br i1 %.not9, label %._crit_edge, label %.lr.ph14, !llvm.loop !14

._crit_edge:                                      ; preds = %108, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %111 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @s, i64 1))
  %.not = icmp eq i32 %111, -1
  br i1 %.not, label %._crit_edge18, label %.lr.ph17, !llvm.loop !15

._crit_edge18:                                    ; preds = %._crit_edge, %0
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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 #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @getchar() local_unnamed_addr #7

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass