; LLVM IR from upupming/algorithm :: acwing/算法基础课/第五讲 动态规划/背包问题/5. 多重背包问题 II (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 [12120 x i32], align 16
@w = external dso_local global [12120 x i32], align 16
@f = external dso_local global [2010 x i32], align 16
@tot = 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
  store i32 0, ptr %1, align 4
  %11 = 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)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, 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 %13

13:                                               ; preds = %63, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = icmp sle i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %66

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %26, %18
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %26, label %45

26:                                               ; preds = %22
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = mul nsw i32 %27, %28
  %30 = load i32, ptr @tot, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr @tot, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [12120 x i32], ptr @v, i64 0, i64 %32
  store i32 %29, ptr %33, align 4, !tbaa !5
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = mul nsw i32 %34, %35
  %37 = load i32, ptr @tot, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [12120 x i32], ptr @w, i64 0, i64 %38
  store i32 %36, ptr %39, align 4, !tbaa !5
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = sub nsw i32 %41, %40
  store i32 %42, ptr %5, align 4, !tbaa !5
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = mul nsw i32 %43, 2
  store i32 %44, ptr %6, align 4, !tbaa !5
  br label %22, !llvm.loop !9

45:                                               ; preds = %22
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %48, label %62

48:                                               ; preds = %45
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = mul nsw i32 %49, %50
  %52 = load i32, ptr @tot, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr @tot, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [12120 x i32], ptr @v, i64 0, i64 %54
  store i32 %51, ptr %55, align 4, !tbaa !5
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = mul nsw i32 %56, %57
  %59 = load i32, ptr @tot, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [12120 x i32], ptr @w, i64 0, i64 %60
  store i32 %58, ptr %61, align 4, !tbaa !5
  br label %62

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

63:                                               ; preds = %62
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !11

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

67:                                               ; preds = %109, %66
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = load i32, ptr @tot, align 4, !tbaa !5
  %70 = icmp sle i32 %68, %69
  br i1 %70, label %72, label %71

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

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %73 = load i32, ptr @m, align 4, !tbaa !5
  store i32 %73, ptr %9, align 4, !tbaa !5
  br label %74

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

81:                                               ; preds = %74
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %108

82:                                               ; preds = %74
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [2010 x i32], ptr @f, i64 0, i64 %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [12120 x i32], ptr @v, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sub nsw i32 %86, %90
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [2010 x i32], ptr @f, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [12120 x i32], ptr @w, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = add nsw i32 %94, %98
  store i32 %99, ptr %10, align 4, !tbaa !5
  %100 = 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) %10)
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [2010 x i32], ptr @f, i64 0, i64 %103
  store i32 %101, ptr %104, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %105

105:                                              ; preds = %82
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = add nsw i32 %106, -1
  store i32 %107, ptr %9, align 4, !tbaa !5
  br label %74, !llvm.loop !12

108:                                              ; preds = %81
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %7, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %7, align 4, !tbaa !5
  br label %67, !llvm.loop !13

112:                                              ; preds = %71
  %113 = load i32, ptr @m, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [2010 x i32], ptr @f, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %116)
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %117, 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}


; 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 local_unnamed_addr global [12120 x i32], align 16
@w = external dso_local local_unnamed_addr global [12120 x i32], align 16
@f = external dso_local global [2010 x i32], align 16
@tot = external dso_local local_unnamed_addr 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 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = 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)
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %.not28 = icmp slt i32 %7, 1
  br i1 %.not28, label %.preheader, label %.lr.ph31

.preheader:                                       ; preds = %.thread, %0
  %8 = load i32, ptr @tot, align 4, !tbaa !5
  %.not2137 = icmp slt i32 %8, 1
  br i1 %.not2137, label %._crit_edge40, label %.lr.ph39

.lr.ph31:                                         ; preds = %0, %.thread
  %.01929 = phi i32 [ %36, %.thread ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %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) %1)
  %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) %2)
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %.pr = load i32, ptr %3, align 4, !tbaa !5
  %.not2324 = icmp slt i32 %.pr, 1
  br i1 %.not2324, label %.thread, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph31
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sext i32 %tot.promoted to i64
  br label %15

15:                                               ; preds = %.lr.ph, %15
  %indvars.iv = phi i64 [ %14, %.lr.ph ], [ %indvars.iv.next, %15 ]
  %.01825 = phi i32 [ 1, %.lr.ph ], [ %22, %15 ]
  %16 = phi i32 [ %.pr, %.lr.ph ], [ %21, %15 ]
  %17 = mul nsw i32 %12, %.01825
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %18 = getelementptr inbounds [12120 x i32], ptr @v, i64 0, i64 %indvars.iv.next
  store i32 %17, ptr %18, align 4, !tbaa !5
  %19 = mul nsw i32 %13, %.01825
  %20 = getelementptr inbounds [12120 x i32], ptr @w, i64 0, i64 %indvars.iv.next
  store i32 %19, ptr %20, align 4, !tbaa !5
  %21 = sub nsw i32 %16, %.01825
  %22 = shl nsw i32 %.01825, 1
  %.not23 = icmp sgt i32 %22, %21
  br i1 %.not23, label %23, label %15, !llvm.loop !9

23:                                               ; preds = %15
  %24 = trunc nsw i64 %indvars.iv.next to i32
  store i32 %24, ptr @tot, align 4, !tbaa !5
  %25 = icmp sgt i32 %21, 0
  br i1 %25, label %26, label %.thread

26:                                               ; preds = %23
  %27 = load i32, ptr %1, align 4, !tbaa !5
  %28 = mul nsw i32 %27, %21
  %29 = load i32, ptr @tot, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr @tot, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [12120 x i32], ptr @v, i64 0, i64 %31
  store i32 %28, ptr %32, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = mul nsw i32 %33, %21
  %35 = getelementptr inbounds [12120 x i32], ptr @w, i64 0, i64 %31
  store i32 %34, ptr %35, align 4, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %.lr.ph31, %26, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %36 = add nuw nsw i32 %.01929, 1
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.01929, %37
  br i1 %.not.not, label %.lr.ph31, label %.preheader, !llvm.loop !11

._crit_edge40:                                    ; preds = %._crit_edge36, %.preheader
  %38 = load i32, ptr @m, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [2010 x i32], ptr @f, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %41)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph39:                                         ; preds = %.preheader, %._crit_edge36
  %44 = phi i32 [ %50, %._crit_edge36 ], [ %8, %.preheader ]
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %._crit_edge36 ], [ 1, %.preheader ]
  %45 = load i32, ptr @m, align 4, !tbaa !5
  %46 = getelementptr inbounds [12120 x i32], ptr @v, i64 0, i64 %indvars.iv47
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %.not2232 = icmp slt i32 %45, %47
  br i1 %.not2232, label %._crit_edge36, label %.lr.ph35

.lr.ph35:                                         ; preds = %.lr.ph39
  %48 = getelementptr inbounds [12120 x i32], ptr @w, i64 0, i64 %indvars.iv47
  %49 = sext i32 %45 to i64
  br label %52

._crit_edge36.loopexit:                           ; preds = %52
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge36

._crit_edge36:                                    ; preds = %._crit_edge36.loopexit, %.lr.ph39
  %50 = phi i32 [ %.pre, %._crit_edge36.loopexit ], [ %44, %.lr.ph39 ]
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %51 = sext i32 %50 to i64
  %.not21.not = icmp slt i64 %indvars.iv47, %51
  br i1 %.not21.not, label %.lr.ph39, label %._crit_edge40, !llvm.loop !12

52:                                               ; preds = %.lr.ph35, %52
  %indvars.iv44 = phi i64 [ %49, %.lr.ph35 ], [ %indvars.iv.next45, %52 ]
  %53 = phi i32 [ %47, %.lr.ph35 ], [ %63, %52 ]
  %54 = getelementptr inbounds [2010 x i32], ptr @f, i64 0, i64 %indvars.iv44
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %55 = sext i32 %53 to i64
  %56 = sub nsw i64 %indvars.iv44, %55
  %57 = getelementptr inbounds [2010 x i32], ptr @f, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %48, align 4, !tbaa !5
  %60 = add nsw i32 %59, %58
  store i32 %60, ptr %4, align 4, !tbaa !5
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %54, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %62 = load i32, ptr %61, align 4, !tbaa !5
  store i32 %62, ptr %54, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %indvars.iv.next45 = add nsw i64 %indvars.iv44, -1
  %63 = load i32, ptr %46, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %.not22.not = icmp sgt i64 %indvars.iv44, %64
  br i1 %.not22.not, label %52, label %._crit_edge36.loopexit, !llvm.loop !13
}

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 = distinct !{!13, !10}


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