; LLVM IR from ravireddy07/cpp-book :: src/Knapsack/0-1Knapsack_both_DP_Approaches.ll (Z8bottomUPPiS_xx)

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z8bottomUPPiS_xx(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca [100 x [100 x i32]], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  store i64 %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40000, ptr %9) #6
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 40000, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %17

17:                                               ; preds = %97, %4
  %18 = load i32, ptr %10, align 4, !tbaa !11
  %19 = sext i32 %18 to i64
  %20 = load i64, ptr %7, align 8, !tbaa !9
  %21 = icmp sle i64 %19, %20
  br i1 %21, label %23, label %22

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

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

24:                                               ; preds = %93, %23
  %25 = load i32, ptr %12, align 4, !tbaa !11
  %26 = sext i32 %25 to i64
  %27 = load i64, ptr %8, align 8, !tbaa !9
  %28 = icmp sle i64 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %24
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %96

30:                                               ; preds = %24
  %31 = load i32, ptr %10, align 4, !tbaa !11
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %36, label %33

33:                                               ; preds = %30
  %34 = load i64, ptr %8, align 8, !tbaa !9
  %35 = icmp eq i64 %34, 0
  br i1 %35, label %36, label %43

36:                                               ; preds = %33, %30
  %37 = load i32, ptr %10, align 4, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100 x [100 x i32]], ptr %9, i64 0, i64 %38
  %40 = load i32, ptr %12, align 4, !tbaa !11
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100 x i32], ptr %39, i64 0, i64 %41
  store i32 0, ptr %42, align 4, !tbaa !11
  br label %92

43:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !11
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load i32, ptr %10, align 4, !tbaa !11
  %46 = sub nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr %44, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !11
  %50 = sext i32 %49 to i64
  %51 = load i64, ptr %8, align 8, !tbaa !9
  %52 = icmp sle i64 %50, %51
  br i1 %52, label %53, label %76

53:                                               ; preds = %43
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = load i32, ptr %10, align 4, !tbaa !11
  %56 = sub nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i32, ptr %54, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !11
  %60 = load i32, ptr %10, align 4, !tbaa !11
  %61 = sub nsw i32 %60, 1
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100 x [100 x i32]], ptr %9, i64 0, i64 %62
  %64 = load i64, ptr %8, align 8, !tbaa !9
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = load i32, ptr %10, align 4, !tbaa !11
  %67 = sub nsw i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i32, ptr %65, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !11
  %71 = sext i32 %70 to i64
  %72 = sub nsw i64 %64, %71
  %73 = getelementptr inbounds [100 x i32], ptr %63, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !11
  %75 = add nsw i32 %59, %74
  store i32 %75, ptr %13, align 4, !tbaa !11
  br label %84

76:                                               ; preds = %43
  %77 = load i32, ptr %10, align 4, !tbaa !11
  %78 = sub nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100 x [100 x i32]], ptr %9, i64 0, i64 %79
  %81 = load i64, ptr %8, align 8, !tbaa !9
  %82 = getelementptr inbounds [100 x i32], ptr %80, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !11
  store i32 %83, ptr %14, align 4, !tbaa !11
  br label %84

84:                                               ; preds = %76, %53
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %86 = load i32, ptr %85, align 4, !tbaa !11
  %87 = load i32, ptr %10, align 4, !tbaa !11
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100 x [100 x i32]], ptr %9, i64 0, i64 %88
  %90 = load i64, ptr %8, align 8, !tbaa !9
  %91 = getelementptr inbounds [100 x i32], ptr %89, i64 0, i64 %90
  store i32 %86, ptr %91, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %92

92:                                               ; preds = %84, %36
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %12, align 4, !tbaa !11
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %12, align 4, !tbaa !11
  br label %24, !llvm.loop !13

96:                                               ; preds = %29
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %10, align 4, !tbaa !11
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %10, align 4, !tbaa !11
  br label %17, !llvm.loop !15

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

101:                                              ; preds = %128, %100
  %102 = load i32, ptr %15, align 4, !tbaa !11
  %103 = sext i32 %102 to i64
  %104 = load i64, ptr %7, align 8, !tbaa !9
  %105 = icmp sle i64 %103, %104
  br i1 %105, label %107, label %106

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

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

108:                                              ; preds = %123, %107
  %109 = load i32, ptr %16, align 4, !tbaa !11
  %110 = sext i32 %109 to i64
  %111 = load i64, ptr %8, align 8, !tbaa !9
  %112 = icmp sle i64 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %108
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %126

114:                                              ; preds = %108
  %115 = load i32, ptr %15, align 4, !tbaa !11
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100 x [100 x i32]], ptr %9, i64 0, i64 %116
  %118 = load i64, ptr %8, align 8, !tbaa !9
  %119 = getelementptr inbounds [100 x i32], ptr %117, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !11
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %120)
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %121, ptr noundef @.str)
  br label %123

123:                                              ; preds = %114
  %124 = load i32, ptr %16, align 4, !tbaa !11
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %16, align 4, !tbaa !11
  br label %108, !llvm.loop !16

126:                                              ; preds = %113
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  br label %128

128:                                              ; preds = %126
  %129 = load i32, ptr %15, align 4, !tbaa !11
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %15, align 4, !tbaa !11
  br label %101, !llvm.loop !17

131:                                              ; preds = %106
  %132 = load i64, ptr %7, align 8, !tbaa !9
  %133 = getelementptr inbounds [100 x [100 x i32]], ptr %9, i64 0, i64 %132
  %134 = load i64, ptr %8, align 8, !tbaa !9
  %135 = getelementptr inbounds [100 x i32], ptr %133, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !11
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 40000, ptr %9) #6
  ret i32 %136
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; 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 #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z8bottomUPPiS_xx(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #2 {
  %5 = alloca [100 x [100 x i32]], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %5) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %5, i8 0, i64 40000, i1 false)
  %.not50 = icmp slt i64 %2, 0
  br i1 %.not50, label %._crit_edge60, label %.preheader47.lr.ph

.preheader47.lr.ph:                               ; preds = %4
  %.not4448 = icmp slt i64 %3, 0
  br i1 %.not4448, label %.preheader.us, label %.preheader47.lr.ph.split

.preheader47.lr.ph.split:                         ; preds = %.preheader47.lr.ph
  %8 = icmp eq i64 %3, 0
  br i1 %8, label %.preheader47.us52.preheader, label %.preheader47.preheader

.preheader47.us52.preheader:                      ; preds = %.preheader47.lr.ph.split
  %9 = add nuw i64 %2, 1
  %xtraiter = and i64 %9, 3
  %10 = icmp ult i64 %2, 3
  br i1 %10, label %.preheader46.loopexit.unr-lcssa, label %.preheader47.us52.preheader.new

.preheader47.us52.preheader.new:                  ; preds = %.preheader47.us52.preheader
  %unroll_iter = and i64 %9, -4
  %invariant.gep = getelementptr i8, ptr %5, i64 400
  %invariant.gep97 = getelementptr i8, ptr %5, i64 800
  %invariant.gep99 = getelementptr i8, ptr %5, i64 1200
  br label %.preheader47.us52

.preheader47.preheader:                           ; preds = %.preheader47.lr.ph.split
  %11 = shl i64 %3, 2
  %12 = add i64 %11, 4
  br label %.preheader47

.preheader47.us52:                                ; preds = %.preheader47.us52, %.preheader47.us52.preheader.new
  %indvar70 = phi i64 [ 0, %.preheader47.us52.preheader.new ], [ %indvar.next71.3, %.preheader47.us52 ]
  %niter = phi i64 [ 0, %.preheader47.us52.preheader.new ], [ %niter.next.3, %.preheader47.us52 ]
  %13 = mul nuw nsw i64 %indvar70, 400
  %scevgep72 = getelementptr i8, ptr %5, i64 %13
  store i32 0, ptr %scevgep72, align 16
  %14 = mul nuw i64 %indvar70, 400
  %gep = getelementptr i8, ptr %invariant.gep, i64 %14
  store i32 0, ptr %gep, align 16
  %15 = mul nuw i64 %indvar70, 400
  %gep98 = getelementptr i8, ptr %invariant.gep97, i64 %15
  store i32 0, ptr %gep98, align 16
  %16 = mul nuw i64 %indvar70, 400
  %gep100 = getelementptr i8, ptr %invariant.gep99, i64 %16
  store i32 0, ptr %gep100, align 16
  %indvar.next71.3 = add nuw nsw i64 %indvar70, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader46.loopexit.unr-lcssa, label %.preheader47.us52, !llvm.loop !5

.preheader47:                                     ; preds = %.preheader47.preheader, %._crit_edge
  %indvar = phi i64 [ 0, %.preheader47.preheader ], [ %indvar.next, %._crit_edge ]
  %17 = icmp eq i64 %indvar, 0
  %18 = add nsw i64 %indvar, -1
  %19 = getelementptr inbounds i32, ptr %0, i64 %18
  %20 = getelementptr inbounds i32, ptr %1, i64 %18
  %21 = getelementptr inbounds [100 x [100 x i32]], ptr %5, i64 0, i64 %18, i64 %3
  %22 = getelementptr inbounds [100 x [100 x i32]], ptr %5, i64 0, i64 %indvar, i64 %3
  br i1 %17, label %.lr.ph.split.us.preheader, label %.lr.ph.split

.lr.ph.split.us.preheader:                        ; preds = %.preheader47
  %23 = mul nuw nsw i64 %indvar, 400
  %scevgep = getelementptr i8, ptr %5, i64 %23
  call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %12, i1 false), !tbaa !7
  br label %._crit_edge

.preheader46.loopexit.unr-lcssa:                  ; preds = %.preheader47.us52, %.preheader47.us52.preheader
  %indvar70.unr = phi i64 [ 0, %.preheader47.us52.preheader ], [ %indvar.next71.3, %.preheader47.us52 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader46, label %.preheader47.us52.epil

.preheader47.us52.epil:                           ; preds = %.preheader46.loopexit.unr-lcssa, %.preheader47.us52.epil
  %indvar70.epil = phi i64 [ %indvar.next71.epil, %.preheader47.us52.epil ], [ %indvar70.unr, %.preheader46.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader47.us52.epil ], [ 0, %.preheader46.loopexit.unr-lcssa ]
  %24 = mul nuw nsw i64 %indvar70.epil, 400
  %scevgep72.epil = getelementptr i8, ptr %5, i64 %24
  store i32 0, ptr %scevgep72.epil, align 16
  %indvar.next71.epil = add nuw nsw i64 %indvar70.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 %.preheader46, label %.preheader47.us52.epil, !llvm.loop !11

.preheader46:                                     ; preds = %._crit_edge, %.preheader46.loopexit.unr-lcssa, %.preheader47.us52.epil
  br i1 %.not50, label %._crit_edge60, label %.preheader

.preheader.us:                                    ; preds = %.preheader47.lr.ph, %.preheader.us
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %.preheader.us ], [ 0, %.preheader47.lr.ph ]
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %.not42.us.not = icmp slt i64 %indvars.iv86, %2
  br i1 %.not42.us.not, label %.preheader.us, label %._crit_edge60, !llvm.loop !13

._crit_edge:                                      ; preds = %36, %.lr.ph.split.us.preheader
  %indvar.next = add nuw nsw i64 %indvar, 1
  %.not.not = icmp slt i64 %indvar, %2
  br i1 %.not.not, label %.preheader47, label %.preheader46, !llvm.loop !5

.lr.ph.split:                                     ; preds = %.preheader47, %36
  %indvars.iv = phi i64 [ %indvars.iv.next, %36 ], [ 0, %.preheader47 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 0, ptr %6, align 4, !tbaa !7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 0, ptr %7, align 4, !tbaa !7
  %26 = load i32, ptr %19, align 4, !tbaa !7
  %27 = sext i32 %26 to i64
  %.not45 = icmp sgt i64 %27, %3
  br i1 %.not45, label %34, label %28

28:                                               ; preds = %.lr.ph.split
  %29 = load i32, ptr %20, align 4, !tbaa !7
  %30 = sub nsw i64 %3, %27
  %31 = getelementptr inbounds [100 x [100 x i32]], ptr %5, i64 0, i64 %18, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !7
  %33 = add nsw i32 %32, %29
  store i32 %33, ptr %6, align 4, !tbaa !7
  br label %36

34:                                               ; preds = %.lr.ph.split
  %35 = load i32, ptr %21, align 4, !tbaa !7
  store i32 %35, ptr %7, align 4, !tbaa !7
  br label %36

36:                                               ; preds = %34, %28
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %38 = load i32, ptr %37, align 4, !tbaa !7
  store i32 %38, ptr %22, align 4, !tbaa !7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not44.not = icmp slt i64 %indvars.iv, %3
  br i1 %.not44.not, label %.lr.ph.split, label %._crit_edge, !llvm.loop !14

.preheader:                                       ; preds = %.preheader46, %._crit_edge57
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %._crit_edge57 ], [ 0, %.preheader46 ]
  %39 = getelementptr inbounds [100 x [100 x i32]], ptr %5, i64 0, i64 %indvars.iv83, i64 %3
  %40 = load i32, ptr %39, align 4, !tbaa !7
  br label %44

._crit_edge60:                                    ; preds = %._crit_edge57, %.preheader.us, %4, %.preheader46
  %41 = getelementptr inbounds [100 x [100 x i32]], ptr %5, i64 0, i64 %2, i64 %3
  %42 = load i32, ptr %41, align 4, !tbaa !7
  call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %5) #6
  ret i32 %42

._crit_edge57:                                    ; preds = %44
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %.not42.not = icmp slt i64 %indvars.iv83, %2
  br i1 %.not42.not, label %.preheader, label %._crit_edge60, !llvm.loop !13

44:                                               ; preds = %.preheader, %44
  %indvars.iv80 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next81, %44 ]
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %40)
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef nonnull @.str)
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %.not43.not = icmp slt i64 %indvars.iv80, %3
  br i1 %.not43.not, label %44, label %._crit_edge57, !llvm.loop !15
}

; 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 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 #4

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { "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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}


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