; LLVM IR from tangjz/acm-icpc :: 51nod (1526)

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

%struct.Trie = type { [2 x i32], [27 x i32] }

@n = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@e = external dso_local global [800001 x %struct.Trie], align 16
@str = external dso_local global [800001 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %73, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @str)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %69, %18
  %21 = load i32, ptr %5, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [800001 x i8], ptr @str, i64 0, i64 %22
  %24 = load i8, ptr %23, align 1, !tbaa !9
  %25 = icmp ne i8 %24, 0
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [800001 x i8], ptr @str, i64 0, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = sext i8 %31 to i32
  %33 = sub nsw i32 %32, 97
  store i32 %33, ptr %6, align 4, !tbaa !5
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %35
  %37 = getelementptr inbounds %struct.Trie, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [27 x i32], ptr %37, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %53, label %43

43:                                               ; preds = %27
  %44 = load i32, ptr @tot, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr @tot, align 4, !tbaa !5
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %47
  %49 = getelementptr inbounds %struct.Trie, ptr %48, i32 0, i32 1
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [27 x i32], ptr %49, i64 0, i64 %51
  store i32 %45, ptr %52, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %43, %27
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %55
  %57 = getelementptr inbounds %struct.Trie, ptr %56, i32 0, i32 1
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [27 x i32], ptr %57, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  store i32 %61, ptr %4, align 4, !tbaa !5
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %63
  %65 = getelementptr inbounds %struct.Trie, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds [2 x i32], ptr %65, i64 0, i64 0
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %66, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %69

69:                                               ; preds = %53
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %5, align 4, !tbaa !5
  br label %20, !llvm.loop !10

72:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !12

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

77:                                               ; preds = %137, %76
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %82, label %81

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

82:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  %83 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @str)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %133, %82
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [800001 x i8], ptr @str, i64 0, i64 %86
  %88 = load i8, ptr %87, align 1, !tbaa !9
  %89 = icmp ne i8 %88, 0
  br i1 %89, label %91, label %90

90:                                               ; preds = %84
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %136

91:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [800001 x i8], ptr @str, i64 0, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !9
  %96 = sext i8 %95 to i32
  %97 = sub nsw i32 %96, 97
  store i32 %97, ptr %10, align 4, !tbaa !5
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %99
  %101 = getelementptr inbounds %struct.Trie, ptr %100, i32 0, i32 1
  %102 = load i32, ptr %10, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [27 x i32], ptr %101, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %117, label %107

107:                                              ; preds = %91
  %108 = load i32, ptr @tot, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr @tot, align 4, !tbaa !5
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %111
  %113 = getelementptr inbounds %struct.Trie, ptr %112, i32 0, i32 1
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [27 x i32], ptr %113, i64 0, i64 %115
  store i32 %109, ptr %116, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %107, %91
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %119
  %121 = getelementptr inbounds %struct.Trie, ptr %120, i32 0, i32 1
  %122 = load i32, ptr %10, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [27 x i32], ptr %121, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  store i32 %125, ptr %8, align 4, !tbaa !5
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %127
  %129 = getelementptr inbounds %struct.Trie, ptr %128, i32 0, i32 0
  %130 = getelementptr inbounds [2 x i32], ptr %129, i64 0, i64 1
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %130, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %133

133:                                              ; preds = %117
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %9, align 4, !tbaa !5
  br label %84, !llvm.loop !13

136:                                              ; preds = %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %7, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %7, align 4, !tbaa !5
  br label %77, !llvm.loop !14

140:                                              ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %161, %140
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = load i32, ptr @tot, align 4, !tbaa !5
  %144 = icmp sle i32 %142, %143
  br i1 %144, label %146, label %145

145:                                              ; preds = %141
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %164

146:                                              ; preds = %141
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %148
  %150 = getelementptr inbounds %struct.Trie, ptr %149, i32 0, i32 0
  %151 = getelementptr inbounds [2 x i32], ptr %150, i64 0, i64 0
  %152 = load i32, ptr %11, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %153
  %155 = getelementptr inbounds %struct.Trie, ptr %154, i32 0, i32 0
  %156 = getelementptr inbounds [2 x i32], ptr %155, i64 0, i64 1
  %157 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %151, ptr noundef nonnull align 4 dereferenceable(4) %156)
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = load i32, ptr @ans, align 4, !tbaa !5
  %160 = add nsw i32 %159, %158
  store i32 %160, ptr @ans, align 4, !tbaa !5
  br label %161

161:                                              ; preds = %146
  %162 = load i32, ptr %11, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %11, align 4, !tbaa !5
  br label %141, !llvm.loop !15

164:                                              ; preds = %145
  %165 = load i32, ptr @ans, align 4, !tbaa !5
  %166 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %165)
  ret i32 0
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

declare i32 @printf(ptr noundef, ...) #1

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


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

%struct.Trie = type { [2 x i32], [27 x i32] }

@n = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@e = external dso_local global [800001 x %struct.Trie], align 16
@str = external dso_local global [800001 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph46, label %.preheader40..preheader_crit_edge

.preheader40:                                     ; preds = %._crit_edge
  %4 = icmp sgt i32 %8, 0
  br i1 %4, label %.lr.ph55, label %.preheader40..preheader_crit_edge

.preheader40..preheader_crit_edge:                ; preds = %0, %.preheader40
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  br label %.preheader

.lr.ph46:                                         ; preds = %0, %._crit_edge
  %.02844 = phi i32 [ %7, %._crit_edge ], [ 0, %0 ]
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @str)
  %6 = load i8, ptr @str, align 16, !tbaa !9
  %.not3841 = icmp eq i8 %6, 0
  br i1 %.not3841, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph46
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  br label %.lr.ph

._crit_edge:                                      ; preds = %19, %.lr.ph46
  %7 = add nuw nsw i32 %.02844, 1
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp slt i32 %7, %8
  br i1 %9, label %.lr.ph46, label %.preheader40, !llvm.loop !10

.lr.ph:                                           ; preds = %.lr.ph.preheader, %19
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %19 ]
  %10 = phi i8 [ %6, %.lr.ph.preheader ], [ %27, %19 ]
  %.03342 = phi i32 [ 0, %.lr.ph.preheader ], [ %20, %19 ]
  %11 = phi i32 [ %tot.promoted, %.lr.ph.preheader ], [ %21, %19 ]
  %12 = sext i8 %10 to i64
  %13 = add nsw i64 %12, -97
  %14 = sext i32 %.03342 to i64
  %15 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %14, i32 1, i64 %13
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %.not39 = icmp eq i32 %16, 0
  br i1 %.not39, label %17, label %19

17:                                               ; preds = %.lr.ph
  %18 = add nsw i32 %11, 1
  store i32 %18, ptr @tot, align 4, !tbaa !5
  store i32 %18, ptr %15, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %17, %.lr.ph
  %20 = phi i32 [ %18, %17 ], [ %16, %.lr.ph ]
  %21 = phi i32 [ %18, %17 ], [ %11, %.lr.ph ]
  %22 = sext i32 %20 to i64
  %23 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %23, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = getelementptr inbounds [800001 x i8], ptr @str, i64 0, i64 %indvars.iv.next
  %27 = load i8, ptr %26, align 1, !tbaa !9
  %.not38 = icmp eq i8 %27, 0
  br i1 %.not38, label %._crit_edge, label %.lr.ph, !llvm.loop !12

.preheader:                                       ; preds = %._crit_edge53, %.preheader40..preheader_crit_edge
  %28 = phi i32 [ %.pre, %.preheader40..preheader_crit_edge ], [ %31, %._crit_edge53 ]
  %.not56 = icmp slt i32 %28, 1
  br i1 %.not56, label %.preheader.._crit_edge59_crit_edge, label %.lr.ph58

.preheader.._crit_edge59_crit_edge:               ; preds = %.preheader
  %.pre65 = load i32, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge59

.lr.ph55:                                         ; preds = %.preheader40, %._crit_edge53
  %.03154 = phi i32 [ %32, %._crit_edge53 ], [ 0, %.preheader40 ]
  %29 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @str)
  %tot.promoted47 = load i32, ptr @tot, align 4, !tbaa !5
  %30 = load i8, ptr @str, align 16, !tbaa !9
  %.not3648 = icmp eq i8 %30, 0
  br i1 %.not3648, label %._crit_edge53, label %.lr.ph52

._crit_edge53:                                    ; preds = %44, %.lr.ph55
  %31 = phi i32 [ %tot.promoted47, %.lr.ph55 ], [ %46, %44 ]
  %32 = add nuw nsw i32 %.03154, 1
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %.lr.ph55, label %.preheader, !llvm.loop !13

.lr.ph52:                                         ; preds = %.lr.ph55, %44
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %44 ], [ 0, %.lr.ph55 ]
  %35 = phi i8 [ %52, %44 ], [ %30, %.lr.ph55 ]
  %.03049 = phi i32 [ %45, %44 ], [ 0, %.lr.ph55 ]
  %36 = phi i32 [ %46, %44 ], [ %tot.promoted47, %.lr.ph55 ]
  %37 = sext i8 %35 to i64
  %38 = add nsw i64 %37, -97
  %39 = sext i32 %.03049 to i64
  %40 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %39, i32 1, i64 %38
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %.not37 = icmp eq i32 %41, 0
  br i1 %.not37, label %42, label %44

42:                                               ; preds = %.lr.ph52
  %43 = add nsw i32 %36, 1
  store i32 %43, ptr @tot, align 4, !tbaa !5
  store i32 %43, ptr %40, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %42, %.lr.ph52
  %45 = phi i32 [ %43, %42 ], [ %41, %.lr.ph52 ]
  %46 = phi i32 [ %43, %42 ], [ %36, %.lr.ph52 ]
  %47 = sext i32 %45 to i64
  %48 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %47, i32 0, i64 1
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %48, align 4, !tbaa !5
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %51 = getelementptr inbounds [800001 x i8], ptr @str, i64 0, i64 %indvars.iv.next61
  %52 = load i8, ptr %51, align 1, !tbaa !9
  %.not36 = icmp eq i8 %52, 0
  br i1 %.not36, label %._crit_edge53, label %.lr.ph52, !llvm.loop !14

._crit_edge59:                                    ; preds = %.lr.ph58, %.preheader.._crit_edge59_crit_edge
  %53 = phi i32 [ %.pre65, %.preheader.._crit_edge59_crit_edge ], [ %60, %.lr.ph58 ]
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %53)
  ret i32 0

.lr.ph58:                                         ; preds = %.preheader, %.lr.ph58
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %.lr.ph58 ], [ 1, %.preheader ]
  %55 = getelementptr inbounds [800001 x %struct.Trie], ptr @e, i64 0, i64 %indvars.iv62
  %56 = getelementptr inbounds i8, ptr %55, i64 4
  %57 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %55, ptr noundef nonnull align 4 dereferenceable(4) %56)
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr @ans, align 4, !tbaa !5
  %60 = add nsw i32 %59, %58
  store i32 %60, ptr @ans, align 4, !tbaa !5
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %61 = load i32, ptr @tot, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %.not.not = icmp slt i64 %indvars.iv62, %62
  br i1 %.not.not, label %.lr.ph58, label %._crit_edge59, !llvm.loop !15
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

attributes #0 = { mustprogress norecurse 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 = { 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 #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass