; LLVM IR from upupming/algorithm :: acwing/每日一题·夏季/Week 1/AcWing 3499. 序列最大收益 (main)

; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@a = external dso_local global [210 x i32], align 16
@w = external dso_local global [210 x [210 x i32]], align 16
@f = external dso_local global [210 x [210 x i32]], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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 i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %25, %0
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr @m, align 4, !tbaa !5
  %18 = icmp sle i32 %16, %17
  br i1 %18, label %20, label %19

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

20:                                               ; preds = %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [210 x i32], ptr @a, i64 0, i64 %22
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %23)
  br label %25

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

28:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %52, %28
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %34, label %33

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

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

35:                                               ; preds = %48, %34
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %51

40:                                               ; preds = %35
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [210 x [210 x i32]], ptr @w, i64 0, i64 %42
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [210 x i32], ptr %43, i64 0, i64 %45
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %46)
  br label %48

48:                                               ; preds = %40
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %5, align 4, !tbaa !5
  br label %35, !llvm.loop !11

51:                                               ; preds = %39
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %3, align 4, !tbaa !5
  br label %29, !llvm.loop !12

55:                                               ; preds = %33
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 -1, i64 176400, i1 false)
  store i32 0, ptr getelementptr inbounds ([210 x [210 x i32]], ptr @f, i64 0, i64 1), align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 2, ptr %6, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %138, %55
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = load i32, ptr @m, align 4, !tbaa !5
  %59 = icmp sle i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %141

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

62:                                               ; preds = %134, %61
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = load i32, ptr @k, align 4, !tbaa !5
  %65 = icmp sle i32 %63, %64
  br i1 %65, label %66, label %70

66:                                               ; preds = %62
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = icmp sle i32 %67, %68
  br label %70

70:                                               ; preds = %66, %62
  %71 = phi i1 [ false, %62 ], [ %69, %66 ]
  br i1 %71, label %73, label %72

72:                                               ; preds = %70
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %137

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

74:                                               ; preds = %130, %73
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 1
  %78 = icmp sle i32 %75, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %74
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %133

80:                                               ; preds = %74
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = sub nsw i32 %82, %83
  %85 = sub nsw i32 %84, 1
  %86 = sub nsw i32 %81, %85
  %87 = icmp sge i32 %86, 0
  br i1 %87, label %88, label %129

88:                                               ; preds = %80
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [210 x [210 x i32]], ptr @f, i64 0, i64 %90
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [210 x i32], ptr %91, i64 0, i64 %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [210 x [210 x i32]], ptr @f, i64 0, i64 %96
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = sub nsw i32 %99, %100
  %102 = sub nsw i32 %101, 1
  %103 = sub nsw i32 %98, %102
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [210 x i32], ptr %97, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [210 x i32], ptr @a, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [210 x [210 x i32]], ptr @w, i64 0, i64 %111
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [210 x i32], ptr @a, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [210 x i32], ptr %112, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = add nsw i32 %106, %119
  store i32 %120, ptr %9, align 4, !tbaa !5
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %94, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [210 x [210 x i32]], ptr @f, i64 0, i64 %124
  %126 = load i32, ptr %7, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [210 x i32], ptr %125, i64 0, i64 %127
  store i32 %122, ptr %128, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %129

129:                                              ; preds = %88, %80
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %8, align 4, !tbaa !5
  br label %74, !llvm.loop !13

133:                                              ; preds = %79
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %7, align 4, !tbaa !5
  br label %62, !llvm.loop !14

137:                                              ; preds = %72
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %6, align 4, !tbaa !5
  br label %56, !llvm.loop !15

141:                                              ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %156, %141
  %143 = load i32, ptr %11, align 4, !tbaa !5
  %144 = load i32, ptr @k, align 4, !tbaa !5
  %145 = icmp sle i32 %143, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %142
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %159

147:                                              ; preds = %142
  %148 = load i32, ptr @m, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [210 x [210 x i32]], ptr @f, i64 0, i64 %149
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [210 x i32], ptr %150, i64 0, i64 %152
  %154 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %153)
  %155 = load i32, ptr %154, align 4, !tbaa !5
  store i32 %155, ptr %10, align 4, !tbaa !5
  br label %156

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

159:                                              ; preds = %146
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %160)
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %161, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %163 = load i32, ptr %1, align 4
  ret i32 %163
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #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

; 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)) #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)) #6

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 = { 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 #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 = { 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 #7 = { 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@a = external dso_local global [210 x i32], align 16
@w = external dso_local global [210 x [210 x i32]], align 16
@f = external dso_local global [210 x [210 x i32]], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %5 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %6 = load i32, ptr @m, align 4, !tbaa !5
  %.not51 = icmp slt i32 %6, 1
  br i1 %.not51, label %.preheader50, label %.lr.ph

.preheader50:                                     ; preds = %.lr.ph, %0
  %7 = phi i32 [ %6, %0 ], [ %11, %.lr.ph ]
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %.not4256 = icmp slt i32 %8, 1
  br i1 %.not4256, label %._crit_edge58, label %.preheader49

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %9 = getelementptr inbounds [210 x i32], ptr @a, i64 0, i64 %indvars.iv
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %.not.not = icmp slt i64 %indvars.iv, %12
  br i1 %.not.not, label %.lr.ph, label %.preheader50, !llvm.loop !9

.preheader49:                                     ; preds = %.preheader50, %._crit_edge
  %13 = phi i32 [ %16, %._crit_edge ], [ %8, %.preheader50 ]
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %._crit_edge ], [ 1, %.preheader50 ]
  %.not4653 = icmp slt i32 %13, 1
  br i1 %.not4653, label %.preheader49.._crit_edge_crit_edge, label %.lr.ph55

.preheader49.._crit_edge_crit_edge:               ; preds = %.preheader49
  %.pre95 = sext i32 %13 to i64
  br label %._crit_edge

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

._crit_edge58:                                    ; preds = %._crit_edge58.loopexit72, %.preheader50
  %14 = phi i32 [ %.pre, %._crit_edge58.loopexit72 ], [ %7, %.preheader50 ]
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(176400) @f, i8 -1, i64 176400, i1 false)
  store i32 0, ptr getelementptr inbounds (i8, ptr @f, i64 840), align 8, !tbaa !5
  %.not4362 = icmp slt i32 %14, 2
  %.pre94 = load i32, ptr @k, align 4, !tbaa !5
  br i1 %.not4362, label %._crit_edge64, label %.preheader48.lr.ph

.preheader48.lr.ph:                               ; preds = %._crit_edge58
  %15 = icmp sgt i32 %.pre94, -1
  br i1 %15, label %.preheader48, label %._crit_edge64.thread

._crit_edge64.thread:                             ; preds = %.preheader48.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %._crit_edge69

._crit_edge:                                      ; preds = %.lr.ph55, %.preheader49.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre95, %.preheader49.._crit_edge_crit_edge ], [ %20, %.lr.ph55 ]
  %16 = phi i32 [ %13, %.preheader49.._crit_edge_crit_edge ], [ %19, %.lr.ph55 ]
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %.not42.not = icmp slt i64 %indvars.iv77, %.pre-phi
  br i1 %.not42.not, label %.preheader49, label %._crit_edge58.loopexit72, !llvm.loop !11

.lr.ph55:                                         ; preds = %.preheader49, %.lr.ph55
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %.lr.ph55 ], [ 1, %.preheader49 ]
  %17 = getelementptr inbounds [210 x [210 x i32]], ptr @w, i64 0, i64 %indvars.iv77, i64 %indvars.iv74
  %18 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %.not46.not = icmp slt i64 %indvars.iv74, %20
  br i1 %.not46.not, label %.lr.ph55, label %._crit_edge, !llvm.loop !13

.preheader48:                                     ; preds = %.preheader48.lr.ph, %._crit_edge61
  %21 = phi i32 [ %29, %._crit_edge61 ], [ %14, %.preheader48.lr.ph ]
  %22 = phi i32 [ %30, %._crit_edge61 ], [ %.pre94, %.preheader48.lr.ph ]
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %._crit_edge61 ], [ 2, %.preheader48.lr.ph ]
  %23 = icmp sgt i32 %22, -1
  br i1 %23, label %.preheader.lr.ph, label %._crit_edge61

.preheader.lr.ph:                                 ; preds = %.preheader48
  %24 = getelementptr inbounds [210 x i32], ptr @a, i64 0, i64 %indvars.iv87
  br label %.preheader

._crit_edge64:                                    ; preds = %._crit_edge61, %._crit_edge58
  %25 = phi i32 [ %.pre94, %._crit_edge58 ], [ %30, %._crit_edge61 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  %.not4465 = icmp slt i32 %25, 0
  br i1 %.not4465, label %._crit_edge69, label %.lr.ph68

.preheader:                                       ; preds = %.preheader.lr.ph, %32
  %indvars.iv83 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next84, %32 ]
  %26 = sub nsw i64 %indvars.iv83, %indvars.iv87
  %27 = getelementptr inbounds [210 x [210 x i32]], ptr @f, i64 0, i64 %indvars.iv87, i64 %indvars.iv83
  %28 = trunc nsw i64 %26 to i32
  br label %38

._crit_edge61.loopexit:                           ; preds = %32
  %.pre93 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge61

._crit_edge61:                                    ; preds = %._crit_edge61.loopexit, %.preheader48
  %29 = phi i32 [ %.pre93, %._crit_edge61.loopexit ], [ %21, %.preheader48 ]
  %30 = phi i32 [ %33, %._crit_edge61.loopexit ], [ %22, %.preheader48 ]
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %31 = sext i32 %29 to i64
  %.not43.not = icmp slt i64 %indvars.iv87, %31
  br i1 %.not43.not, label %.preheader48, label %._crit_edge64, !llvm.loop !14

32:                                               ; preds = %56
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %33 = load i32, ptr @k, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = icmp slt i64 %indvars.iv83, %34
  %36 = icmp ult i64 %indvars.iv83, %indvars.iv87
  %37 = and i1 %36, %35
  br i1 %37, label %.preheader, label %._crit_edge61.loopexit, !llvm.loop !15

38:                                               ; preds = %.preheader, %56
  %indvars.iv80 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next81, %56 ]
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %39 = trunc nuw nsw i64 %indvars.iv.next81 to i32
  %40 = add i32 %28, %39
  %41 = icmp sgt i32 %40, -1
  br i1 %41, label %42, label %56

42:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %43 = zext nneg i32 %40 to i64
  %44 = getelementptr inbounds [210 x [210 x i32]], ptr @f, i64 0, i64 %indvars.iv80, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = getelementptr inbounds [210 x i32], ptr @a, i64 0, i64 %indvars.iv80
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = load i32, ptr %24, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [210 x [210 x i32]], ptr @w, i64 0, i64 %48, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = add nsw i32 %52, %45
  store i32 %53, ptr %1, align 4, !tbaa !5
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %27, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %55 = load i32, ptr %54, align 4, !tbaa !5
  store i32 %55, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  br label %56

56:                                               ; preds = %38, %42
  %exitcond.not = icmp eq i64 %indvars.iv.next81, %indvars.iv87
  br i1 %exitcond.not, label %32, label %38, !llvm.loop !16

._crit_edge69:                                    ; preds = %.lr.ph68, %._crit_edge64.thread, %._crit_edge64
  %57 = phi i32 [ 0, %._crit_edge64 ], [ 0, %._crit_edge64.thread ], [ %64, %.lr.ph68 ]
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %57)
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  ret i32 0

.lr.ph68:                                         ; preds = %._crit_edge64, %.lr.ph68
  %indvars.iv90 = phi i64 [ %indvars.iv.next91, %.lr.ph68 ], [ 0, %._crit_edge64 ]
  %60 = load i32, ptr @m, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [210 x [210 x i32]], ptr @f, i64 0, i64 %61, i64 %indvars.iv90
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %62)
  %64 = load i32, ptr %63, align 4, !tbaa !5
  store i32 %64, ptr %2, align 4, !tbaa !5
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %65 = load i32, ptr @k, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %.not44.not = icmp slt i64 %indvars.iv90, %66
  br i1 %.not44.not, label %.lr.ph68, label %._crit_edge69, !llvm.loop !17
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) 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: 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 #4

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

; 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)) #6

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #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 = { 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 #7 = { 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}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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