; LLVM IR from reyadussalahin/problem-solving :: greedy/non_classical/codeforces/F1506G (Solution)

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

@s = external dso_local global [200020 x i8], align 16
@stck = external dso_local global [200020 x i32], 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 [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [116 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = 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 [26 x i32], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [32 x i8], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %159, %0
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %17
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @s)
  call void @llvm.lifetime.start.p0(i64 104, ptr %5) #5
  call void @llvm.memset.p0.i64(ptr align 16 %5, i8 0, i64 104, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %52, %22
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [200020 x i8], ptr @s, i64 0, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !9
  %29 = icmp ne i8 %28, 0
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [200020 x i8], ptr @s, i64 0, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !9
  %36 = sext i8 %35 to i32
  %37 = sub nsw i32 %36, 97
  store i32 %37, ptr %8, align 4, !tbaa !5
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [26 x i32], ptr %5, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %46

43:                                               ; preds = %31
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %6, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %43, %31
  %47 = load i32, ptr %8, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [26 x i32], ptr %5, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %49, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %52

52:                                               ; preds = %46
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %7, align 4, !tbaa !5
  br label %24, !llvm.loop !10

55:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #5
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %150, %55
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %59, label %156

59:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 -1, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %60 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %60, ptr %14, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %110, %59
  %62 = load i32, ptr %14, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [200020 x i8], ptr @s, i64 0, i64 %63
  %65 = load i8, ptr %64, align 1, !tbaa !9
  %66 = icmp ne i8 %65, 0
  br i1 %66, label %68, label %67

67:                                               ; preds = %61
  store i32 10, ptr %4, align 4
  br label %113

68:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %69 = load i32, ptr %14, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [200020 x i8], ptr @s, i64 0, i64 %70
  %72 = load i8, ptr %71, align 1, !tbaa !9
  %73 = sext i8 %72 to i32
  %74 = sub nsw i32 %73, 97
  store i32 %74, ptr %15, align 4, !tbaa !5
  %75 = load i32, ptr %15, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [26 x i32], ptr %5, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %68
  store i32 12, ptr %4, align 4
  br label %107

81:                                               ; preds = %68
  %82 = load i32, ptr %15, align 4, !tbaa !5
  %83 = load i32, ptr %12, align 4, !tbaa !5
  %84 = icmp sgt i32 %82, %83
  br i1 %84, label %85, label %89

85:                                               ; preds = %81
  %86 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %86, ptr %12, align 4, !tbaa !5
  %87 = load i32, ptr %14, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %11, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %85, %81
  %90 = load i32, ptr %15, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [26 x i32], ptr %5, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add nsw i32 %93, -1
  store i32 %94, ptr %92, align 4, !tbaa !5
  %95 = load i32, ptr %14, align 4, !tbaa !5
  %96 = load i32, ptr %13, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %13, align 4, !tbaa !5
  %98 = sext i32 %96 to i64
  %99 = getelementptr inbounds [200020 x i32], ptr @stck, i64 0, i64 %98
  store i32 %95, ptr %99, align 4, !tbaa !5
  %100 = load i32, ptr %15, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [26 x i32], ptr %5, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = icmp eq i32 %103, 0
  br i1 %104, label %105, label %106

105:                                              ; preds = %89
  store i32 10, ptr %4, align 4
  br label %107

106:                                              ; preds = %89
  store i32 0, ptr %4, align 4
  br label %107

107:                                              ; preds = %106, %105, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  %108 = load i32, ptr %4, align 4
  switch i32 %108, label %113 [
    i32 0, label %109
    i32 12, label %110
  ]

109:                                              ; preds = %107
  br label %110

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

113:                                              ; preds = %107, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %12, align 4, !tbaa !5
  %116 = icmp ne i32 %115, -1
  br i1 %116, label %117, label %118

117:                                              ; preds = %114
  br label %120

118:                                              ; preds = %114
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 57, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

119:                                              ; No predecessors!
  br label %120

120:                                              ; preds = %119, %117
  %121 = load i32, ptr %12, align 4, !tbaa !5
  %122 = add nsw i32 %121, 97
  %123 = trunc i32 %122 to i8
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %10, align 4, !tbaa !5
  %126 = sext i32 %124 to i64
  %127 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 %126
  store i8 %123, ptr %127, align 1, !tbaa !9
  br label %128

128:                                              ; preds = %136, %120
  %129 = load i32, ptr %13, align 4, !tbaa !5
  %130 = add nsw i32 %129, -1
  store i32 %130, ptr %13, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [200020 x i32], ptr @stck, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = load i32, ptr %11, align 4, !tbaa !5
  %135 = icmp sge i32 %133, %134
  br i1 %135, label %136, label %150

136:                                              ; preds = %128
  %137 = load i32, ptr %13, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [200020 x i32], ptr @stck, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [200020 x i8], ptr @s, i64 0, i64 %141
  %143 = load i8, ptr %142, align 1, !tbaa !9
  %144 = sext i8 %143 to i32
  %145 = sub nsw i32 %144, 97
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [26 x i32], ptr %5, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %147, align 4, !tbaa !5
  br label %128, !llvm.loop !13

150:                                              ; preds = %128
  %151 = load i32, ptr %12, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [26 x i32], ptr %5, i64 0, i64 %152
  store i32 0, ptr %153, align 4, !tbaa !5
  %154 = load i32, ptr %6, align 4, !tbaa !5
  %155 = add nsw i32 %154, -1
  store i32 %155, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %56, !llvm.loop !14

156:                                              ; preds = %56
  %157 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 0
  %158 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %157)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr %5) #5
  br label %159

159:                                              ; preds = %156
  %160 = load i32, ptr %3, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %3, align 4, !tbaa !5
  br label %17, !llvm.loop !15

162:                                              ; preds = %21
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %163 = load i32, ptr %1, align 4
  ret i32 %163
}

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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

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

@s = external dso_local global [200020 x i8], align 16
@stck = external dso_local local_unnamed_addr global [200020 x i32], 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 [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [116 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = 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 = alloca i32, align 4
  %2 = alloca [26 x i32], align 16
  %3 = alloca [32 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph92, label %._crit_edge93

._crit_edge93:                                    ; preds = %._crit_edge89, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph92:                                         ; preds = %0, %._crit_edge89
  %.04290 = phi i32 [ %64, %._crit_edge89 ], [ 0, %0 ]
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s)
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %2, i8 0, i64 104, i1 false)
  %8 = load i8, ptr @s, align 16, !tbaa !9
  %.not65 = icmp eq i8 %8, 0
  br i1 %.not65, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %.lr.ph92
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %3, i8 0, i64 32, i1 false)
  br label %._crit_edge89

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %3, i8 0, i64 32, i1 false)
  %.not107 = icmp eq i32 %spec.select, 0
  br i1 %.not107, label %._crit_edge89, label %.preheader.preheader

.preheader.preheader:                             ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %spec.select to i64
  br label %.preheader

.lr.ph:                                           ; preds = %.lr.ph92, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph92 ]
  %9 = phi i8 [ %18, %.lr.ph ], [ %8, %.lr.ph92 ]
  %.04466 = phi i32 [ %spec.select, %.lr.ph ], [ 0, %.lr.ph92 ]
  %10 = sext i8 %9 to i64
  %11 = add nsw i64 %10, -97
  %12 = getelementptr inbounds [26 x i32], ptr %2, i64 0, i64 %11
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = icmp eq i32 %13, 0
  %15 = zext i1 %14 to i32
  %spec.select = add nuw nsw i32 %.04466, %15
  %16 = add nsw i32 %13, 1
  store i32 %16, ptr %12, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = getelementptr inbounds [200020 x i8], ptr @s, i64 0, i64 %indvars.iv.next
  %18 = load i8, ptr %17, align 1, !tbaa !9
  %.not = icmp eq i8 %18, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !10

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge85
  %indvars.iv99 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next100, %._crit_edge85 ]
  %.03788 = phi i32 [ 0, %.preheader.preheader ], [ %.4, %._crit_edge85 ]
  %19 = sext i32 %.03788 to i64
  %20 = getelementptr inbounds [200020 x i8], ptr @s, i64 0, i64 %19
  %21 = load i8, ptr %20, align 1, !tbaa !9
  %.not5268 = icmp eq i8 %21, 0
  br i1 %.not5268, label %._crit_edge74.thread, label %.lr.ph73

.lr.ph73:                                         ; preds = %.preheader, %39
  %indvars.iv94 = phi i64 [ %indvars.iv.next95.pre-phi, %39 ], [ %19, %.preheader ]
  %22 = phi i8 [ %41, %39 ], [ %21, %.preheader ]
  %.03271 = phi i32 [ %.1.ph, %39 ], [ 0, %.preheader ]
  %.03370 = phi i32 [ %.235.ph, %39 ], [ -1, %.preheader ]
  %.13869 = phi i32 [ %.340.ph, %39 ], [ %.03788, %.preheader ]
  %23 = sext i8 %22 to i32
  %24 = add nsw i32 %23, -97
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [26 x i32], ptr %2, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %.lr.ph73._crit_edge, label %29

.lr.ph73._crit_edge:                              ; preds = %.lr.ph73
  %.pre = add nsw i64 %indvars.iv94, 1
  br label %39

29:                                               ; preds = %.lr.ph73
  %30 = icmp sgt i32 %24, %.03370
  %31 = add nsw i64 %indvars.iv94, 1
  %32 = trunc nsw i64 %31 to i32
  %spec.select55 = select i1 %30, i32 %32, i32 %.13869
  %spec.select56 = call i32 @llvm.smax.i32(i32 %24, i32 %.03370)
  %33 = add nsw i32 %27, -1
  store i32 %33, ptr %26, align 4, !tbaa !5
  %34 = add nsw i32 %.03271, 1
  %35 = sext i32 %.03271 to i64
  %36 = getelementptr inbounds [200020 x i32], ptr @stck, i64 0, i64 %35
  %37 = trunc nsw i64 %indvars.iv94 to i32
  store i32 %37, ptr %36, align 4, !tbaa !5
  %38 = icmp eq i32 %33, 0
  br i1 %38, label %._crit_edge74, label %39

39:                                               ; preds = %.lr.ph73._crit_edge, %29
  %indvars.iv.next95.pre-phi = phi i64 [ %.pre, %.lr.ph73._crit_edge ], [ %31, %29 ]
  %.340.ph = phi i32 [ %.13869, %.lr.ph73._crit_edge ], [ %spec.select55, %29 ]
  %.235.ph = phi i32 [ %.03370, %.lr.ph73._crit_edge ], [ %spec.select56, %29 ]
  %.1.ph = phi i32 [ %.03271, %.lr.ph73._crit_edge ], [ %34, %29 ]
  %40 = getelementptr inbounds [200020 x i8], ptr @s, i64 0, i64 %indvars.iv.next95.pre-phi
  %41 = load i8, ptr %40, align 1, !tbaa !9
  %.not52 = icmp eq i8 %41, 0
  br i1 %.not52, label %._crit_edge74, label %.lr.ph73, !llvm.loop !12

._crit_edge74:                                    ; preds = %39, %29
  %.4 = phi i32 [ %.340.ph, %39 ], [ %spec.select55, %29 ]
  %.336 = phi i32 [ %.235.ph, %39 ], [ %spec.select56, %29 ]
  %.2 = phi i32 [ %.1.ph, %39 ], [ %34, %29 ]
  %.not53 = icmp eq i32 %.336, -1
  br i1 %.not53, label %._crit_edge74.thread, label %42

._crit_edge74.thread:                             ; preds = %.preheader, %._crit_edge74
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 57, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

42:                                               ; preds = %._crit_edge74
  %43 = trunc nsw i32 %.336 to i8
  %44 = add nsw i8 %43, 97
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %45 = getelementptr inbounds [32 x i8], ptr %3, i64 0, i64 %indvars.iv99
  store i8 %44, ptr %45, align 1, !tbaa !9
  %46 = add nsw i32 %.2, -1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [200020 x i32], ptr @stck, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %.not5482 = icmp slt i32 %49, %.4
  br i1 %.not5482, label %._crit_edge85, label %.lr.ph84

.lr.ph84:                                         ; preds = %42, %.lr.ph84
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %.lr.ph84 ], [ %47, %42 ]
  %50 = phi i32 [ %60, %.lr.ph84 ], [ %49, %42 ]
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [200020 x i8], ptr @s, i64 0, i64 %51
  %53 = load i8, ptr %52, align 1, !tbaa !9
  %54 = sext i8 %53 to i64
  %55 = add nsw i64 %54, -97
  %56 = getelementptr inbounds [26 x i32], ptr %2, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %56, align 4, !tbaa !5
  %indvars.iv.next97 = add nsw i64 %indvars.iv96, -1
  %59 = getelementptr inbounds [200020 x i32], ptr @stck, i64 0, i64 %indvars.iv.next97
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %.not54 = icmp slt i32 %60, %.4
  br i1 %.not54, label %._crit_edge85, label %.lr.ph84, !llvm.loop !13

._crit_edge85:                                    ; preds = %.lr.ph84, %42
  %61 = zext nneg i32 %.336 to i64
  %62 = getelementptr inbounds [26 x i32], ptr %2, i64 0, i64 %61
  store i32 0, ptr %62, align 4, !tbaa !5
  %exitcond.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge89, label %.preheader, !llvm.loop !14

._crit_edge89:                                    ; preds = %._crit_edge85, %._crit_edge.thread, %._crit_edge
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %3)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %2) #6
  %64 = add nuw nsw i32 %.04290, 1
  %65 = load i32, ptr %1, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %.lr.ph92, label %._crit_edge93, !llvm.loop !15
}

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { noreturn 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { noreturn 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}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass