; LLVM IR from tangjz/acm-icpc :: lydsy (1030)

; 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.AC = type { [26 x i32], i32, i32, i8 }

@trie = external dso_local global [6001 x %struct.AC], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@f = external dso_local global [101 x [6001 x i32]], align 16
@ans = external dso_local global i32, align 4
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6insertv() #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: mustprogress nounwind uwtable
declare dso_local void @_Z3bfsv() #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3powii(i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %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
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %10

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

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

15:                                               ; preds = %10
  call void @_Z6insertv()
  br label %16

16:                                               ; preds = %15
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = add nsw i32 %17, 1
  store i32 %18, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !9

19:                                               ; preds = %14
  call void @_Z3bfsv()
  store i32 1, ptr @f, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %138, %19
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = load i32, ptr @m, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

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

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

26:                                               ; preds = %134, %25
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = load i32, ptr @tot, align 4, !tbaa !5
  %29 = icmp sle i32 %27, %28
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %26
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [101 x [6001 x i32]], ptr @f, i64 0, i64 %33
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [6001 x i32], ptr %34, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %133

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

41:                                               ; preds = %129, %40
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = icmp slt i32 %42, 26
  br i1 %43, label %45, label %44

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

45:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %46, ptr %7, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %63, %45
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %61

50:                                               ; preds = %47
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [6001 x %struct.AC], ptr @trie, i64 0, i64 %52
  %54 = getelementptr inbounds %struct.AC, ptr %53, i32 0, i32 0
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [26 x i32], ptr %54, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = icmp ne i32 %58, 0
  %60 = xor i1 %59, true
  br label %61

61:                                               ; preds = %50, %47
  %62 = phi i1 [ false, %47 ], [ %60, %50 ]
  br i1 %62, label %63, label %69

63:                                               ; preds = %61
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [6001 x %struct.AC], ptr @trie, i64 0, i64 %65
  %67 = getelementptr inbounds %struct.AC, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !11
  store i32 %68, ptr %7, align 4, !tbaa !5
  br label %47, !llvm.loop !14

69:                                               ; preds = %61
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [6001 x %struct.AC], ptr @trie, i64 0, i64 %71
  %73 = getelementptr inbounds %struct.AC, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [26 x i32], ptr %73, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  store i32 %77, ptr %7, align 4, !tbaa !5
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [6001 x %struct.AC], ptr @trie, i64 0, i64 %79
  %81 = getelementptr inbounds %struct.AC, ptr %80, i32 0, i32 3
  %82 = load i8, ptr %81, align 4, !tbaa !15, !range !16, !noundef !17
  %83 = trunc i8 %82 to i1
  br i1 %83, label %128, label %84

84:                                               ; preds = %69
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [6001 x %struct.AC], ptr @trie, i64 0, i64 %86
  %88 = getelementptr inbounds %struct.AC, ptr %87, i32 0, i32 2
  %89 = load i32, ptr %88, align 4, !tbaa !18
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %128, label %91

91:                                               ; preds = %84
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [101 x [6001 x i32]], ptr @f, i64 0, i64 %93
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [6001 x i32], ptr %94, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = load i32, ptr %3, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [101 x [6001 x i32]], ptr @f, i64 0, i64 %101
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [6001 x i32], ptr %102, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = add nsw i32 %106, %98
  store i32 %107, ptr %105, align 4, !tbaa !5
  %108 = load i32, ptr %3, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [101 x [6001 x i32]], ptr @f, i64 0, i64 %110
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [6001 x i32], ptr %111, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = icmp sge i32 %115, 10007
  br i1 %116, label %117, label %127

117:                                              ; preds = %91
  %118 = load i32, ptr %3, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [101 x [6001 x i32]], ptr @f, i64 0, i64 %120
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [6001 x i32], ptr %121, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sub nsw i32 %125, 10007
  store i32 %126, ptr %124, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %117, %91
  br label %128

128:                                              ; preds = %127, %84, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %6, align 4, !tbaa !5
  br label %41, !llvm.loop !19

132:                                              ; preds = %44
  br label %133

133:                                              ; preds = %132, %31
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %5, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %5, align 4, !tbaa !5
  br label %26, !llvm.loop !20

137:                                              ; preds = %30
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %3, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %3, align 4, !tbaa !5
  br label %20, !llvm.loop !21

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

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

146:                                              ; preds = %142
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %166

147:                                              ; preds = %142
  %148 = load i32, ptr @m, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [101 x [6001 x i32]], ptr @f, i64 0, i64 %149
  %151 = load i32, ptr %8, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [6001 x i32], ptr %150, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = load i32, ptr @ans, align 4, !tbaa !5
  %156 = add nsw i32 %155, %154
  store i32 %156, ptr @ans, align 4, !tbaa !5
  %157 = load i32, ptr @ans, align 4, !tbaa !5
  %158 = icmp sge i32 %157, 10007
  br i1 %158, label %159, label %162

159:                                              ; preds = %147
  %160 = load i32, ptr @ans, align 4, !tbaa !5
  %161 = sub nsw i32 %160, 10007
  store i32 %161, ptr @ans, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %159, %147
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %8, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %8, align 4, !tbaa !5
  br label %142, !llvm.loop !22

166:                                              ; preds = %146
  %167 = load i32, ptr @m, align 4, !tbaa !5
  %168 = call noundef i32 @_Z3powii(i32 noundef 26, i32 noundef %167)
  %169 = load i32, ptr @ans, align 4, !tbaa !5
  %170 = sub nsw i32 %168, %169
  store i32 %170, ptr @ans, align 4, !tbaa !5
  %171 = load i32, ptr @ans, align 4, !tbaa !5
  %172 = icmp slt i32 %171, 0
  br i1 %172, label %173, label %176

173:                                              ; preds = %166
  %174 = load i32, ptr @ans, align 4, !tbaa !5
  %175 = add nsw i32 %174, 10007
  store i32 %175, ptr @ans, align 4, !tbaa !5
  br label %176

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

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

attributes #0 = { 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 #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 = { 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 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 104}
!12 = !{!"_ZTS2AC", !7, i64 0, !6, i64 104, !6, i64 108, !13, i64 112}
!13 = !{!"bool", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = !{!12, !13, i64 112}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!12, !6, i64 108}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}


; 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.AC = type { [26 x i32], i32, i32, i8 }

@trie = external dso_local local_unnamed_addr global [6001 x %struct.AC], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local local_unnamed_addr global [101 x [6001 x i32]], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3bfsv() local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3powii(i32 noundef, i32 noundef) local_unnamed_addr #2

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

._crit_edge:                                      ; preds = %.lr.ph, %0
  tail call void @_Z3bfsv()
  store i32 1, ptr @f, align 16, !tbaa !5
  %4 = load i32, ptr @m, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  %.pre89 = load i32, ptr @tot, align 4, !tbaa !5
  br i1 %5, label %.preheader47.lr.ph, label %.preheader

.preheader47.lr.ph:                               ; preds = %._crit_edge
  %.not3955 = icmp slt i32 %.pre89, 0
  br i1 %.not3955, label %.preheader.thread, label %.preheader47.preheader

.preheader47.preheader:                           ; preds = %.preheader47.lr.ph
  %6 = add nuw i32 %.pre89, 1
  %wide.trip.count82 = zext nneg i32 %4 to i64
  %wide.trip.count = zext i32 %6 to i64
  br label %.preheader47

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03448 = phi i32 [ %7, %.lr.ph ], [ 0, %0 ]
  tail call void @_Z6insertv()
  %7 = add nuw nsw i32 %.03448, 1
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp slt i32 %7, %8
  br i1 %9, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader47:                                     ; preds = %.preheader47.preheader, %._crit_edge59
  %indvars.iv79 = phi i64 [ 0, %.preheader47.preheader ], [ %indvars.iv.next80, %._crit_edge59 ]
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  br label %13

.preheader:                                       ; preds = %._crit_edge59, %._crit_edge
  %.not63 = icmp slt i32 %.pre89, 0
  br i1 %.not63, label %.preheader.thread, label %.lr.ph66

.lr.ph66:                                         ; preds = %.preheader
  %ans.promoted = load i32, ptr @ans, align 4, !tbaa !5
  %10 = sext i32 %4 to i64
  %11 = add nuw i32 %.pre89, 1
  %wide.trip.count87 = zext i32 %11 to i64
  %xtraiter = and i64 %wide.trip.count87, 1
  %12 = icmp eq i32 %.pre89, 0
  br i1 %12, label %._crit_edge67.unr-lcssa, label %.lr.ph66.new

.lr.ph66.new:                                     ; preds = %.lr.ph66
  %unroll_iter = and i64 %wide.trip.count87, 4294967294
  br label %73

._crit_edge59:                                    ; preds = %.loopexit
  %exitcond83.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count82
  br i1 %exitcond83.not, label %.preheader, label %.preheader47, !llvm.loop !11

13:                                               ; preds = %.preheader47, %.loopexit
  %indvars.iv75 = phi i64 [ 0, %.preheader47 ], [ %indvars.iv.next76, %.loopexit ]
  %14 = getelementptr inbounds [101 x [6001 x i32]], ptr @f, i64 0, i64 %indvars.iv79, i64 %indvars.iv75
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %.not40 = icmp eq i32 %15, 0
  br i1 %.not40, label %.loopexit, label %.preheader46

.preheader46:                                     ; preds = %13
  %.not4149 = icmp eq i64 %indvars.iv75, 0
  br i1 %.not4149, label %.preheader45.us, label %.preheader45.preheader

.preheader45.preheader:                           ; preds = %.preheader46
  %16 = trunc nuw nsw i64 %indvars.iv75 to i32
  br label %.preheader45

.preheader45.us:                                  ; preds = %.preheader46, %35
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %35 ], [ 0, %.preheader46 ]
  %17 = getelementptr inbounds [26 x i32], ptr @trie, i64 0, i64 %indvars.iv71
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [6001 x %struct.AC], ptr @trie, i64 0, i64 %19
  %21 = getelementptr inbounds i8, ptr %20, i64 112
  %22 = load i8, ptr %21, align 4, !tbaa !12, !range !15, !noundef !16
  %23 = trunc nuw i8 %22 to i1
  br i1 %23, label %35, label %24

24:                                               ; preds = %.preheader45.us
  %25 = getelementptr inbounds i8, ptr %20, i64 108
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %.not43.us = icmp eq i32 %26, 0
  br i1 %.not43.us, label %27, label %35

27:                                               ; preds = %24
  %28 = load i32, ptr %14, align 4, !tbaa !5
  %29 = getelementptr inbounds [101 x [6001 x i32]], ptr @f, i64 0, i64 %indvars.iv.next80, i64 %19
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = add nsw i32 %30, %28
  store i32 %31, ptr %29, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 10006
  br i1 %32, label %33, label %35

33:                                               ; preds = %27
  %34 = add nsw i32 %31, -10007
  store i32 %34, ptr %29, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %33, %27, %24, %.preheader45.us
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next72, 26
  br i1 %exitcond74.not, label %.loopexit, label %.preheader45.us, !llvm.loop !18

.preheader45:                                     ; preds = %.preheader45.preheader, %61
  %indvars.iv = phi i64 [ 0, %.preheader45.preheader ], [ %indvars.iv.next, %61 ]
  br label %36

36:                                               ; preds = %.preheader45, %41
  %.03050 = phi i32 [ %16, %.preheader45 ], [ %43, %41 ]
  %37 = sext i32 %.03050 to i64
  %38 = getelementptr inbounds [6001 x %struct.AC], ptr @trie, i64 0, i64 %37
  %39 = getelementptr inbounds [26 x i32], ptr %38, i64 0, i64 %indvars.iv
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %.not42 = icmp eq i32 %40, 0
  br i1 %.not42, label %41, label %.critedge

41:                                               ; preds = %36
  %42 = getelementptr inbounds i8, ptr %38, i64 104
  %43 = load i32, ptr %42, align 4, !tbaa !19
  %.not41 = icmp eq i32 %43, 0
  br i1 %.not41, label %..critedge_crit_edge, label %36, !llvm.loop !20

..critedge_crit_edge:                             ; preds = %41
  %.phi.trans.insert = getelementptr inbounds [26 x i32], ptr @trie, i64 0, i64 %indvars.iv
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  br label %.critedge

.critedge:                                        ; preds = %36, %..critedge_crit_edge
  %44 = phi i32 [ %.pre, %..critedge_crit_edge ], [ %40, %36 ]
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [6001 x %struct.AC], ptr @trie, i64 0, i64 %45
  %47 = getelementptr inbounds i8, ptr %46, i64 112
  %48 = load i8, ptr %47, align 4, !tbaa !12, !range !15, !noundef !16
  %49 = trunc nuw i8 %48 to i1
  br i1 %49, label %61, label %50

50:                                               ; preds = %.critedge
  %51 = getelementptr inbounds i8, ptr %46, i64 108
  %52 = load i32, ptr %51, align 4, !tbaa !17
  %.not43 = icmp eq i32 %52, 0
  br i1 %.not43, label %53, label %61

53:                                               ; preds = %50
  %54 = load i32, ptr %14, align 4, !tbaa !5
  %55 = getelementptr inbounds [101 x [6001 x i32]], ptr @f, i64 0, i64 %indvars.iv.next80, i64 %45
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = add nsw i32 %56, %54
  store i32 %57, ptr %55, align 4, !tbaa !5
  %58 = icmp sgt i32 %57, 10006
  br i1 %58, label %59, label %61

59:                                               ; preds = %53
  %60 = add nsw i32 %57, -10007
  store i32 %60, ptr %55, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %53, %59, %50, %.critedge
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 26
  br i1 %exitcond.not, label %.loopexit, label %.preheader45, !llvm.loop !18

.loopexit:                                        ; preds = %61, %35, %13
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count
  br i1 %exitcond78.not, label %._crit_edge59, label %13, !llvm.loop !21

._crit_edge67.unr-lcssa:                          ; preds = %73, %.lr.ph66
  %spec.select44.lcssa.ph = phi i32 [ poison, %.lr.ph66 ], [ %spec.select44.1, %73 ]
  %indvars.iv84.unr = phi i64 [ 0, %.lr.ph66 ], [ %indvars.iv.next85.1, %73 ]
  %spec.select446264.unr = phi i32 [ %ans.promoted, %.lr.ph66 ], [ %spec.select44.1, %73 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge67, label %._crit_edge67.epilog-lcssa

._crit_edge67.epilog-lcssa:                       ; preds = %._crit_edge67.unr-lcssa
  %62 = getelementptr inbounds [101 x [6001 x i32]], ptr @f, i64 0, i64 %10, i64 %indvars.iv84.unr
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %spec.select446264.unr, %63
  %65 = icmp sgt i32 %64, 10006
  %66 = add nsw i32 %64, -10007
  %spec.select44.epil = select i1 %65, i32 %66, i32 %64
  br label %._crit_edge67

._crit_edge67:                                    ; preds = %._crit_edge67.unr-lcssa, %._crit_edge67.epilog-lcssa
  %spec.select44.lcssa = phi i32 [ %spec.select44.lcssa.ph, %._crit_edge67.unr-lcssa ], [ %spec.select44.epil, %._crit_edge67.epilog-lcssa ]
  store i32 %spec.select44.lcssa, ptr @ans, align 4, !tbaa !5
  br label %.preheader.thread

.preheader.thread:                                ; preds = %.preheader47.lr.ph, %._crit_edge67, %.preheader
  %67 = tail call noundef i32 @_Z3powii(i32 noundef 26, i32 noundef %4)
  %68 = load i32, ptr @ans, align 4, !tbaa !5
  %69 = sub nsw i32 %67, %68
  %70 = icmp slt i32 %69, 0
  %71 = add nsw i32 %69, 10007
  %spec.select = select i1 %70, i32 %71, i32 %69
  store i32 %spec.select, ptr @ans, align 4, !tbaa !5
  %72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.select)
  ret i32 0

73:                                               ; preds = %73, %.lr.ph66.new
  %indvars.iv84 = phi i64 [ 0, %.lr.ph66.new ], [ %indvars.iv.next85.1, %73 ]
  %spec.select446264 = phi i32 [ %ans.promoted, %.lr.ph66.new ], [ %spec.select44.1, %73 ]
  %niter = phi i64 [ 0, %.lr.ph66.new ], [ %niter.next.1, %73 ]
  %74 = getelementptr inbounds [101 x [6001 x i32]], ptr @f, i64 0, i64 %10, i64 %indvars.iv84
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = add nsw i32 %spec.select446264, %75
  %77 = icmp sgt i32 %76, 10006
  %78 = add nsw i32 %76, -10007
  %spec.select44 = select i1 %77, i32 %78, i32 %76
  %indvars.iv.next85 = or disjoint i64 %indvars.iv84, 1
  %79 = getelementptr inbounds [101 x [6001 x i32]], ptr @f, i64 0, i64 %10, i64 %indvars.iv.next85
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nsw i32 %spec.select44, %80
  %82 = icmp sgt i32 %81, 10006
  %83 = add nsw i32 %81, -10007
  %spec.select44.1 = select i1 %82, i32 %83, i32 %81
  %indvars.iv.next85.1 = add nuw nsw i64 %indvars.iv84, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge67.unr-lcssa, label %73, !llvm.loop !22
}

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

attributes #0 = { 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 #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 = { 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" }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !14, i64 112}
!13 = !{!"_ZTS2AC", !7, i64 0, !6, i64 104, !6, i64 108, !14, i64 112}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!13, !6, i64 108}
!18 = distinct !{!18, !10}
!19 = !{!13, !6, i64 104}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}


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