; LLVM IR from tangjz/acm-icpc :: codeforces/complete (797C)

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

@cnt = external dso_local global [26 x i32], align 16
@mx = external dso_local global i32, align 4
@sz = external dso_local global i32, align 4
@len = external dso_local global i32, align 4
@str = external dso_local global [100001 x i8], align 16
@stk = external dso_local global [100001 x i8], align 16
@out = external dso_local global [100001 x i8], align 16
@.str = external hidden unnamed_addr constant [3 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
  store i32 0, ptr %1, align 4
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @str)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %5

5:                                                ; preds = %23, %0
  %6 = load i32, ptr %2, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds [100001 x i8], ptr @str, i64 0, i64 %7
  %9 = load i8, ptr %8, align 1, !tbaa !9
  %10 = icmp ne i8 %9, 0
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %5
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [100001 x i8], ptr @str, i64 0, i64 %14
  %16 = load i8, ptr %15, align 1, !tbaa !9
  %17 = sext i8 %16 to i32
  %18 = sub nsw i32 %17, 97
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [26 x i32], ptr @cnt, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %20, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %12
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %2, align 4, !tbaa !5
  br label %5, !llvm.loop !10

26:                                               ; preds = %11
  store i32 0, ptr @mx, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %40, %26
  %28 = load i32, ptr @mx, align 4, !tbaa !5
  %29 = icmp slt i32 %28, 26
  br i1 %29, label %30, label %37

30:                                               ; preds = %27
  %31 = load i32, ptr @mx, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [26 x i32], ptr @cnt, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = icmp ne i32 %34, 0
  %36 = xor i1 %35, true
  br label %37

37:                                               ; preds = %30, %27
  %38 = phi i1 [ false, %27 ], [ %36, %30 ]
  br i1 %38, label %39, label %43

39:                                               ; preds = %37
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr @mx, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr @mx, align 4, !tbaa !5
  br label %27, !llvm.loop !12

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

44:                                               ; preds = %114, %43
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100001 x i8], ptr @str, i64 0, i64 %46
  %48 = load i8, ptr %47, align 1, !tbaa !9
  %49 = icmp ne i8 %48, 0
  br i1 %49, label %51, label %50

50:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %117

51:                                               ; preds = %44
  br label %52

52:                                               ; preds = %68, %51
  %53 = load i32, ptr @sz, align 4, !tbaa !5
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %65

55:                                               ; preds = %52
  %56 = load i32, ptr @sz, align 4, !tbaa !5
  %57 = sub nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100001 x i8], ptr @stk, i64 0, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !9
  %61 = sext i8 %60 to i32
  %62 = load i32, ptr @mx, align 4, !tbaa !5
  %63 = add nsw i32 97, %62
  %64 = icmp sle i32 %61, %63
  br label %65

65:                                               ; preds = %55, %52
  %66 = phi i1 [ false, %52 ], [ %64, %55 ]
  br i1 %66, label %67, label %78

67:                                               ; preds = %65
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr @sz, align 4, !tbaa !5
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr @sz, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100001 x i8], ptr @stk, i64 0, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !9
  %74 = load i32, ptr @len, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr @len, align 4, !tbaa !5
  %76 = sext i32 %74 to i64
  %77 = getelementptr inbounds [100001 x i8], ptr @out, i64 0, i64 %76
  store i8 %73, ptr %77, align 1, !tbaa !9
  br label %52, !llvm.loop !13

78:                                               ; preds = %65
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100001 x i8], ptr @str, i64 0, i64 %80
  %82 = load i8, ptr %81, align 1, !tbaa !9
  %83 = load i32, ptr @sz, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr @sz, align 4, !tbaa !5
  %85 = sext i32 %83 to i64
  %86 = getelementptr inbounds [100001 x i8], ptr @stk, i64 0, i64 %85
  store i8 %82, ptr %86, align 1, !tbaa !9
  %87 = load i32, ptr %3, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100001 x i8], ptr @str, i64 0, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !9
  %91 = sext i8 %90 to i32
  %92 = sub nsw i32 %91, 97
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [26 x i32], ptr @cnt, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = add nsw i32 %95, -1
  store i32 %96, ptr %94, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %110, %78
  %98 = load i32, ptr @mx, align 4, !tbaa !5
  %99 = icmp slt i32 %98, 26
  br i1 %99, label %100, label %107

100:                                              ; preds = %97
  %101 = load i32, ptr @mx, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [26 x i32], ptr @cnt, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = icmp ne i32 %104, 0
  %106 = xor i1 %105, true
  br label %107

107:                                              ; preds = %100, %97
  %108 = phi i1 [ false, %97 ], [ %106, %100 ]
  br i1 %108, label %109, label %113

109:                                              ; preds = %107
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr @mx, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr @mx, align 4, !tbaa !5
  br label %97, !llvm.loop !14

113:                                              ; preds = %107
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %3, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %3, align 4, !tbaa !5
  br label %44, !llvm.loop !15

117:                                              ; preds = %50
  br label %118

118:                                              ; preds = %122, %117
  %119 = load i32, ptr @sz, align 4, !tbaa !5
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %132

121:                                              ; preds = %118
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr @sz, align 4, !tbaa !5
  %124 = add nsw i32 %123, -1
  store i32 %124, ptr @sz, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100001 x i8], ptr @stk, i64 0, i64 %125
  %127 = load i8, ptr %126, align 1, !tbaa !9
  %128 = load i32, ptr @len, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr @len, align 4, !tbaa !5
  %130 = sext i32 %128 to i64
  %131 = getelementptr inbounds [100001 x i8], ptr @out, i64 0, i64 %130
  store i8 %127, ptr %131, align 1, !tbaa !9
  br label %118, !llvm.loop !16

132:                                              ; preds = %118
  %133 = load i32, ptr @len, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [100001 x i8], ptr @out, i64 0, i64 %134
  store i8 0, ptr %135, align 1, !tbaa !9
  %136 = call i32 @puts(ptr noundef @out)
  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

declare i32 @puts(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 = { 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}
!16 = distinct !{!16, !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"

@cnt = external dso_local local_unnamed_addr global [26 x i32], align 16
@mx = external dso_local local_unnamed_addr global i32, align 4
@sz = external dso_local local_unnamed_addr global i32, align 4
@len = external dso_local local_unnamed_addr global i32, align 4
@str = external dso_local global [100001 x i8], align 16
@stk = external dso_local local_unnamed_addr global [100001 x i8], align 16
@out = external dso_local global [100001 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nofree 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 @str)
  %2 = load i8, ptr @str, align 16, !tbaa !5
  %.not25 = icmp eq i8 %2, 0
  br i1 %.not25, label %.preheader24, label %.lr.ph

.preheader24:                                     ; preds = %.lr.ph, %0
  %3 = load i32, ptr @cnt, align 16, !tbaa !8
  %.not17 = icmp eq i32 %3, 0
  br i1 %.not17, label %12, label %.critedge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %4 = phi i8 [ %11, %.lr.ph ], [ %2, %0 ]
  %5 = sext i8 %4 to i64
  %6 = add nsw i64 %5, -97
  %7 = getelementptr inbounds [26 x i32], ptr @cnt, i64 0, i64 %6
  %8 = load i32, ptr %7, align 4, !tbaa !8
  %9 = add nsw i32 %8, 1
  store i32 %9, ptr %7, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = getelementptr inbounds [100001 x i8], ptr @str, i64 0, i64 %indvars.iv.next
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %.not = icmp eq i8 %11, 0
  br i1 %.not, label %.preheader24, label %.lr.ph, !llvm.loop !10

12:                                               ; preds = %.preheader24
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !8
  %.not17.1 = icmp eq i32 %13, 0
  br i1 %.not17.1, label %14, label %.critedge

14:                                               ; preds = %12
  %15 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 8), align 8, !tbaa !8
  %.not17.2 = icmp eq i32 %15, 0
  br i1 %.not17.2, label %16, label %.critedge

16:                                               ; preds = %14
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 12), align 4, !tbaa !8
  %.not17.3 = icmp eq i32 %17, 0
  br i1 %.not17.3, label %18, label %.critedge

18:                                               ; preds = %16
  %19 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 16), align 16, !tbaa !8
  %.not17.4 = icmp eq i32 %19, 0
  br i1 %.not17.4, label %20, label %.critedge

20:                                               ; preds = %18
  %21 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 20), align 4, !tbaa !8
  %.not17.5 = icmp eq i32 %21, 0
  br i1 %.not17.5, label %22, label %.critedge

22:                                               ; preds = %20
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 24), align 8, !tbaa !8
  %.not17.6 = icmp eq i32 %23, 0
  br i1 %.not17.6, label %24, label %.critedge

24:                                               ; preds = %22
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 28), align 4, !tbaa !8
  %.not17.7 = icmp eq i32 %25, 0
  br i1 %.not17.7, label %26, label %.critedge

26:                                               ; preds = %24
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 32), align 16, !tbaa !8
  %.not17.8 = icmp eq i32 %27, 0
  br i1 %.not17.8, label %28, label %.critedge

28:                                               ; preds = %26
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 36), align 4, !tbaa !8
  %.not17.9 = icmp eq i32 %29, 0
  br i1 %.not17.9, label %30, label %.critedge

30:                                               ; preds = %28
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 40), align 8, !tbaa !8
  %.not17.10 = icmp eq i32 %31, 0
  br i1 %.not17.10, label %32, label %.critedge

32:                                               ; preds = %30
  %33 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 44), align 4, !tbaa !8
  %.not17.11 = icmp eq i32 %33, 0
  br i1 %.not17.11, label %34, label %.critedge

34:                                               ; preds = %32
  %35 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 48), align 16, !tbaa !8
  %.not17.12 = icmp eq i32 %35, 0
  br i1 %.not17.12, label %36, label %.critedge

36:                                               ; preds = %34
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 52), align 4, !tbaa !8
  %.not17.13 = icmp eq i32 %37, 0
  br i1 %.not17.13, label %38, label %.critedge

38:                                               ; preds = %36
  %39 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 56), align 8, !tbaa !8
  %.not17.14 = icmp eq i32 %39, 0
  br i1 %.not17.14, label %40, label %.critedge

40:                                               ; preds = %38
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 60), align 4, !tbaa !8
  %.not17.15 = icmp eq i32 %41, 0
  br i1 %.not17.15, label %42, label %.critedge

42:                                               ; preds = %40
  %43 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 64), align 16, !tbaa !8
  %.not17.16 = icmp eq i32 %43, 0
  br i1 %.not17.16, label %44, label %.critedge

44:                                               ; preds = %42
  %45 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 68), align 4, !tbaa !8
  %.not17.17 = icmp eq i32 %45, 0
  br i1 %.not17.17, label %46, label %.critedge

46:                                               ; preds = %44
  %47 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 72), align 8, !tbaa !8
  %.not17.18 = icmp eq i32 %47, 0
  br i1 %.not17.18, label %48, label %.critedge

48:                                               ; preds = %46
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 76), align 4, !tbaa !8
  %.not17.19 = icmp eq i32 %49, 0
  br i1 %.not17.19, label %50, label %.critedge

50:                                               ; preds = %48
  %51 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 80), align 16, !tbaa !8
  %.not17.20 = icmp eq i32 %51, 0
  br i1 %.not17.20, label %52, label %.critedge

52:                                               ; preds = %50
  %53 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 84), align 4, !tbaa !8
  %.not17.21 = icmp eq i32 %53, 0
  br i1 %.not17.21, label %54, label %.critedge

54:                                               ; preds = %52
  %55 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 88), align 8, !tbaa !8
  %.not17.22 = icmp eq i32 %55, 0
  br i1 %.not17.22, label %56, label %.critedge

56:                                               ; preds = %54
  %57 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 92), align 4, !tbaa !8
  %.not17.23 = icmp eq i32 %57, 0
  br i1 %.not17.23, label %58, label %.critedge

58:                                               ; preds = %56
  %59 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 96), align 16, !tbaa !8
  %.not17.24 = icmp eq i32 %59, 0
  br i1 %.not17.24, label %60, label %.critedge

60:                                               ; preds = %58
  %61 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 100), align 4, !tbaa !8
  %.not17.25 = icmp eq i32 %61, 0
  %spec.select = select i1 %.not17.25, i32 26, i32 25
  br label %.critedge

.critedge:                                        ; preds = %60, %58, %56, %54, %52, %50, %48, %46, %44, %42, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %.preheader24
  %storemerge.lcssa = phi i32 [ 0, %.preheader24 ], [ 1, %12 ], [ 2, %14 ], [ 3, %16 ], [ 4, %18 ], [ 5, %20 ], [ 6, %22 ], [ 7, %24 ], [ 8, %26 ], [ 9, %28 ], [ 10, %30 ], [ 11, %32 ], [ 12, %34 ], [ 13, %36 ], [ 14, %38 ], [ 15, %40 ], [ 16, %42 ], [ 17, %44 ], [ 18, %46 ], [ 19, %48 ], [ 20, %50 ], [ 21, %52 ], [ 22, %54 ], [ 23, %56 ], [ 24, %58 ], [ %spec.select, %60 ]
  store i32 %storemerge.lcssa, ptr @mx, align 4, !tbaa !8
  %sz.promoted34 = load i32, ptr @sz, align 4, !tbaa !8
  %len.promoted36 = load i32, ptr @len, align 4, !tbaa !8
  br i1 %.not25, label %.preheader, label %.preheader23

.preheader23:                                     ; preds = %.critedge, %.critedge4
  %len.promoted86 = phi i32 [ %len.promoted85, %.critedge4 ], [ %len.promoted36, %.critedge ]
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %.critedge4 ], [ 0, %.critedge ]
  %62 = phi i8 [ %105, %.critedge4 ], [ %2, %.critedge ]
  %sz.promoted3550 = phi i32 [ %89, %.critedge4 ], [ %sz.promoted34, %.critedge ]
  %len.promoted3949 = phi i32 [ %len.promoted38, %.critedge4 ], [ %len.promoted36, %.critedge ]
  %.pr4248 = phi i32 [ %.pr40, %.critedge4 ], [ %storemerge.lcssa, %.critedge ]
  %.not2028 = icmp eq i32 %sz.promoted3550, 0
  br i1 %.not2028, label %.critedge2, label %.lr.ph29

.lr.ph29:                                         ; preds = %.preheader23
  %63 = add nsw i32 %.pr4248, 97
  %64 = sext i32 %len.promoted3949 to i64
  %65 = sext i32 %sz.promoted3550 to i64
  %66 = add i32 %len.promoted3949, %sz.promoted3550
  %indvars.iv.next66101 = add nsw i64 %65, -1
  %67 = getelementptr inbounds [100001 x i8], ptr @stk, i64 0, i64 %indvars.iv.next66101
  %68 = load i8, ptr %67, align 1, !tbaa !5
  %69 = sext i8 %68 to i32
  %.not21102 = icmp slt i32 %63, %69
  br i1 %.not21102, label %.critedge2.loopexit.split.loop.exit89, label %.lr.ph105

..preheader_crit_edge:                            ; preds = %.critedge4
  store i32 %89, ptr @sz, align 4, !tbaa !8
  br label %.preheader

.preheader:                                       ; preds = %..preheader_crit_edge, %.critedge
  %len.promoted = phi i32 [ %len.promoted85, %..preheader_crit_edge ], [ %len.promoted36, %.critedge ]
  %sz.promoted = phi i32 [ %89, %..preheader_crit_edge ], [ %sz.promoted34, %.critedge ]
  %.not1953 = icmp eq i32 %sz.promoted, 0
  br i1 %.not1953, label %110, label %.lr.ph54.preheader

.lr.ph54.preheader:                               ; preds = %.preheader
  %70 = sext i32 %sz.promoted to i64
  %71 = sext i32 %len.promoted to i64
  %min.iters.check = icmp ult i32 %sz.promoted, 32
  br i1 %min.iters.check, label %.lr.ph54.preheader113, label %vector.ph

.lr.ph54.preheader113:                            ; preds = %middle.block, %.lr.ph54.preheader
  %indvars.iv77.ph = phi i64 [ %71, %.lr.ph54.preheader ], [ %ind.end, %middle.block ]
  %indvars.iv75.ph = phi i64 [ %70, %.lr.ph54.preheader ], [ %ind.end108, %middle.block ]
  br label %.lr.ph54

vector.ph:                                        ; preds = %.lr.ph54.preheader
  %n.vec = and i64 %70, -32
  %ind.end = add nsw i64 %n.vec, %71
  %ind.end108 = and i64 %70, 31
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %71
  %72 = xor i64 %index, -1
  %73 = add i64 %72, %70
  %74 = getelementptr inbounds [100001 x i8], ptr @stk, i64 0, i64 %73
  %75 = getelementptr inbounds i8, ptr %74, i64 -15
  %76 = getelementptr inbounds i8, ptr %74, i64 -31
  %wide.load = load <16 x i8>, ptr %75, align 1, !tbaa !5
  %reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
  %wide.load111 = load <16 x i8>, ptr %76, align 1, !tbaa !5
  %reverse112 = shufflevector <16 x i8> %wide.load111, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
  %77 = getelementptr inbounds [100001 x i8], ptr @out, i64 0, i64 %offset.idx
  %78 = getelementptr inbounds i8, ptr %77, i64 16
  store <16 x i8> %reverse, ptr %77, align 1, !tbaa !5
  store <16 x i8> %reverse112, ptr %78, align 1, !tbaa !5
  %index.next = add nuw i64 %index, 32
  %79 = icmp eq i64 %index.next, %n.vec
  br i1 %79, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %70
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph54.preheader113

80:                                               ; preds = %.lr.ph105
  %indvars.iv.next66 = add nsw i64 %indvars.iv.next66104, -1
  %81 = getelementptr inbounds [100001 x i8], ptr @stk, i64 0, i64 %indvars.iv.next66
  %82 = load i8, ptr %81, align 1, !tbaa !5
  %83 = sext i8 %82 to i32
  %.not21 = icmp slt i32 %63, %83
  br i1 %.not21, label %.critedge2.loopexit.split.loop.exit89.loopexit, label %.lr.ph105, !llvm.loop !15

.lr.ph105:                                        ; preds = %.lr.ph29, %80
  %84 = phi i8 [ %82, %80 ], [ %68, %.lr.ph29 ]
  %indvars.iv.next66104 = phi i64 [ %indvars.iv.next66, %80 ], [ %indvars.iv.next66101, %.lr.ph29 ]
  %indvars.iv63103 = phi i64 [ %indvars.iv.next64, %80 ], [ %64, %.lr.ph29 ]
  %indvars.iv.next64 = add nsw i64 %indvars.iv63103, 1
  %85 = trunc nsw i64 %indvars.iv.next64 to i32
  %86 = getelementptr inbounds [100001 x i8], ptr @out, i64 0, i64 %indvars.iv63103
  store i8 %84, ptr %86, align 1, !tbaa !5
  %.not20 = icmp eq i64 %indvars.iv.next66104, 0
  br i1 %.not20, label %.critedge2.loopexit, label %80, !llvm.loop !15

.critedge2.loopexit.split.loop.exit89.loopexit:   ; preds = %80
  store i32 %85, ptr @len, align 4, !tbaa !8
  br label %.critedge2.loopexit.split.loop.exit89

.critedge2.loopexit.split.loop.exit89:            ; preds = %.critedge2.loopexit.split.loop.exit89.loopexit, %.lr.ph29
  %len.promoted84.lcssa = phi i32 [ %len.promoted86, %.lr.ph29 ], [ %85, %.critedge2.loopexit.split.loop.exit89.loopexit ]
  %indvars.iv65.lcssa = phi i64 [ %65, %.lr.ph29 ], [ %indvars.iv.next66104, %.critedge2.loopexit.split.loop.exit89.loopexit ]
  %indvars.iv63.lcssa = phi i64 [ %64, %.lr.ph29 ], [ %indvars.iv.next64, %.critedge2.loopexit.split.loop.exit89.loopexit ]
  %87 = trunc nsw i64 %indvars.iv63.lcssa to i32
  %88 = trunc nsw i64 %indvars.iv65.lcssa to i32
  br label %.critedge2

.critedge2.loopexit:                              ; preds = %.lr.ph105
  store i32 %85, ptr @len, align 4, !tbaa !8
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge2.loopexit, %.critedge2.loopexit.split.loop.exit89, %.preheader23
  %len.promoted85 = phi i32 [ %len.promoted86, %.preheader23 ], [ %len.promoted84.lcssa, %.critedge2.loopexit.split.loop.exit89 ], [ %85, %.critedge2.loopexit ]
  %len.promoted38 = phi i32 [ %len.promoted3949, %.preheader23 ], [ %87, %.critedge2.loopexit.split.loop.exit89 ], [ %66, %.critedge2.loopexit ]
  %.lcssa = phi i32 [ 0, %.preheader23 ], [ %88, %.critedge2.loopexit.split.loop.exit89 ], [ 0, %.critedge2.loopexit ]
  %89 = add nsw i32 %.lcssa, 1
  %90 = sext i32 %.lcssa to i64
  %91 = getelementptr inbounds [100001 x i8], ptr @stk, i64 0, i64 %90
  store i8 %62, ptr %91, align 1, !tbaa !5
  %92 = sext i8 %62 to i64
  %93 = add nsw i64 %92, -97
  %94 = getelementptr inbounds [26 x i32], ptr @cnt, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !8
  %96 = add nsw i32 %95, -1
  store i32 %96, ptr %94, align 4, !tbaa !8
  %97 = icmp slt i32 %.pr4248, 26
  br i1 %97, label %.lr.ph32.preheader, label %.critedge4

.lr.ph32.preheader:                               ; preds = %.critedge2
  %98 = sext i32 %.pr4248 to i64
  br label %.lr.ph32

.lr.ph32:                                         ; preds = %.lr.ph32.preheader, %101
  %indvars.iv70 = phi i64 [ %98, %.lr.ph32.preheader ], [ %indvars.iv.next71, %101 ]
  %99 = getelementptr inbounds [26 x i32], ptr @cnt, i64 0, i64 %indvars.iv70
  %100 = load i32, ptr %99, align 4, !tbaa !8
  %.not22 = icmp eq i32 %100, 0
  br i1 %.not22, label %101, label %.critedge4.loopexit.split.loop.exit

101:                                              ; preds = %.lr.ph32
  %indvars.iv.next71 = add nsw i64 %indvars.iv70, 1
  %102 = trunc nsw i64 %indvars.iv.next71 to i32
  store i32 %102, ptr @mx, align 4, !tbaa !8
  %exitcond.not = icmp eq i64 %indvars.iv.next71, 26
  br i1 %exitcond.not, label %.critedge4, label %.lr.ph32, !llvm.loop !16

.critedge4.loopexit.split.loop.exit:              ; preds = %.lr.ph32
  %103 = trunc nsw i64 %indvars.iv70 to i32
  br label %.critedge4

.critedge4:                                       ; preds = %101, %.critedge4.loopexit.split.loop.exit, %.critedge2
  %.pr40 = phi i32 [ %.pr4248, %.critedge2 ], [ %103, %.critedge4.loopexit.split.loop.exit ], [ 26, %101 ]
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %104 = getelementptr inbounds [100001 x i8], ptr @str, i64 0, i64 %indvars.iv.next74
  %105 = load i8, ptr %104, align 1, !tbaa !5
  %.not18 = icmp eq i8 %105, 0
  br i1 %.not18, label %..preheader_crit_edge, label %.preheader23, !llvm.loop !17

.lr.ph54:                                         ; preds = %.lr.ph54.preheader113, %.lr.ph54
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %.lr.ph54 ], [ %indvars.iv77.ph, %.lr.ph54.preheader113 ]
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.lr.ph54 ], [ %indvars.iv75.ph, %.lr.ph54.preheader113 ]
  %indvars.iv.next76 = add nsw i64 %indvars.iv75, -1
  %106 = getelementptr inbounds [100001 x i8], ptr @stk, i64 0, i64 %indvars.iv.next76
  %107 = load i8, ptr %106, align 1, !tbaa !5
  %indvars.iv.next78 = add nsw i64 %indvars.iv77, 1
  %108 = getelementptr inbounds [100001 x i8], ptr @out, i64 0, i64 %indvars.iv77
  store i8 %107, ptr %108, align 1, !tbaa !5
  %.not19 = icmp eq i64 %indvars.iv.next76, 0
  br i1 %.not19, label %._crit_edge, label %.lr.ph54, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph54, %middle.block
  %indvars.iv.next78.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next78, %.lr.ph54 ]
  %109 = trunc nsw i64 %indvars.iv.next78.lcssa to i32
  store i32 0, ptr @sz, align 4, !tbaa !8
  store i32 %109, ptr @len, align 4, !tbaa !8
  br label %110

110:                                              ; preds = %._crit_edge, %.preheader
  %111 = phi i32 [ %109, %._crit_edge ], [ %len.promoted, %.preheader ]
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100001 x i8], ptr @out, i64 0, i64 %112
  store i8 0, ptr %113, align 1, !tbaa !5
  %114 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @out)
  ret i32 0
}

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

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

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

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11, !14, !13}


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