; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/241 Division 2/Problem B (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"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@m = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@t = external dso_local global [50001 x [5 x i32]], align 16
@a = external dso_local global [50000 x [5 x i32]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [2 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
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %34, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @m, align 4, !tbaa !5
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %37

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

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

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

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [50000 x [5 x i32]], ptr @a, i64 0, i64 %24
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [5 x i32], ptr %25, i64 0, i64 %27
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %28)
  br label %30

30:                                               ; preds = %22
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %4, align 4, !tbaa !5
  br label %17, !llvm.loop !9

33:                                               ; preds = %21
  br label %34

34:                                               ; preds = %33
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !11

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

38:                                               ; preds = %58, %37
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %61

43:                                               ; preds = %38
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sub nsw i32 %44, 1
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [5 x i32], ptr @t, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = sub nsw i32 %49, 1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [5 x i32], ptr @a, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %48, %53
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [5 x i32], ptr @t, i64 0, i64 %56
  store i32 %54, ptr %57, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %43
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %5, align 4, !tbaa !5
  br label %38, !llvm.loop !12

61:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %85, %61
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = load i32, ptr @m, align 4, !tbaa !5
  %65 = icmp sle i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %88

67:                                               ; preds = %62
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sub nsw i32 %68, 1
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %70
  %72 = getelementptr inbounds [5 x i32], ptr %71, i64 0, i64 0
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sub nsw i32 %74, 1
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [50000 x [5 x i32]], ptr @a, i64 0, i64 %76
  %78 = getelementptr inbounds [5 x i32], ptr %77, i64 0, i64 0
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = add nsw i32 %73, %79
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %82
  %84 = getelementptr inbounds [5 x i32], ptr %83, i64 0, i64 0
  store i32 %80, ptr %84, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %67
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %6, align 4, !tbaa !5
  br label %62, !llvm.loop !13

88:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %136, %88
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = load i32, ptr @n, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %139

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

95:                                               ; preds = %132, %94
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = load i32, ptr @m, align 4, !tbaa !5
  %98 = icmp sle i32 %96, %97
  br i1 %98, label %100, label %99

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

100:                                              ; preds = %95
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = sub nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %103
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [5 x i32], ptr %104, i64 0, i64 %106
  %108 = load i32, ptr %8, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %109
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sub nsw i32 %111, 1
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [5 x i32], ptr %110, i64 0, i64 %113
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %107, ptr noundef nonnull align 4 dereferenceable(4) %114)
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = sub nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [50000 x [5 x i32]], ptr @a, i64 0, i64 %119
  %121 = load i32, ptr %7, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [5 x i32], ptr %120, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = add nsw i32 %116, %124
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %127
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [5 x i32], ptr %128, i64 0, i64 %130
  store i32 %125, ptr %131, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %100
  %133 = load i32, ptr %8, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %8, align 4, !tbaa !5
  br label %95, !llvm.loop !14

135:                                              ; preds = %99
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %7, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %7, align 4, !tbaa !5
  br label %89, !llvm.loop !15

139:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %156, %139
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = load i32, ptr @m, align 4, !tbaa !5
  %143 = icmp sle i32 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %159

145:                                              ; preds = %140
  %146 = load i32, ptr %9, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %147
  %149 = load i32, ptr @n, align 4, !tbaa !5
  %150 = sub nsw i32 %149, 1
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [5 x i32], ptr %148, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %153)
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %154, ptr noundef @.str.2)
  br label %156

156:                                              ; preds = %145
  %157 = load i32, ptr %9, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %9, align 4, !tbaa !5
  br label %140, !llvm.loop !16

159:                                              ; preds = %144
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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 = { 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 = { inlinehint mustprogress 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 #5 = { mustprogress 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 #6 = { 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}
!16 = distinct !{!16, !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"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@m = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@t = external dso_local global [50001 x [5 x i32]], align 16
@a = external dso_local global [50000 x [5 x i32]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m, ptr noundef nonnull @n)
  %2 = load i32, ptr @m, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  %.pre85 = load i32, ptr @n, align 4, !tbaa !5
  br i1 %3, label %.preheader42.lr.ph, label %._crit_edge45

.preheader42.lr.ph:                               ; preds = %0
  %4 = icmp sgt i32 %.pre85, 0
  br i1 %4, label %.preheader42, label %.preheader41.thread

.preheader41.thread:                              ; preds = %.preheader42.lr.ph
  store i32 0, ptr @t, align 16, !tbaa !5
  br label %.lr.ph51.preheader

.preheader42:                                     ; preds = %.preheader42.lr.ph, %._crit_edge
  %5 = phi i32 [ %14, %._crit_edge ], [ %2, %.preheader42.lr.ph ]
  %6 = phi i32 [ %15, %._crit_edge ], [ %.pre85, %.preheader42.lr.ph ]
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %._crit_edge ], [ 0, %.preheader42.lr.ph ]
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

._crit_edge45:                                    ; preds = %._crit_edge, %0
  %8 = phi i32 [ %.pre85, %0 ], [ %15, %._crit_edge ]
  %9 = phi i32 [ %2, %0 ], [ %14, %._crit_edge ]
  store i32 0, ptr @t, align 16, !tbaa !5
  %10 = icmp sgt i32 %8, 1
  br i1 %10, label %.lr.ph48.preheader, label %.preheader41

.lr.ph48.preheader:                               ; preds = %._crit_edge45
  %wide.trip.count = zext nneg i32 %8 to i64
  %11 = add nsw i64 %wide.trip.count, -1
  %12 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %11, 3
  %13 = icmp ult i64 %12, 3
  br i1 %13, label %.preheader41.loopexit.unr-lcssa, label %.lr.ph48.preheader.new

.lr.ph48.preheader.new:                           ; preds = %.lr.ph48.preheader
  %unroll_iter = and i64 %11, -4
  br label %.lr.ph48

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader42
  %14 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %5, %.preheader42 ]
  %15 = phi i32 [ %20, %._crit_edge.loopexit ], [ %6, %.preheader42 ]
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %16 = sext i32 %14 to i64
  %17 = icmp slt i64 %indvars.iv.next66, %16
  br i1 %17, label %.preheader42, label %._crit_edge45, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader42, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader42 ]
  %18 = getelementptr inbounds [50000 x [5 x i32]], ptr @a, i64 0, i64 %indvars.iv65, i64 %indvars.iv
  %19 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %18)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

.preheader41.loopexit.unr-lcssa:                  ; preds = %.lr.ph48, %.lr.ph48.preheader
  %.unr = phi i32 [ 0, %.lr.ph48.preheader ], [ %53, %.lr.ph48 ]
  %indvars.iv68.unr = phi i64 [ 1, %.lr.ph48.preheader ], [ %indvars.iv.next69.3, %.lr.ph48 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader41, label %.lr.ph48.epil

.lr.ph48.epil:                                    ; preds = %.preheader41.loopexit.unr-lcssa, %.lr.ph48.epil
  %23 = phi i32 [ %27, %.lr.ph48.epil ], [ %.unr, %.preheader41.loopexit.unr-lcssa ]
  %indvars.iv68.epil = phi i64 [ %indvars.iv.next69.epil, %.lr.ph48.epil ], [ %indvars.iv68.unr, %.preheader41.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph48.epil ], [ 0, %.preheader41.loopexit.unr-lcssa ]
  %24 = add nsw i64 %indvars.iv68.epil, -1
  %25 = getelementptr inbounds [5 x i32], ptr @a, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = add nsw i32 %26, %23
  %28 = getelementptr inbounds [5 x i32], ptr @t, i64 0, i64 %indvars.iv68.epil
  store i32 %27, ptr %28, align 4, !tbaa !5
  %indvars.iv.next69.epil = add nuw nsw i64 %indvars.iv68.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 %.preheader41, label %.lr.ph48.epil, !llvm.loop !13

.preheader41:                                     ; preds = %.preheader41.loopexit.unr-lcssa, %.lr.ph48.epil, %._crit_edge45
  %29 = phi i1 [ false, %._crit_edge45 ], [ %10, %.lr.ph48.epil ], [ %10, %.preheader41.loopexit.unr-lcssa ]
  %.not49 = icmp slt i32 %9, 1
  br i1 %.not49, label %.preheader40, label %.lr.ph51.preheader

.lr.ph51.preheader:                               ; preds = %.preheader41.thread, %.preheader41
  %30 = phi i32 [ %.pre85, %.preheader41.thread ], [ %8, %.preheader41 ]
  %31 = phi i32 [ %2, %.preheader41.thread ], [ %9, %.preheader41 ]
  %32 = phi i1 [ false, %.preheader41.thread ], [ %29, %.preheader41 ]
  %33 = zext nneg i32 %31 to i64
  %xtraiter102 = and i64 %33, 1
  %34 = icmp eq i32 %31, 1
  br i1 %34, label %.preheader40.loopexit.unr-lcssa, label %.lr.ph51.preheader.new

.lr.ph51.preheader.new:                           ; preds = %.lr.ph51.preheader
  %unroll_iter106 = and i64 %33, 2147483646
  br label %.lr.ph51

.lr.ph48:                                         ; preds = %.lr.ph48, %.lr.ph48.preheader.new
  %35 = phi i32 [ 0, %.lr.ph48.preheader.new ], [ %53, %.lr.ph48 ]
  %indvars.iv68 = phi i64 [ 1, %.lr.ph48.preheader.new ], [ %indvars.iv.next69.3, %.lr.ph48 ]
  %niter = phi i64 [ 0, %.lr.ph48.preheader.new ], [ %niter.next.3, %.lr.ph48 ]
  %36 = add nsw i64 %indvars.iv68, -1
  %37 = getelementptr inbounds [5 x i32], ptr @a, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = add nsw i32 %38, %35
  %40 = getelementptr inbounds [5 x i32], ptr @t, i64 0, i64 %indvars.iv68
  store i32 %39, ptr %40, align 4, !tbaa !5
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %41 = getelementptr inbounds [5 x i32], ptr @a, i64 0, i64 %indvars.iv68
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = add nsw i32 %42, %39
  %44 = getelementptr inbounds [5 x i32], ptr @t, i64 0, i64 %indvars.iv.next69
  store i32 %43, ptr %44, align 4, !tbaa !5
  %indvars.iv.next69.1 = add nuw nsw i64 %indvars.iv68, 2
  %45 = add nuw nsw i64 %indvars.iv68, 1
  %46 = getelementptr inbounds [5 x i32], ptr @a, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, %43
  %49 = getelementptr inbounds [5 x i32], ptr @t, i64 0, i64 %indvars.iv.next69.1
  store i32 %48, ptr %49, align 4, !tbaa !5
  %indvars.iv.next69.2 = add nuw nsw i64 %indvars.iv68, 3
  %50 = add nuw nsw i64 %indvars.iv68, 2
  %51 = getelementptr inbounds [5 x i32], ptr @a, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = add nsw i32 %52, %48
  %54 = getelementptr inbounds [5 x i32], ptr @t, i64 0, i64 %indvars.iv.next69.2
  store i32 %53, ptr %54, align 4, !tbaa !5
  %indvars.iv.next69.3 = add nuw nsw i64 %indvars.iv68, 4
  %niter.next.3 = add nuw i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader41.loopexit.unr-lcssa, label %.lr.ph48, !llvm.loop !15

.preheader40.loopexit.unr-lcssa:                  ; preds = %.lr.ph51, %.lr.ph51.preheader
  %.unr104 = phi i32 [ 0, %.lr.ph51.preheader ], [ %71, %.lr.ph51 ]
  %indvars.iv71.unr = phi i64 [ 1, %.lr.ph51.preheader ], [ %indvars.iv.next72.1, %.lr.ph51 ]
  %lcmp.mod105.not = icmp eq i64 %xtraiter102, 0
  br i1 %lcmp.mod105.not, label %.preheader40, label %.lr.ph51.epil

.lr.ph51.epil:                                    ; preds = %.preheader40.loopexit.unr-lcssa
  %55 = add nsw i64 %indvars.iv71.unr, -1
  %56 = getelementptr inbounds [50000 x [5 x i32]], ptr @a, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, %.unr104
  %59 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %indvars.iv71.unr
  store i32 %58, ptr %59, align 4, !tbaa !5
  br label %.preheader40

.preheader40:                                     ; preds = %.lr.ph51.epil, %.preheader40.loopexit.unr-lcssa, %.preheader41
  %.not4989.not = phi i1 [ false, %.preheader41 ], [ true, %.preheader40.loopexit.unr-lcssa ], [ true, %.lr.ph51.epil ]
  %60 = phi i32 [ %8, %.preheader41 ], [ %30, %.preheader40.loopexit.unr-lcssa ], [ %30, %.lr.ph51.epil ]
  %61 = phi i32 [ %9, %.preheader41 ], [ %31, %.preheader40.loopexit.unr-lcssa ], [ %31, %.lr.ph51.epil ]
  %62 = phi i1 [ %29, %.preheader41 ], [ %32, %.preheader40.loopexit.unr-lcssa ], [ %32, %.lr.ph51.epil ]
  %brmerge.not = and i1 %.not4989.not, %62
  br i1 %brmerge.not, label %.preheader39, label %.preheader

.lr.ph51:                                         ; preds = %.lr.ph51, %.lr.ph51.preheader.new
  %63 = phi i32 [ 0, %.lr.ph51.preheader.new ], [ %71, %.lr.ph51 ]
  %indvars.iv71 = phi i64 [ 1, %.lr.ph51.preheader.new ], [ %indvars.iv.next72.1, %.lr.ph51 ]
  %niter107 = phi i64 [ 0, %.lr.ph51.preheader.new ], [ %niter107.next.1, %.lr.ph51 ]
  %64 = add nsw i64 %indvars.iv71, -1
  %65 = getelementptr inbounds [50000 x [5 x i32]], ptr @a, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, %63
  %68 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %indvars.iv71
  store i32 %67, ptr %68, align 4, !tbaa !5
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %69 = getelementptr inbounds [50000 x [5 x i32]], ptr @a, i64 0, i64 %indvars.iv71
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = add nsw i32 %70, %67
  %72 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %indvars.iv.next72
  store i32 %71, ptr %72, align 4, !tbaa !5
  %indvars.iv.next72.1 = add nuw nsw i64 %indvars.iv71, 2
  %niter107.next.1 = add i64 %niter107, 2
  %niter107.ncmp.1 = icmp eq i64 %niter107.next.1, %unroll_iter106
  br i1 %niter107.ncmp.1, label %.preheader40.loopexit.unr-lcssa, label %.lr.ph51, !llvm.loop !16

.preheader39:                                     ; preds = %.preheader40, %._crit_edge55
  %73 = phi i32 [ %77, %._crit_edge55 ], [ %60, %.preheader40 ]
  %74 = phi i32 [ %78, %._crit_edge55 ], [ %61, %.preheader40 ]
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %._crit_edge55 ], [ 1, %.preheader40 ]
  %.not3852 = icmp slt i32 %74, 1
  br i1 %.not3852, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %.preheader39
  %75 = add nsw i64 %indvars.iv79, -1
  br label %81

.preheader:                                       ; preds = %._crit_edge55, %.preheader40
  %76 = phi i32 [ %61, %.preheader40 ], [ %78, %._crit_edge55 ]
  %.not3757 = icmp slt i32 %76, 1
  br i1 %.not3757, label %._crit_edge60, label %.lr.ph59

._crit_edge55.loopexit:                           ; preds = %81
  %.pre86 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge55

._crit_edge55:                                    ; preds = %._crit_edge55.loopexit, %.preheader39
  %77 = phi i32 [ %.pre86, %._crit_edge55.loopexit ], [ %73, %.preheader39 ]
  %78 = phi i32 [ %91, %._crit_edge55.loopexit ], [ %74, %.preheader39 ]
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %79 = sext i32 %77 to i64
  %80 = icmp slt i64 %indvars.iv.next80, %79
  br i1 %80, label %.preheader39, label %.preheader, !llvm.loop !17

81:                                               ; preds = %.lr.ph54, %81
  %indvars.iv76 = phi i64 [ 1, %.lr.ph54 ], [ %indvars.iv.next77, %81 ]
  %82 = add nsw i64 %indvars.iv76, -1
  %83 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %82, i64 %indvars.iv79
  %84 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %indvars.iv76, i64 %75
  %85 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %83, ptr noundef nonnull align 4 dereferenceable(4) %84)
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = getelementptr inbounds [50000 x [5 x i32]], ptr @a, i64 0, i64 %82, i64 %indvars.iv79
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = add nsw i32 %88, %86
  %90 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %indvars.iv76, i64 %indvars.iv79
  store i32 %89, ptr %90, align 4, !tbaa !5
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %91 = load i32, ptr @m, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %.not38.not = icmp slt i64 %indvars.iv76, %92
  br i1 %.not38.not, label %81, label %._crit_edge55.loopexit, !llvm.loop !18

._crit_edge60:                                    ; preds = %.lr.ph59, %.preheader
  %93 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph59:                                         ; preds = %.preheader, %.lr.ph59
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %.lr.ph59 ], [ 1, %.preheader ]
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = add nsw i32 %94, -1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [50001 x [5 x i32]], ptr @t, i64 0, i64 %indvars.iv82, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %98)
  %100 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef nonnull @.str.2)
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %101 = load i32, ptr @m, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %.not37.not = icmp slt i64 %indvars.iv82, %102
  br i1 %.not37.not, label %.lr.ph59, label %._crit_edge60, !llvm.loop !19
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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 = { 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 = { 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 #3 = { inlinehint mustprogress 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress 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" }

!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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !11}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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