; LLVM IR from tangjz/acm-icpc :: self_training/2015-02-16 (B)

; 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
@s = external dso_local global [51 x i32], align 16
@f = external dso_local global [1001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %10

10:                                               ; preds = %147, %38, %0
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %12 = icmp ne i32 %11, -1
  br i1 %12, label %13, label %16

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

16:                                               ; preds = %13, %10
  %17 = phi i1 [ false, %10 ], [ %15, %13 ]
  br i1 %17, label %18, label %148

18:                                               ; preds = %16
  call void @llvm.memset.p0.i64(ptr align 16 @s, i8 0, i64 204, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 -1, i64 4004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  br label %19

19:                                               ; preds = %31, %18
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

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

24:                                               ; preds = %19
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [51 x i32], ptr @s, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %28, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %24
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !9

34:                                               ; preds = %23
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m)
  %36 = load i32, ptr @m, align 4, !tbaa !5
  %37 = icmp slt i32 %36, 5
  br i1 %37, label %38, label %41

38:                                               ; preds = %34
  %39 = load i32, ptr @m, align 4, !tbaa !5
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %39)
  br label %10, !llvm.loop !11

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

42:                                               ; preds = %60, %41
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  store i32 7, ptr %6, align 4
  br label %63

46:                                               ; preds = %42
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [51 x i32], ptr @s, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %59

52:                                               ; preds = %46
  %53 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %53, ptr %4, align 4, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [51 x i32], ptr @s, 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
  store i32 7, ptr %6, align 4
  br label %63

59:                                               ; preds = %46
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = add nsw i32 %61, -1
  store i32 %62, ptr %5, align 4, !tbaa !5
  br label %42, !llvm.loop !12

63:                                               ; preds = %52, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %64

64:                                               ; preds = %63
  store i32 0, ptr @f, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %119, %64
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = icmp sle i32 %66, 50
  br i1 %67, label %69, label %68

68:                                               ; preds = %65
  store i32 10, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %122

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

70:                                               ; preds = %115, %69
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = load i32, ptr @m, align 4, !tbaa !5
  %73 = sub nsw i32 %72, 5
  %74 = icmp sle i32 %71, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %70
  store i32 13, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %118

76:                                               ; preds = %70
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = icmp sge i32 %80, 0
  br i1 %81, label %82, label %90

82:                                               ; preds = %76
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [51 x i32], ptr @s, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %88
  store i32 %86, ptr %89, align 4, !tbaa !5
  br label %114

90:                                               ; preds = %76
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = icmp sge i32 %91, %92
  br i1 %93, label %94, label %113

94:                                               ; preds = %90
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sub nsw i32 %95, %96
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = icmp sgt i32 %100, 0
  br i1 %101, label %102, label %113

102:                                              ; preds = %94
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = sub nsw i32 %103, %104
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sub nsw i32 %108, 1
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %111
  store i32 %109, ptr %112, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %102, %94, %90
  br label %114

114:                                              ; preds = %113, %82
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %8, align 4, !tbaa !5
  br label %70, !llvm.loop !13

118:                                              ; preds = %75
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %7, align 4, !tbaa !5
  br label %65, !llvm.loop !14

122:                                              ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %123 = load i32, ptr @m, align 4, !tbaa !5
  %124 = sub nsw i32 %123, 5
  store i32 %124, ptr %9, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %143, %122
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = icmp sge i32 %126, 0
  br i1 %127, label %129, label %128

128:                                              ; preds = %125
  store i32 16, ptr %6, align 4
  br label %146

129:                                              ; preds = %125
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = icmp sge i32 %133, 0
  br i1 %134, label %135, label %142

135:                                              ; preds = %129
  %136 = load i32, ptr @m, align 4, !tbaa !5
  %137 = load i32, ptr %9, align 4, !tbaa !5
  %138 = sub nsw i32 %136, %137
  %139 = load i32, ptr %4, align 4, !tbaa !5
  %140 = sub nsw i32 %138, %139
  %141 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %140)
  store i32 16, ptr %6, align 4
  br label %146

142:                                              ; preds = %129
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %9, align 4, !tbaa !5
  %145 = add nsw i32 %144, -1
  store i32 %145, ptr %9, align 4, !tbaa !5
  br label %125, !llvm.loop !15

146:                                              ; preds = %135, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %147

147:                                              ; preds = %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %10, !llvm.loop !11

148:                                              ; preds = %16
  ret i32 0
}

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

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

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

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

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

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@s = external dso_local local_unnamed_addr global [51 x i32], align 16
@f = external dso_local local_unnamed_addr global [1001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %3 = icmp ne i32 %2, -1
  %4 = load i32, ptr @n, align 4
  %5 = icmp ne i32 %4, 0
  %6 = select i1 %3, i1 %5, i1 false
  br i1 %6, label %.lr.ph55, label %._crit_edge56

.lr.ph55:                                         ; preds = %0, %.backedge
  %7 = phi i32 [ %25, %.backedge ], [ %4, %0 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(204) @s, i8 0, i64 204, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) @f, i8 -1, i64 4004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph55
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
  %10 = load i32, ptr @m, align 4, !tbaa !5
  %11 = icmp slt i32 %10, 5
  br i1 %11, label %.backedge.sink.split, label %.preheader36.preheader

.preheader36.preheader:                           ; preds = %._crit_edge
  %12 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 200), align 8, !tbaa !5
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %.preheader36.1, label %28

.lr.ph:                                           ; preds = %.lr.ph55, %.lr.ph
  %.03041 = phi i32 [ %19, %.lr.ph ], [ 0, %.lr.ph55 ]
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [51 x i32], ptr @s, i64 0, i64 %15
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = add nsw i32 %17, 1
  store i32 %18, ptr %16, align 4, !tbaa !5
  %19 = add nuw nsw i32 %.03041, 1
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.backedge.sink.split:                             ; preds = %._crit_edge, %102
  %.sink = phi i32 [ %104, %102 ], [ %10, %._crit_edge ]
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink)
  br label %.backedge

.backedge:                                        ; preds = %105, %.backedge.sink.split
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %24 = icmp ne i32 %23, -1
  %25 = load i32, ptr @n, align 4
  %26 = icmp ne i32 %25, 0
  %27 = select i1 %24, i1 %26, i1 false
  br i1 %27, label %.lr.ph55, label %._crit_edge56, !llvm.loop !11

28:                                               ; preds = %.preheader36.49, %.preheader36.48, %.preheader36.47, %.preheader36.46, %.preheader36.45, %.preheader36.44, %.preheader36.43, %.preheader36.42, %.preheader36.41, %.preheader36.40, %.preheader36.39, %.preheader36.38, %.preheader36.37, %.preheader36.36, %.preheader36.35, %.preheader36.34, %.preheader36.33, %.preheader36.32, %.preheader36.31, %.preheader36.30, %.preheader36.29, %.preheader36.28, %.preheader36.27, %.preheader36.26, %.preheader36.25, %.preheader36.24, %.preheader36.23, %.preheader36.22, %.preheader36.21, %.preheader36.20, %.preheader36.19, %.preheader36.18, %.preheader36.17, %.preheader36.16, %.preheader36.15, %.preheader36.14, %.preheader36.13, %.preheader36.12, %.preheader36.11, %.preheader36.10, %.preheader36.9, %.preheader36.8, %.preheader36.7, %.preheader36.6, %.preheader36.5, %.preheader36.4, %.preheader36.3, %.preheader36.2, %.preheader36.1, %.preheader36.preheader
  %.02843.lcssa = phi i32 [ 50, %.preheader36.preheader ], [ 49, %.preheader36.1 ], [ 48, %.preheader36.2 ], [ 47, %.preheader36.3 ], [ 46, %.preheader36.4 ], [ 45, %.preheader36.5 ], [ 44, %.preheader36.6 ], [ 43, %.preheader36.7 ], [ 42, %.preheader36.8 ], [ 41, %.preheader36.9 ], [ 40, %.preheader36.10 ], [ 39, %.preheader36.11 ], [ 38, %.preheader36.12 ], [ 37, %.preheader36.13 ], [ 36, %.preheader36.14 ], [ 35, %.preheader36.15 ], [ 34, %.preheader36.16 ], [ 33, %.preheader36.17 ], [ 32, %.preheader36.18 ], [ 31, %.preheader36.19 ], [ 30, %.preheader36.20 ], [ 29, %.preheader36.21 ], [ 28, %.preheader36.22 ], [ 27, %.preheader36.23 ], [ 26, %.preheader36.24 ], [ 25, %.preheader36.25 ], [ 24, %.preheader36.26 ], [ 23, %.preheader36.27 ], [ 22, %.preheader36.28 ], [ 21, %.preheader36.29 ], [ 20, %.preheader36.30 ], [ 19, %.preheader36.31 ], [ 18, %.preheader36.32 ], [ 17, %.preheader36.33 ], [ 16, %.preheader36.34 ], [ 15, %.preheader36.35 ], [ 14, %.preheader36.36 ], [ 13, %.preheader36.37 ], [ 12, %.preheader36.38 ], [ 11, %.preheader36.39 ], [ 10, %.preheader36.40 ], [ 9, %.preheader36.41 ], [ 8, %.preheader36.42 ], [ 7, %.preheader36.43 ], [ 6, %.preheader36.44 ], [ 5, %.preheader36.45 ], [ 4, %.preheader36.46 ], [ 3, %.preheader36.47 ], [ 2, %.preheader36.48 ], [ 1, %.preheader36.49 ]
  %.lcssa59 = phi i64 [ 50, %.preheader36.preheader ], [ 49, %.preheader36.1 ], [ 48, %.preheader36.2 ], [ 47, %.preheader36.3 ], [ 46, %.preheader36.4 ], [ 45, %.preheader36.5 ], [ 44, %.preheader36.6 ], [ 43, %.preheader36.7 ], [ 42, %.preheader36.8 ], [ 41, %.preheader36.9 ], [ 40, %.preheader36.10 ], [ 39, %.preheader36.11 ], [ 38, %.preheader36.12 ], [ 37, %.preheader36.13 ], [ 36, %.preheader36.14 ], [ 35, %.preheader36.15 ], [ 34, %.preheader36.16 ], [ 33, %.preheader36.17 ], [ 32, %.preheader36.18 ], [ 31, %.preheader36.19 ], [ 30, %.preheader36.20 ], [ 29, %.preheader36.21 ], [ 28, %.preheader36.22 ], [ 27, %.preheader36.23 ], [ 26, %.preheader36.24 ], [ 25, %.preheader36.25 ], [ 24, %.preheader36.26 ], [ 23, %.preheader36.27 ], [ 22, %.preheader36.28 ], [ 21, %.preheader36.29 ], [ 20, %.preheader36.30 ], [ 19, %.preheader36.31 ], [ 18, %.preheader36.32 ], [ 17, %.preheader36.33 ], [ 16, %.preheader36.34 ], [ 15, %.preheader36.35 ], [ 14, %.preheader36.36 ], [ 13, %.preheader36.37 ], [ 12, %.preheader36.38 ], [ 11, %.preheader36.39 ], [ 10, %.preheader36.40 ], [ 9, %.preheader36.41 ], [ 8, %.preheader36.42 ], [ 7, %.preheader36.43 ], [ 6, %.preheader36.44 ], [ 5, %.preheader36.45 ], [ 4, %.preheader36.46 ], [ 3, %.preheader36.47 ], [ 2, %.preheader36.48 ], [ 1, %.preheader36.49 ]
  %.lcssa = phi i32 [ %12, %.preheader36.preheader ], [ %31, %.preheader36.1 ], [ %32, %.preheader36.2 ], [ %33, %.preheader36.3 ], [ %34, %.preheader36.4 ], [ %35, %.preheader36.5 ], [ %36, %.preheader36.6 ], [ %37, %.preheader36.7 ], [ %38, %.preheader36.8 ], [ %39, %.preheader36.9 ], [ %40, %.preheader36.10 ], [ %41, %.preheader36.11 ], [ %42, %.preheader36.12 ], [ %43, %.preheader36.13 ], [ %44, %.preheader36.14 ], [ %45, %.preheader36.15 ], [ %46, %.preheader36.16 ], [ %47, %.preheader36.17 ], [ %48, %.preheader36.18 ], [ %49, %.preheader36.19 ], [ %50, %.preheader36.20 ], [ %51, %.preheader36.21 ], [ %52, %.preheader36.22 ], [ %53, %.preheader36.23 ], [ %54, %.preheader36.24 ], [ %55, %.preheader36.25 ], [ %56, %.preheader36.26 ], [ %57, %.preheader36.27 ], [ %58, %.preheader36.28 ], [ %59, %.preheader36.29 ], [ %60, %.preheader36.30 ], [ %61, %.preheader36.31 ], [ %62, %.preheader36.32 ], [ %63, %.preheader36.33 ], [ %64, %.preheader36.34 ], [ %65, %.preheader36.35 ], [ %66, %.preheader36.36 ], [ %67, %.preheader36.37 ], [ %68, %.preheader36.38 ], [ %69, %.preheader36.39 ], [ %70, %.preheader36.40 ], [ %71, %.preheader36.41 ], [ %72, %.preheader36.42 ], [ %73, %.preheader36.43 ], [ %74, %.preheader36.44 ], [ %75, %.preheader36.45 ], [ %76, %.preheader36.46 ], [ %77, %.preheader36.47 ], [ %78, %.preheader36.48 ], [ %79, %.preheader36.49 ]
  %29 = getelementptr inbounds [51 x i32], ptr @s, i64 0, i64 %.lcssa59
  %30 = add nsw i32 %.lcssa, -1
  store i32 %30, ptr %29, align 4, !tbaa !5
  br label %.preheader.preheader

.preheader36.1:                                   ; preds = %.preheader36.preheader
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 196), align 4, !tbaa !5
  %.not.1 = icmp eq i32 %31, 0
  br i1 %.not.1, label %.preheader36.2, label %28

.preheader36.2:                                   ; preds = %.preheader36.1
  %32 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 192), align 16, !tbaa !5
  %.not.2 = icmp eq i32 %32, 0
  br i1 %.not.2, label %.preheader36.3, label %28

.preheader36.3:                                   ; preds = %.preheader36.2
  %33 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 188), align 4, !tbaa !5
  %.not.3 = icmp eq i32 %33, 0
  br i1 %.not.3, label %.preheader36.4, label %28

.preheader36.4:                                   ; preds = %.preheader36.3
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 184), align 8, !tbaa !5
  %.not.4 = icmp eq i32 %34, 0
  br i1 %.not.4, label %.preheader36.5, label %28

.preheader36.5:                                   ; preds = %.preheader36.4
  %35 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 180), align 4, !tbaa !5
  %.not.5 = icmp eq i32 %35, 0
  br i1 %.not.5, label %.preheader36.6, label %28

.preheader36.6:                                   ; preds = %.preheader36.5
  %36 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 176), align 16, !tbaa !5
  %.not.6 = icmp eq i32 %36, 0
  br i1 %.not.6, label %.preheader36.7, label %28

.preheader36.7:                                   ; preds = %.preheader36.6
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 172), align 4, !tbaa !5
  %.not.7 = icmp eq i32 %37, 0
  br i1 %.not.7, label %.preheader36.8, label %28

.preheader36.8:                                   ; preds = %.preheader36.7
  %38 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 168), align 8, !tbaa !5
  %.not.8 = icmp eq i32 %38, 0
  br i1 %.not.8, label %.preheader36.9, label %28

.preheader36.9:                                   ; preds = %.preheader36.8
  %39 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 164), align 4, !tbaa !5
  %.not.9 = icmp eq i32 %39, 0
  br i1 %.not.9, label %.preheader36.10, label %28

.preheader36.10:                                  ; preds = %.preheader36.9
  %40 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 160), align 16, !tbaa !5
  %.not.10 = icmp eq i32 %40, 0
  br i1 %.not.10, label %.preheader36.11, label %28

.preheader36.11:                                  ; preds = %.preheader36.10
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 156), align 4, !tbaa !5
  %.not.11 = icmp eq i32 %41, 0
  br i1 %.not.11, label %.preheader36.12, label %28

.preheader36.12:                                  ; preds = %.preheader36.11
  %42 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 152), align 8, !tbaa !5
  %.not.12 = icmp eq i32 %42, 0
  br i1 %.not.12, label %.preheader36.13, label %28

.preheader36.13:                                  ; preds = %.preheader36.12
  %43 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 148), align 4, !tbaa !5
  %.not.13 = icmp eq i32 %43, 0
  br i1 %.not.13, label %.preheader36.14, label %28

.preheader36.14:                                  ; preds = %.preheader36.13
  %44 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 144), align 16, !tbaa !5
  %.not.14 = icmp eq i32 %44, 0
  br i1 %.not.14, label %.preheader36.15, label %28

.preheader36.15:                                  ; preds = %.preheader36.14
  %45 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 140), align 4, !tbaa !5
  %.not.15 = icmp eq i32 %45, 0
  br i1 %.not.15, label %.preheader36.16, label %28

.preheader36.16:                                  ; preds = %.preheader36.15
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 136), align 8, !tbaa !5
  %.not.16 = icmp eq i32 %46, 0
  br i1 %.not.16, label %.preheader36.17, label %28

.preheader36.17:                                  ; preds = %.preheader36.16
  %47 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 132), align 4, !tbaa !5
  %.not.17 = icmp eq i32 %47, 0
  br i1 %.not.17, label %.preheader36.18, label %28

.preheader36.18:                                  ; preds = %.preheader36.17
  %48 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 128), align 16, !tbaa !5
  %.not.18 = icmp eq i32 %48, 0
  br i1 %.not.18, label %.preheader36.19, label %28

.preheader36.19:                                  ; preds = %.preheader36.18
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 124), align 4, !tbaa !5
  %.not.19 = icmp eq i32 %49, 0
  br i1 %.not.19, label %.preheader36.20, label %28

.preheader36.20:                                  ; preds = %.preheader36.19
  %50 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 120), align 8, !tbaa !5
  %.not.20 = icmp eq i32 %50, 0
  br i1 %.not.20, label %.preheader36.21, label %28

.preheader36.21:                                  ; preds = %.preheader36.20
  %51 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 116), align 4, !tbaa !5
  %.not.21 = icmp eq i32 %51, 0
  br i1 %.not.21, label %.preheader36.22, label %28

.preheader36.22:                                  ; preds = %.preheader36.21
  %52 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 112), align 16, !tbaa !5
  %.not.22 = icmp eq i32 %52, 0
  br i1 %.not.22, label %.preheader36.23, label %28

.preheader36.23:                                  ; preds = %.preheader36.22
  %53 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 108), align 4, !tbaa !5
  %.not.23 = icmp eq i32 %53, 0
  br i1 %.not.23, label %.preheader36.24, label %28

.preheader36.24:                                  ; preds = %.preheader36.23
  %54 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 104), align 8, !tbaa !5
  %.not.24 = icmp eq i32 %54, 0
  br i1 %.not.24, label %.preheader36.25, label %28

.preheader36.25:                                  ; preds = %.preheader36.24
  %55 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 100), align 4, !tbaa !5
  %.not.25 = icmp eq i32 %55, 0
  br i1 %.not.25, label %.preheader36.26, label %28

.preheader36.26:                                  ; preds = %.preheader36.25
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 96), align 16, !tbaa !5
  %.not.26 = icmp eq i32 %56, 0
  br i1 %.not.26, label %.preheader36.27, label %28

.preheader36.27:                                  ; preds = %.preheader36.26
  %57 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 92), align 4, !tbaa !5
  %.not.27 = icmp eq i32 %57, 0
  br i1 %.not.27, label %.preheader36.28, label %28

.preheader36.28:                                  ; preds = %.preheader36.27
  %58 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 88), align 8, !tbaa !5
  %.not.28 = icmp eq i32 %58, 0
  br i1 %.not.28, label %.preheader36.29, label %28

.preheader36.29:                                  ; preds = %.preheader36.28
  %59 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 84), align 4, !tbaa !5
  %.not.29 = icmp eq i32 %59, 0
  br i1 %.not.29, label %.preheader36.30, label %28

.preheader36.30:                                  ; preds = %.preheader36.29
  %60 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 80), align 16, !tbaa !5
  %.not.30 = icmp eq i32 %60, 0
  br i1 %.not.30, label %.preheader36.31, label %28

.preheader36.31:                                  ; preds = %.preheader36.30
  %61 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 76), align 4, !tbaa !5
  %.not.31 = icmp eq i32 %61, 0
  br i1 %.not.31, label %.preheader36.32, label %28

.preheader36.32:                                  ; preds = %.preheader36.31
  %62 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 72), align 8, !tbaa !5
  %.not.32 = icmp eq i32 %62, 0
  br i1 %.not.32, label %.preheader36.33, label %28

.preheader36.33:                                  ; preds = %.preheader36.32
  %63 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 68), align 4, !tbaa !5
  %.not.33 = icmp eq i32 %63, 0
  br i1 %.not.33, label %.preheader36.34, label %28

.preheader36.34:                                  ; preds = %.preheader36.33
  %64 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 64), align 16, !tbaa !5
  %.not.34 = icmp eq i32 %64, 0
  br i1 %.not.34, label %.preheader36.35, label %28

.preheader36.35:                                  ; preds = %.preheader36.34
  %65 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 60), align 4, !tbaa !5
  %.not.35 = icmp eq i32 %65, 0
  br i1 %.not.35, label %.preheader36.36, label %28

.preheader36.36:                                  ; preds = %.preheader36.35
  %66 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 56), align 8, !tbaa !5
  %.not.36 = icmp eq i32 %66, 0
  br i1 %.not.36, label %.preheader36.37, label %28

.preheader36.37:                                  ; preds = %.preheader36.36
  %67 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 52), align 4, !tbaa !5
  %.not.37 = icmp eq i32 %67, 0
  br i1 %.not.37, label %.preheader36.38, label %28

.preheader36.38:                                  ; preds = %.preheader36.37
  %68 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 48), align 16, !tbaa !5
  %.not.38 = icmp eq i32 %68, 0
  br i1 %.not.38, label %.preheader36.39, label %28

.preheader36.39:                                  ; preds = %.preheader36.38
  %69 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 44), align 4, !tbaa !5
  %.not.39 = icmp eq i32 %69, 0
  br i1 %.not.39, label %.preheader36.40, label %28

.preheader36.40:                                  ; preds = %.preheader36.39
  %70 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 40), align 8, !tbaa !5
  %.not.40 = icmp eq i32 %70, 0
  br i1 %.not.40, label %.preheader36.41, label %28

.preheader36.41:                                  ; preds = %.preheader36.40
  %71 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 36), align 4, !tbaa !5
  %.not.41 = icmp eq i32 %71, 0
  br i1 %.not.41, label %.preheader36.42, label %28

.preheader36.42:                                  ; preds = %.preheader36.41
  %72 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 32), align 16, !tbaa !5
  %.not.42 = icmp eq i32 %72, 0
  br i1 %.not.42, label %.preheader36.43, label %28

.preheader36.43:                                  ; preds = %.preheader36.42
  %73 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 28), align 4, !tbaa !5
  %.not.43 = icmp eq i32 %73, 0
  br i1 %.not.43, label %.preheader36.44, label %28

.preheader36.44:                                  ; preds = %.preheader36.43
  %74 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 24), align 8, !tbaa !5
  %.not.44 = icmp eq i32 %74, 0
  br i1 %.not.44, label %.preheader36.45, label %28

.preheader36.45:                                  ; preds = %.preheader36.44
  %75 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 20), align 4, !tbaa !5
  %.not.45 = icmp eq i32 %75, 0
  br i1 %.not.45, label %.preheader36.46, label %28

.preheader36.46:                                  ; preds = %.preheader36.45
  %76 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 16), align 16, !tbaa !5
  %.not.46 = icmp eq i32 %76, 0
  br i1 %.not.46, label %.preheader36.47, label %28

.preheader36.47:                                  ; preds = %.preheader36.46
  %77 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 12), align 4, !tbaa !5
  %.not.47 = icmp eq i32 %77, 0
  br i1 %.not.47, label %.preheader36.48, label %28

.preheader36.48:                                  ; preds = %.preheader36.47
  %78 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 8), align 8, !tbaa !5
  %.not.48 = icmp eq i32 %78, 0
  br i1 %.not.48, label %.preheader36.49, label %28

.preheader36.49:                                  ; preds = %.preheader36.48
  %79 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 4), align 4, !tbaa !5
  %.not.49 = icmp eq i32 %79, 0
  br i1 %.not.49, label %.preheader.preheader, label %28

.preheader.preheader:                             ; preds = %28, %.preheader36.49
  %.029 = phi i32 [ %.02843.lcssa, %28 ], [ 0, %.preheader36.49 ]
  store i32 0, ptr @f, align 16, !tbaa !5
  %80 = add nsw i32 %10, -5
  %81 = add nsw i32 %10, -4
  %wide.trip.count = zext i32 %81 to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge47
  %indvars.iv64 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next65, %._crit_edge47 ]
  %82 = getelementptr inbounds [51 x i32], ptr @s, i64 0, i64 %indvars.iv64
  br label %83

._crit_edge47:                                    ; preds = %97
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond67.not = icmp eq i64 %indvars.iv.next65, 51
  br i1 %exitcond67.not, label %.lr.ph53, label %.preheader, !llvm.loop !12

83:                                               ; preds = %.preheader, %97
  %indvars.iv = phi i64 [ 0, %.preheader ], [ %indvars.iv.next, %97 ]
  %84 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %indvars.iv
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp sgt i32 %85, -1
  br i1 %86, label %87, label %89

87:                                               ; preds = %83
  %88 = load i32, ptr %82, align 4, !tbaa !5
  br label %.sink.split

89:                                               ; preds = %83
  %.not35 = icmp ult i64 %indvars.iv, %indvars.iv64
  br i1 %.not35, label %97, label %90

90:                                               ; preds = %89
  %91 = sub nsw i64 %indvars.iv, %indvars.iv64
  %92 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = icmp sgt i32 %93, 0
  br i1 %94, label %95, label %97

95:                                               ; preds = %90
  %96 = add nsw i32 %93, -1
  br label %.sink.split

.sink.split:                                      ; preds = %95, %87
  %.sink69 = phi i32 [ %88, %87 ], [ %96, %95 ]
  store i32 %.sink69, ptr %84, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %.sink.split, %90, %89
  %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 %._crit_edge47, label %83, !llvm.loop !13

.lr.ph53:                                         ; preds = %._crit_edge47, %105
  %.051 = phi i32 [ %106, %105 ], [ %80, %._crit_edge47 ]
  %98 = zext nneg i32 %.051 to i64
  %99 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = icmp sgt i32 %100, -1
  br i1 %101, label %102, label %105

102:                                              ; preds = %.lr.ph53
  %103 = add i32 %.029, %.051
  %104 = sub i32 %10, %103
  br label %.backedge.sink.split

105:                                              ; preds = %.lr.ph53
  %106 = add nsw i32 %.051, -1
  %107 = icmp sgt i32 %.051, 0
  br i1 %107, label %.lr.ph53, label %.backedge, !llvm.loop !14

._crit_edge56:                                    ; preds = %.backedge, %0
  ret i32 0
}

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(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" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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