; LLVM IR from upupming/algorithm :: acwing/算法基础课/第五讲 动态规划/背包问题/9. 分组背包问题 (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" }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@v = external dso_local global [110 x [110 x i32]], align 16
@w = external dso_local global [110 x [110 x i32]], align 16
@s = external dso_local global [110 x i32], align 16
@f = external dso_local global [110 x i32], align 16
@_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
  store i32 0, ptr %1, align 4
  %9 = 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)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %48, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = icmp sle 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 %51

16:                                               ; preds = %11
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [110 x i32], ptr @s, i64 0, i64 %18
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %19)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %44, %16
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [110 x i32], ptr @s, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = icmp slt i32 %22, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %21
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [110 x [110 x i32]], ptr @v, i64 0, i64 %31
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [110 x i32], ptr %32, i64 0, i64 %34
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %35)
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [110 x [110 x i32]], ptr @w, i64 0, i64 %38
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [110 x i32], ptr %39, i64 0, i64 %41
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 4 dereferenceable(4) %42)
  br label %44

44:                                               ; preds = %29
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %4, align 4, !tbaa !5
  br label %21, !llvm.loop !9

47:                                               ; preds = %28
  br label %48

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

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

52:                                               ; preds = %120, %51
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %58 = load i32, ptr @m, align 4, !tbaa !5
  store i32 %58, ptr %6, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %116, %57
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = icmp sge i32 %60, 0
  br i1 %61, label %63, label %62

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

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

64:                                               ; preds = %112, %63
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [110 x i32], ptr @s, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp slt i32 %65, %69
  br i1 %70, label %72, label %71

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

72:                                               ; preds = %64
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [110 x [110 x i32]], ptr @v, i64 0, i64 %74
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [110 x i32], ptr %75, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = icmp sle i32 %79, %80
  br i1 %81, label %82, label %111

82:                                               ; preds = %72
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [110 x [110 x i32]], ptr @v, i64 0, i64 %88
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [110 x i32], ptr %89, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = sub nsw i32 %86, %93
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [110 x [110 x i32]], ptr @w, i64 0, i64 %99
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [110 x i32], ptr %100, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = add nsw i32 %97, %104
  store i32 %105, ptr %8, align 4, !tbaa !5
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %85, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %109
  store i32 %107, ptr %110, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %111

111:                                              ; preds = %82, %72
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %7, align 4, !tbaa !5
  br label %64, !llvm.loop !12

115:                                              ; preds = %71
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = add nsw i32 %117, -1
  store i32 %118, ptr %6, align 4, !tbaa !5
  br label %59, !llvm.loop !13

119:                                              ; preds = %62
  br label %120

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

123:                                              ; preds = %56
  %124 = load i32, ptr @m, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %127)
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %128, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

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: 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

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) #4 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)) #5

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


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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@v = external dso_local global [110 x [110 x i32]], align 16
@w = external dso_local global [110 x [110 x i32]], align 16
@s = external dso_local global [110 x i32], align 16
@f = external dso_local global [110 x i32], align 16
@_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 = 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)
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %.not35 = icmp slt i32 %4, 1
  br i1 %.not35, label %.preheader33.thread, label %.lr.ph38

.preheader33.thread:                              ; preds = %0
  %.pre6567 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge47

.preheader33:                                     ; preds = %._crit_edge
  %.not3144 = icmp sgt i32 %10, 0
  %.pre65 = load i32, ptr @m, align 4, !tbaa !5
  %5 = icmp sgt i32 %.pre65, -1
  %or.cond = select i1 %.not3144, i1 %5, i1 false
  br i1 %or.cond, label %.lr.ph46.split, label %._crit_edge47

.lr.ph38:                                         ; preds = %0, %._crit_edge
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %._crit_edge ], [ 1, %0 ]
  %6 = getelementptr inbounds [110 x i32], ptr @s, i64 0, i64 %indvars.iv51
  %7 = 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) %6)
  %8 = load i32, ptr %6, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph38
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %.not.not = icmp slt i64 %indvars.iv51, %11
  br i1 %.not.not, label %.lr.ph38, label %.preheader33, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph38, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph38 ]
  %12 = getelementptr inbounds [110 x [110 x i32]], ptr @v, i64 0, i64 %indvars.iv51, i64 %indvars.iv
  %13 = 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) %12)
  %14 = getelementptr inbounds [110 x [110 x i32]], ptr @w, i64 0, i64 %indvars.iv51, i64 %indvars.iv
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr %6, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv.next, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge47:                                    ; preds = %._crit_edge43, %.preheader33.thread, %.preheader33
  %19 = phi i32 [ %.pre65, %.preheader33 ], [ %.pre6567, %.preheader33.thread ], [ %.pr, %._crit_edge43 ]
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %22)
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph46.split:                                   ; preds = %.preheader33, %._crit_edge43
  %25 = phi i32 [ %.pr, %._crit_edge43 ], [ %.pre65, %.preheader33 ]
  %26 = phi i32 [ %37, %._crit_edge43 ], [ %10, %.preheader33 ]
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %._crit_edge43 ], [ 1, %.preheader33 ]
  %27 = icmp sgt i32 %25, -1
  br i1 %27, label %.preheader.lr.ph, label %._crit_edge43

.preheader.lr.ph:                                 ; preds = %.lr.ph46.split
  %28 = getelementptr inbounds [110 x i32], ptr @s, i64 0, i64 %indvars.iv60
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.preheader.preheader, label %._crit_edge43

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %31 = zext nneg i32 %25 to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge41
  %32 = phi i32 [ %29, %.preheader.preheader ], [ %39, %._crit_edge41 ]
  %33 = phi i32 [ %29, %.preheader.preheader ], [ %40, %._crit_edge41 ]
  %indvars.iv57 = phi i64 [ %31, %.preheader.preheader ], [ %indvars.iv.next58, %._crit_edge41 ]
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph40, label %._crit_edge41

.lr.ph40:                                         ; preds = %.preheader
  %35 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %indvars.iv57
  %36 = trunc nuw nsw i64 %indvars.iv57 to i32
  br label %42

._crit_edge43.loopexit:                           ; preds = %._crit_edge41
  %.pre63 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge43

._crit_edge43:                                    ; preds = %.preheader.lr.ph, %._crit_edge43.loopexit, %.lr.ph46.split
  %37 = phi i32 [ %.pre63, %._crit_edge43.loopexit ], [ %26, %.lr.ph46.split ], [ %26, %.preheader.lr.ph ]
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %38 = sext i32 %37 to i64
  %.not31.not = icmp slt i64 %indvars.iv60, %38
  %.pr = load i32, ptr @m, align 4, !tbaa !5
  br i1 %.not31.not, label %.lr.ph46.split, label %._crit_edge47, !llvm.loop !12

._crit_edge41:                                    ; preds = %57, %.preheader
  %39 = phi i32 [ %32, %.preheader ], [ %58, %57 ]
  %40 = phi i32 [ %33, %.preheader ], [ %58, %57 ]
  %indvars.iv.next58 = add nsw i64 %indvars.iv57, -1
  %41 = icmp sgt i64 %indvars.iv57, 0
  br i1 %41, label %.preheader, label %._crit_edge43.loopexit, !llvm.loop !14

42:                                               ; preds = %.lr.ph40, %57
  %43 = phi i32 [ %32, %.lr.ph40 ], [ %58, %57 ]
  %indvars.iv54 = phi i64 [ 0, %.lr.ph40 ], [ %indvars.iv.next55, %57 ]
  %44 = getelementptr inbounds [110 x [110 x i32]], ptr @v, i64 0, i64 %indvars.iv60, i64 %indvars.iv54
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %.not32 = icmp slt i64 %indvars.iv57, %46
  br i1 %.not32, label %57, label %47

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %48 = sub nsw i32 %36, %45
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds [110 x [110 x i32]], ptr @w, i64 0, i64 %indvars.iv60, i64 %indvars.iv54
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, %51
  store i32 %54, ptr %1, align 4, !tbaa !5
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %35, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %56 = load i32, ptr %55, align 4, !tbaa !5
  store i32 %56, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %.pre = load i32, ptr %28, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %42, %47
  %58 = phi i32 [ %43, %42 ], [ %.pre, %47 ]
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %59 = sext i32 %58 to i64
  %60 = icmp slt i64 %indvars.iv.next55, %59
  br i1 %60, label %42, label %._crit_edge41, !llvm.loop !15
}

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: 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 #3

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 #4 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)) #5

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 = { 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 = { 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 = { 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 #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}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !10, !13}
!15 = distinct !{!15, !10}


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