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

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@f = external dso_local global [2000 x [2000 x i32]], align 16
@val = external dso_local global [26 x i32], align 16
@s = external dso_local global [2001 x i8], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 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 i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @s)
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %21, %0
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %12 = icmp slt i32 %10, %11
  br i1 %12, label %13, label %24

13:                                               ; preds = %9
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [2001 x i8], ptr @s, i64 0, i64 %15
  %17 = load i8, ptr %16, align 1, !tbaa !9
  %18 = sext i8 %17 to i32
  %19 = sub nsw i32 %18, 97
  %20 = trunc i32 %19 to i8
  store i8 %20, ptr %16, align 1, !tbaa !9
  br label %21

21:                                               ; preds = %13
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %2, align 4, !tbaa !5
  br label %9, !llvm.loop !10

24:                                               ; preds = %9
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %38, %24
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %29, label %41

29:                                               ; preds = %25
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %5, ptr noundef %3, ptr noundef %4)
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_Z3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = load i8, ptr %5, align 1, !tbaa !9
  %34 = sext i8 %33 to i32
  %35 = sub nsw i32 %34, 97
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [26 x i32], ptr @val, i64 0, i64 %36
  store i32 %32, ptr %37, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %29
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %2, align 4, !tbaa !5
  br label %25, !llvm.loop !12

41:                                               ; preds = %25
  %42 = load i32, ptr @m, align 4, !tbaa !5
  %43 = sub nsw i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %128, %41
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = icmp sge i32 %45, 0
  br i1 %46, label %47, label %131

47:                                               ; preds = %44
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %3, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %124, %47
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = load i32, ptr @m, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %54, label %127

54:                                               ; preds = %50
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [2001 x i8], ptr @s, i64 0, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !9
  %59 = sext i8 %58 to i32
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [2001 x i8], ptr @s, i64 0, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !9
  %64 = sext i8 %63 to i32
  %65 = icmp eq i32 %59, %64
  br i1 %65, label %66, label %82

66:                                               ; preds = %54
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [2000 x [2000 x i32]], ptr @f, i64 0, i64 %69
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = sub nsw i32 %71, 1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [2000 x i32], ptr %70, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [2000 x [2000 x i32]], ptr @f, i64 0, i64 %77
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [2000 x i32], ptr %78, i64 0, i64 %80
  store i32 %75, ptr %81, align 4, !tbaa !5
  br label %123

82:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %83 = load i32, ptr %2, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [2000 x [2000 x i32]], ptr @f, i64 0, i64 %84
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %87 = sub nsw i32 %86, 1
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [2000 x i32], ptr %85, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = load i32, ptr %3, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [2001 x i8], ptr @s, i64 0, i64 %92
  %94 = load i8, ptr %93, align 1, !tbaa !9
  %95 = sext i8 %94 to i64
  %96 = getelementptr inbounds [26 x i32], ptr @val, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = add nsw i32 %90, %97
  store i32 %98, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [2000 x [2000 x i32]], ptr @f, i64 0, i64 %101
  %103 = load i32, ptr %3, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [2000 x i32], ptr %102, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [2001 x i8], ptr @s, i64 0, i64 %108
  %110 = load i8, ptr %109, align 1, !tbaa !9
  %111 = sext i8 %110 to i64
  %112 = getelementptr inbounds [26 x i32], ptr @val, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = add nsw i32 %106, %113
  store i32 %114, ptr %7, align 4, !tbaa !5
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_Z3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = load i32, ptr %2, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [2000 x [2000 x i32]], ptr @f, i64 0, i64 %118
  %120 = load i32, ptr %3, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [2000 x i32], ptr %119, i64 0, i64 %121
  store i32 %116, ptr %122, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %123

123:                                              ; preds = %82, %66
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %3, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %3, align 4, !tbaa !5
  br label %50, !llvm.loop !13

127:                                              ; preds = %50
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %2, align 4, !tbaa !5
  %130 = add nsw i32 %129, -1
  store i32 %130, ptr %2, align 4, !tbaa !5
  br label %44, !llvm.loop !14

131:                                              ; preds = %44
  %132 = load i32, ptr @m, align 4, !tbaa !5
  %133 = sub nsw i32 %132, 1
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [2000 x i32], ptr @f, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %136)
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  ret i32 0
}

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_Z3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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 = { 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}


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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [2000 x [2000 x i32]], align 16
@val = external dso_local local_unnamed_addr global [26 x i32], align 16
@s = external dso_local global [2001 x i8], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 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 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i8, align 1
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #4
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @s)
  %7 = load i32, ptr @m, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %iter.check, label %.preheader16

iter.check:                                       ; preds = %0
  %wide.trip.count = zext nneg i32 %7 to i64
  %min.iters.check = icmp ult i32 %7, 8
  br i1 %min.iters.check, label %.lr.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check33 = icmp ult i32 %7, 32
  br i1 %min.iters.check33, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %wide.trip.count, 2147483616
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %9 = getelementptr inbounds [2001 x i8], ptr @s, i64 0, i64 %index
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  %wide.load = load <16 x i8>, ptr %9, align 16, !tbaa !9
  %wide.load34 = load <16 x i8>, ptr %10, align 16, !tbaa !9
  %11 = add <16 x i8> %wide.load, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97>
  %12 = add <16 x i8> %wide.load34, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97>
  store <16 x i8> %11, ptr %9, align 16, !tbaa !9
  store <16 x i8> %12, ptr %10, align 16, !tbaa !9
  %index.next = add nuw i64 %index, 32
  %13 = icmp eq i64 %index.next, %n.vec
  br i1 %13, label %middle.block, label %vector.body, !llvm.loop !10

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader16, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %n.vec.remaining = and i64 %wide.trip.count, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph.preheader, label %vec.epilog.ph

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec36, %vec.epilog.middle.block ]
  br label %.lr.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec36 = and i64 %wide.trip.count, 2147483640
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index37 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next39, %vec.epilog.vector.body ]
  %14 = getelementptr inbounds [2001 x i8], ptr @s, i64 0, i64 %index37
  %wide.load38 = load <8 x i8>, ptr %14, align 8, !tbaa !9
  %15 = add <8 x i8> %wide.load38, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97>
  store <8 x i8> %15, ptr %14, align 8, !tbaa !9
  %index.next39 = add nuw i64 %index37, 8
  %16 = icmp eq i64 %index.next39, %n.vec36
  br i1 %16, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n40 = icmp eq i64 %n.vec36, %wide.trip.count
  br i1 %cmp.n40, label %.preheader16, label %.lr.ph.preheader

.preheader16:                                     ; preds = %.lr.ph, %middle.block, %vec.epilog.middle.block, %0
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph19, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader ]
  %19 = getelementptr inbounds [2001 x i8], ptr @s, i64 0, i64 %indvars.iv
  %20 = load i8, ptr %19, align 1, !tbaa !9
  %21 = add i8 %20, -97
  store i8 %21, ptr %19, align 1, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader16, label %.lr.ph, !llvm.loop !15

.lr.ph19:                                         ; preds = %.preheader16, %.lr.ph19
  %.118 = phi i32 [ %29, %.lr.ph19 ], [ 0, %.preheader16 ]
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_Z3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = load i8, ptr %3, align 1, !tbaa !9
  %26 = sext i8 %25 to i64
  %27 = add nsw i64 %26, -97
  %28 = getelementptr inbounds [26 x i32], ptr @val, i64 0, i64 %27
  store i32 %24, ptr %28, align 4, !tbaa !5
  %29 = add nuw nsw i32 %.118, 1
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %.lr.ph19, label %._crit_edge.loopexit, !llvm.loop !16

._crit_edge.loopexit:                             ; preds = %.lr.ph19
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader16
  %32 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %7, %.preheader16 ]
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.preheader.preheader, label %._crit_edge25

.preheader.preheader:                             ; preds = %._crit_edge
  %34 = zext nneg i32 %32 to i64
  br label %.preheader

.loopexit:                                        ; preds = %77, %.preheader
  %35 = phi i32 [ %38, %.preheader ], [ %78, %77 ]
  %36 = phi i32 [ %39, %.preheader ], [ %78, %77 ]
  %37 = icmp sgt i64 %indvars.iv27, 1
  br i1 %37, label %.preheader, label %._crit_edge25, !llvm.loop !17

.preheader:                                       ; preds = %.preheader.preheader, %.loopexit
  %38 = phi i32 [ %32, %.preheader.preheader ], [ %35, %.loopexit ]
  %39 = phi i32 [ %32, %.preheader.preheader ], [ %36, %.loopexit ]
  %indvars.iv27 = phi i64 [ %34, %.preheader.preheader ], [ %indvars.iv.next28, %.loopexit ]
  %indvars.iv.next28 = add nsw i64 %indvars.iv27, -1
  %40 = trunc nuw nsw i64 %indvars.iv27 to i32
  store i32 %40, ptr %1, align 4, !tbaa !5
  %41 = sext i32 %39 to i64
  %42 = icmp slt i64 %indvars.iv27, %41
  br i1 %42, label %.lr.ph21, label %.loopexit

.lr.ph21:                                         ; preds = %.preheader
  %43 = getelementptr inbounds [2001 x i8], ptr @s, i64 0, i64 %indvars.iv.next28
  br label %44

44:                                               ; preds = %.lr.ph21, %77
  %45 = phi i32 [ %38, %.lr.ph21 ], [ %78, %77 ]
  %storemerge20 = phi i32 [ %40, %.lr.ph21 ], [ %80, %77 ]
  %46 = load i8, ptr %43, align 1, !tbaa !9
  %47 = sext i32 %storemerge20 to i64
  %48 = getelementptr inbounds [2001 x i8], ptr @s, i64 0, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !9
  %50 = icmp eq i8 %46, %49
  br i1 %50, label %51, label %57

51:                                               ; preds = %44
  %52 = add nsw i32 %storemerge20, -1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [2000 x [2000 x i32]], ptr @f, i64 0, i64 %indvars.iv27, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = getelementptr inbounds [2000 x [2000 x i32]], ptr @f, i64 0, i64 %indvars.iv.next28, i64 %47
  store i32 %55, ptr %56, align 4, !tbaa !5
  br label %77

57:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %58 = add nsw i32 %storemerge20, -1
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [2000 x [2000 x i32]], ptr @f, i64 0, i64 %indvars.iv.next28, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = sext i8 %49 to i64
  %63 = getelementptr inbounds [26 x i32], ptr @val, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = add nsw i32 %64, %61
  store i32 %65, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %66 = getelementptr inbounds [2000 x [2000 x i32]], ptr @f, i64 0, i64 %indvars.iv27, i64 %47
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sext i8 %46 to i64
  %69 = getelementptr inbounds [26 x i32], ptr @val, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = add nsw i32 %70, %67
  store i32 %71, ptr %5, align 4, !tbaa !5
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_Z3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = load i32, ptr %1, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [2000 x [2000 x i32]], ptr @f, i64 0, i64 %indvars.iv.next28, i64 %75
  store i32 %73, ptr %76, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %.pre30 = load i32, ptr @m, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %51, %57
  %78 = phi i32 [ %45, %51 ], [ %.pre30, %57 ]
  %79 = phi i32 [ %storemerge20, %51 ], [ %74, %57 ]
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %1, align 4, !tbaa !5
  %81 = icmp slt i32 %80, %78
  br i1 %81, label %44, label %.loopexit, !llvm.loop !18

._crit_edge25:                                    ; preds = %.loopexit, %._crit_edge
  %82 = phi i32 [ %32, %._crit_edge ], [ %35, %.loopexit ]
  %83 = add nsw i32 %82, -1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [2000 x i32], ptr @f, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %86)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret i32 0
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_Z3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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 = { 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, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !12, !13}
!15 = distinct !{!15, !11, !13, !12}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}


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