; LLVM IR from tangjz/acm-icpc :: codeforces/gym (100825E)

; 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 i32, align 4
@t = external dso_local global i32, align 4
@e = external dso_local global [101 x [101 x i32]], align 16
@f = external dso_local global [11 x [101 x i64]], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 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
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %12

12:                                               ; preds = %150, %0
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @s, ptr noundef @t)
  %14 = icmp eq i32 %13, 4
  br i1 %14, label %15, label %153

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

16:                                               ; preds = %26, %15
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %29

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %23
  %25 = getelementptr inbounds [101 x i32], ptr %24, i64 0, i64 0
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !9

29:                                               ; preds = %20
  br label %30

30:                                               ; preds = %34, %29
  %31 = load i32, ptr @m, align 4, !tbaa !5
  %32 = add nsw i32 %31, -1
  store i32 %32, ptr @m, align 4, !tbaa !5
  %33 = icmp ne i32 %31, 0
  br i1 %33, label %34, label %60

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3, ptr noundef %4)
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %38
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %41
  %43 = getelementptr inbounds [101 x i32], ptr %42, i64 0, i64 0
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %43, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [101 x i32], ptr %39, i64 0, i64 %46
  store i32 %36, ptr %47, align 4, !tbaa !5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %50
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %53
  %55 = getelementptr inbounds [101 x i32], ptr %54, i64 0, i64 0
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %55, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [101 x i32], ptr %51, i64 0, i64 %58
  store i32 %48, ptr %59, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %30, !llvm.loop !11

60:                                               ; preds = %30
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = mul i64 %62, 8
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 0, i64 %63, i1 false)
  %64 = load i32, ptr @s, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %65
  store i64 1, ptr %66, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %128, %60
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = load i32, ptr @t, align 4, !tbaa !5
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 9, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %131

72:                                               ; preds = %67
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %75
  %77 = getelementptr inbounds [101 x i64], ptr %76, i64 0, i64 0
  %78 = load i32, ptr @n, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = mul i64 %79, 8
  call void @llvm.memset.p0.i64(ptr align 8 %77, i8 0, i64 %80, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %124, %72
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = load i32, ptr @n, align 4, !tbaa !5
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  store i32 12, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %127

86:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %120, %86
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %90
  %92 = getelementptr inbounds [101 x i32], ptr %91, i64 0, i64 0
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = icmp sle i32 %88, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %87
  store i32 15, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %123

96:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %98
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [101 x i32], ptr %99, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  store i32 %103, ptr %9, align 4, !tbaa !5
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %105
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [101 x i64], ptr %106, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !12
  %111 = load i32, ptr %5, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %113
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [101 x i64], ptr %114, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !12
  %119 = add nsw i64 %118, %110
  store i64 %119, ptr %117, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %120

120:                                              ; preds = %96
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %8, align 4, !tbaa !5
  br label %87, !llvm.loop !14

123:                                              ; preds = %95
  br label %124

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

127:                                              ; preds = %85
  br label %128

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

131:                                              ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store i64 0, ptr %10, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %147, %131
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = load i32, ptr @n, align 4, !tbaa !5
  %135 = icmp slt i32 %133, %134
  br i1 %135, label %137, label %136

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

137:                                              ; preds = %132
  %138 = load i32, ptr @t, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %139
  %141 = load i32, ptr %11, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [101 x i64], ptr %140, i64 0, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !12
  %145 = load i64, ptr %10, align 8, !tbaa !12
  %146 = add nsw i64 %145, %144
  store i64 %146, ptr %10, align 8, !tbaa !12
  br label %147

147:                                              ; preds = %137
  %148 = load i32, ptr %11, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %11, align 4, !tbaa !5
  br label %132, !llvm.loop !17

150:                                              ; preds = %136
  %151 = load i64, ptr %10, align 8, !tbaa !12
  %152 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %151)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %12, !llvm.loop !18

153:                                              ; preds = %12
  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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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 global i32, align 4
@t = external dso_local global i32, align 4
@e = external dso_local local_unnamed_addr global [101 x [101 x i32]], align 16
@f = external dso_local local_unnamed_addr global [11 x [101 x i64]], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 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 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @s, ptr noundef nonnull @t)
  %4 = icmp eq i32 %3, 4
  br i1 %4, label %.preheader30, label %._crit_edge47

.preheader30:                                     ; preds = %0, %._crit_edge45
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph.preheader, label %.preheader29

.lr.ph.preheader:                                 ; preds = %.preheader30
  %wide.trip.count = zext nneg i32 %5 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %7 = icmp ult i32 %5, 4
  br i1 %7, label %.preheader29.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph

.preheader29.loopexit.unr-lcssa:                  ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader29, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader29.loopexit.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader29.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader29.loopexit.unr-lcssa ]
  %8 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %indvars.iv.epil
  store i32 0, ptr %8, align 4, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader29, label %.lr.ph.epil, !llvm.loop !9

.preheader29:                                     ; preds = %.preheader29.loopexit.unr-lcssa, %.lr.ph.epil, %.preheader30
  %9 = load i32, ptr @m, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @m, align 4, !tbaa !5
  %.not32 = icmp eq i32 %9, 0
  br i1 %.not32, label %._crit_edge, label %.lr.ph33

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %11 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %indvars.iv
  store i32 0, ptr %11, align 16, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %12 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %indvars.iv.next
  store i32 0, ptr %12, align 4, !tbaa !5
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %13 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %indvars.iv.next.1
  store i32 0, ptr %13, align 8, !tbaa !5
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %14 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %indvars.iv.next.2
  store i32 0, ptr %14, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader29.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !11

.lr.ph33:                                         ; preds = %.preheader29, %.lr.ph33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr %19, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %18, i64 %22
  store i32 %16, ptr %23, align 4, !tbaa !5
  %24 = sext i32 %16 to i64
  %25 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %25, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %24, i64 %28
  store i32 %17, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %30 = load i32, ptr @m, align 4, !tbaa !5
  %31 = add nsw i32 %30, -1
  store i32 %31, ptr @m, align 4, !tbaa !5
  %.not = icmp eq i32 %30, 0
  br i1 %.not, label %._crit_edge.loopexit, label %.lr.ph33, !llvm.loop !13

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader29
  %32 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %5, %.preheader29 ]
  %33 = sext i32 %32 to i64
  %34 = shl nsw i64 %33, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @f, i8 0, i64 %34, i1 false)
  %35 = load i32, ptr @s, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %36
  store i64 1, ptr %37, align 8, !tbaa !14
  %38 = load i32, ptr @t, align 4, !tbaa !5
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.lr.ph41, label %.preheader28

.lr.ph41:                                         ; preds = %._crit_edge
  %40 = icmp sgt i32 %32, 0
  %wide.trip.count68 = zext nneg i32 %38 to i64
  br i1 %40, label %.preheader.lr.ph.us.preheader, label %.loopexit.preheader

.loopexit.preheader:                              ; preds = %.lr.ph41
  %xtraiter82 = and i64 %wide.trip.count68, 7
  %41 = icmp ult i32 %38, 8
  br i1 %41, label %.preheader28.loopexit79.unr-lcssa, label %.loopexit.preheader.new

.loopexit.preheader.new:                          ; preds = %.loopexit.preheader
  %unroll_iter85 = and i64 %wide.trip.count68, 2147483640
  br label %.loopexit

.preheader.lr.ph.us.preheader:                    ; preds = %.lr.ph41
  %wide.trip.count63 = zext nneg i32 %32 to i64
  br label %.preheader.lr.ph.us

.preheader.lr.ph.us:                              ; preds = %.preheader.lr.ph.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv65 = phi i64 [ 0, %.preheader.lr.ph.us.preheader ], [ %indvars.iv.next66, %..loopexit_crit_edge.us ]
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %42 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next66
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %42, i8 0, i64 %34, i1 false)
  br label %.preheader.us

43:                                               ; preds = %43, %.lr.ph36.us.new
  %indvars.iv55 = phi i64 [ 1, %.lr.ph36.us.new ], [ %indvars.iv.next56.1, %43 ]
  %niter91 = phi i64 [ 0, %.lr.ph36.us.new ], [ %niter91.next.1, %43 ]
  %44 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %indvars.iv60, i64 %indvars.iv55
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = load i64, ptr %67, align 8, !tbaa !14
  %47 = sext i32 %45 to i64
  %48 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next66, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !14
  %50 = add nsw i64 %49, %46
  store i64 %50, ptr %48, align 8, !tbaa !14
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %51 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %indvars.iv60, i64 %indvars.iv.next56
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = load i64, ptr %67, align 8, !tbaa !14
  %54 = sext i32 %52 to i64
  %55 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next66, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !14
  %57 = add nsw i64 %56, %53
  store i64 %57, ptr %55, align 8, !tbaa !14
  %indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 2
  %niter91.next.1 = add i64 %niter91, 2
  %niter91.ncmp.1 = icmp eq i64 %niter91.next.1, %unroll_iter90
  br i1 %niter91.ncmp.1, label %._crit_edge37.us.loopexit.unr-lcssa, label %43, !llvm.loop !16

._crit_edge37.us.loopexit.unr-lcssa:              ; preds = %43, %.lr.ph36.us
  %indvars.iv55.unr = phi i64 [ 1, %.lr.ph36.us ], [ %indvars.iv.next56.1, %43 ]
  %lcmp.mod89.not = icmp eq i64 %xtraiter87, 0
  br i1 %lcmp.mod89.not, label %._crit_edge37.us, label %._crit_edge37.us.loopexit.epilog-lcssa

._crit_edge37.us.loopexit.epilog-lcssa:           ; preds = %._crit_edge37.us.loopexit.unr-lcssa
  %58 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %indvars.iv60, i64 %indvars.iv55.unr
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = load i64, ptr %67, align 8, !tbaa !14
  %61 = sext i32 %59 to i64
  %62 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next66, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !14
  %64 = add nsw i64 %63, %60
  store i64 %64, ptr %62, align 8, !tbaa !14
  br label %._crit_edge37.us

._crit_edge37.us:                                 ; preds = %._crit_edge37.us.loopexit.epilog-lcssa, %._crit_edge37.us.loopexit.unr-lcssa, %.preheader.us
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %exitcond64.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count63
  br i1 %exitcond64.not, label %..loopexit_crit_edge.us, label %.preheader.us, !llvm.loop !17

.preheader.us:                                    ; preds = %.preheader.lr.ph.us, %._crit_edge37.us
  %indvars.iv60 = phi i64 [ 0, %.preheader.lr.ph.us ], [ %indvars.iv.next61, %._crit_edge37.us ]
  %65 = getelementptr inbounds [101 x [101 x i32]], ptr @e, i64 0, i64 %indvars.iv60
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %.not2734.us = icmp slt i32 %66, 1
  br i1 %.not2734.us, label %._crit_edge37.us, label %.lr.ph36.us

.lr.ph36.us:                                      ; preds = %.preheader.us
  %67 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv65, i64 %indvars.iv60
  %68 = zext nneg i32 %66 to i64
  %xtraiter87 = and i64 %68, 1
  %69 = icmp eq i32 %66, 1
  br i1 %69, label %._crit_edge37.us.loopexit.unr-lcssa, label %.lr.ph36.us.new

.lr.ph36.us.new:                                  ; preds = %.lr.ph36.us
  %unroll_iter90 = and i64 %68, 2147483646
  br label %43

..loopexit_crit_edge.us:                          ; preds = %._crit_edge37.us
  %exitcond69.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count68
  br i1 %exitcond69.not, label %.preheader28, label %.preheader.lr.ph.us, !llvm.loop !18

.preheader28.loopexit79.unr-lcssa:                ; preds = %.loopexit, %.loopexit.preheader
  %indvars.iv50.unr = phi i64 [ 0, %.loopexit.preheader ], [ %indvars.iv.next51.7, %.loopexit ]
  %lcmp.mod84.not = icmp eq i64 %xtraiter82, 0
  br i1 %lcmp.mod84.not, label %.preheader28, label %.loopexit.epil

.loopexit.epil:                                   ; preds = %.preheader28.loopexit79.unr-lcssa, %.loopexit.epil
  %indvars.iv50.epil = phi i64 [ %indvars.iv.next51.epil, %.loopexit.epil ], [ %indvars.iv50.unr, %.preheader28.loopexit79.unr-lcssa ]
  %epil.iter83 = phi i64 [ %epil.iter83.next, %.loopexit.epil ], [ 0, %.preheader28.loopexit79.unr-lcssa ]
  %indvars.iv.next51.epil = add nuw nsw i64 %indvars.iv50.epil, 1
  %70 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next51.epil
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %70, i8 0, i64 %34, i1 false)
  %epil.iter83.next = add i64 %epil.iter83, 1
  %epil.iter83.cmp.not = icmp eq i64 %epil.iter83.next, %xtraiter82
  br i1 %epil.iter83.cmp.not, label %.preheader28, label %.loopexit.epil, !llvm.loop !19

.preheader28:                                     ; preds = %.preheader28.loopexit79.unr-lcssa, %.loopexit.epil, %..loopexit_crit_edge.us, %._crit_edge
  %71 = icmp sgt i32 %32, 0
  br i1 %71, label %.lr.ph44, label %._crit_edge45

.lr.ph44:                                         ; preds = %.preheader28
  %72 = sext i32 %38 to i64
  %wide.trip.count73 = zext nneg i32 %32 to i64
  %min.iters.check = icmp ult i32 %32, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph44
  %indvars.iv70.ph = phi i64 [ 0, %.lr.ph44 ], [ %n.vec, %middle.block ]
  %.02242.ph = phi i64 [ 0, %.lr.ph44 ], [ %78, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph44
  %n.vec = and i64 %wide.trip.count73, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %75, %vector.body ]
  %vec.phi77 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %76, %vector.body ]
  %73 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %72, i64 %index
  %74 = getelementptr inbounds i8, ptr %73, i64 16
  %wide.load = load <2 x i64>, ptr %73, align 8, !tbaa !14
  %wide.load78 = load <2 x i64>, ptr %74, align 8, !tbaa !14
  %75 = add <2 x i64> %wide.load, %vec.phi
  %76 = add <2 x i64> %wide.load78, %vec.phi77
  %index.next = add nuw i64 %index, 4
  %77 = icmp eq i64 %index.next, %n.vec
  br i1 %77, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %76, %75
  %78 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count73
  br i1 %cmp.n, label %._crit_edge45, label %scalar.ph.preheader

.loopexit:                                        ; preds = %.loopexit, %.loopexit.preheader.new
  %indvars.iv50 = phi i64 [ 0, %.loopexit.preheader.new ], [ %indvars.iv.next51.7, %.loopexit ]
  %niter86 = phi i64 [ 0, %.loopexit.preheader.new ], [ %niter86.next.7, %.loopexit ]
  %indvars.iv.next51 = or disjoint i64 %indvars.iv50, 1
  %79 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next51
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %79, i8 0, i64 %34, i1 false)
  %indvars.iv.next51.1 = or disjoint i64 %indvars.iv50, 2
  %80 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next51.1
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %80, i8 0, i64 %34, i1 false)
  %indvars.iv.next51.2 = or disjoint i64 %indvars.iv50, 3
  %81 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next51.2
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %81, i8 0, i64 %34, i1 false)
  %indvars.iv.next51.3 = or disjoint i64 %indvars.iv50, 4
  %82 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next51.3
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %82, i8 0, i64 %34, i1 false)
  %indvars.iv.next51.4 = or disjoint i64 %indvars.iv50, 5
  %83 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next51.4
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %83, i8 0, i64 %34, i1 false)
  %indvars.iv.next51.5 = or disjoint i64 %indvars.iv50, 6
  %84 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next51.5
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %84, i8 0, i64 %34, i1 false)
  %indvars.iv.next51.6 = or disjoint i64 %indvars.iv50, 7
  %85 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next51.6
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %85, i8 0, i64 %34, i1 false)
  %indvars.iv.next51.7 = add nuw nsw i64 %indvars.iv50, 8
  %86 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %indvars.iv.next51.7
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %86, i8 0, i64 %34, i1 false)
  %niter86.next.7 = add i64 %niter86, 8
  %niter86.ncmp.7 = icmp eq i64 %niter86.next.7, %unroll_iter85
  br i1 %niter86.ncmp.7, label %.preheader28.loopexit79.unr-lcssa, label %.loopexit, !llvm.loop !18

._crit_edge45:                                    ; preds = %scalar.ph, %middle.block, %.preheader28
  %.022.lcssa = phi i64 [ 0, %.preheader28 ], [ %78, %middle.block ], [ %92, %scalar.ph ]
  %87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.022.lcssa)
  %88 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @s, ptr noundef nonnull @t)
  %89 = icmp eq i32 %88, 4
  br i1 %89, label %.preheader30, label %._crit_edge47, !llvm.loop !23

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %scalar.ph ], [ %indvars.iv70.ph, %scalar.ph.preheader ]
  %.02242 = phi i64 [ %92, %scalar.ph ], [ %.02242.ph, %scalar.ph.preheader ]
  %90 = getelementptr inbounds [11 x [101 x i64]], ptr @f, i64 0, i64 %72, i64 %indvars.iv70
  %91 = load i64, ptr %90, align 8, !tbaa !14
  %92 = add nsw i64 %91, %.02242
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count73
  br i1 %exitcond74.not, label %._crit_edge45, label %scalar.ph, !llvm.loop !24

._crit_edge47:                                    ; preds = %._crit_edge45, %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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !12, !21, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12, !22, !21}


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