; LLVM IR from amritansh22/Data-Structures-and-Algorithms-in-cpp :: GoldMineProblem.ll (Z10getMaxGoldPA100_iii)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z10getMaxGoldPA100_iii(ptr noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %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
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %18 = load i32, ptr %5, align 4, !tbaa !9
  %19 = zext i32 %18 to i64
  %20 = load i32, ptr %6, align 4, !tbaa !9
  %21 = zext i32 %20 to i64
  %22 = call ptr @llvm.stacksave.p0()
  store ptr %22, ptr %7, align 8
  %23 = mul nuw i64 %19, %21
  %24 = alloca i32, i64 %23, align 16
  store i64 %19, ptr %8, align 8
  store i64 %21, ptr %9, align 8
  %25 = mul nuw i64 %19, %21
  %26 = mul nuw i64 4, %25
  call void @llvm.memset.p0.i64(ptr align 16 %24, i8 0, i64 %26, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = sub nsw i32 %27, 1
  store i32 %28, ptr %10, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %124, %3
  %30 = load i32, ptr %10, align 4, !tbaa !9
  %31 = icmp sge i32 %30, 0
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %127

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

34:                                               ; preds = %120, %33
  %35 = load i32, ptr %12, align 4, !tbaa !9
  %36 = load i32, ptr %5, align 4, !tbaa !9
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = load i32, ptr %6, align 4, !tbaa !9
  %42 = sub nsw i32 %41, 1
  %43 = icmp eq i32 %40, %42
  br i1 %43, label %44, label %45

44:                                               ; preds = %39
  br label %55

45:                                               ; preds = %39
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = mul nsw i64 %47, %21
  %49 = getelementptr inbounds i32, ptr %24, i64 %48
  %50 = load i32, ptr %10, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i32, ptr %49, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %45, %44
  %56 = phi i32 [ 0, %44 ], [ %54, %45 ]
  store i32 %56, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %57 = load i32, ptr %12, align 4, !tbaa !9
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %64, label %59

59:                                               ; preds = %55
  %60 = load i32, ptr %10, align 4, !tbaa !9
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = sub nsw i32 %61, 1
  %63 = icmp eq i32 %60, %62
  br i1 %63, label %64, label %65

64:                                               ; preds = %59, %55
  br label %76

65:                                               ; preds = %59
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = sub nsw i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = mul nsw i64 %68, %21
  %70 = getelementptr inbounds i32, ptr %24, i64 %69
  %71 = load i32, ptr %10, align 4, !tbaa !9
  %72 = add nsw i32 %71, 1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %70, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %65, %64
  %77 = phi i32 [ 0, %64 ], [ %75, %65 ]
  store i32 %77, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %78 = load i32, ptr %12, align 4, !tbaa !9
  %79 = load i32, ptr %5, align 4, !tbaa !9
  %80 = sub nsw i32 %79, 1
  %81 = icmp eq i32 %78, %80
  br i1 %81, label %87, label %82

82:                                               ; preds = %76
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = load i32, ptr %6, align 4, !tbaa !9
  %85 = sub nsw i32 %84, 1
  %86 = icmp eq i32 %83, %85
  br i1 %86, label %87, label %88

87:                                               ; preds = %82, %76
  br label %99

88:                                               ; preds = %82
  %89 = load i32, ptr %12, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = mul nsw i64 %91, %21
  %93 = getelementptr inbounds i32, ptr %24, i64 %92
  %94 = load i32, ptr %10, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i32, ptr %93, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !9
  br label %99

99:                                               ; preds = %88, %87
  %100 = phi i32 [ 0, %87 ], [ %98, %88 ]
  store i32 %100, ptr %15, align 4, !tbaa !9
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = load i32, ptr %12, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [100 x i32], ptr %101, i64 %103
  %105 = load i32, ptr %10, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100 x i32], ptr %104, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !9
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %110 = 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) %109)
  %111 = load i32, ptr %110, align 4, !tbaa !9
  %112 = add nsw i32 %108, %111
  %113 = load i32, ptr %12, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = mul nsw i64 %114, %21
  %116 = getelementptr inbounds i32, ptr %24, i64 %115
  %117 = load i32, ptr %10, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds i32, ptr %116, i64 %118
  store i32 %112, ptr %119, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %120

120:                                              ; preds = %99
  %121 = load i32, ptr %12, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %12, align 4, !tbaa !9
  br label %34, !llvm.loop !11

123:                                              ; preds = %38
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %10, align 4, !tbaa !9
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %10, align 4, !tbaa !9
  br label %29, !llvm.loop !13

127:                                              ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %128 = mul nsw i64 0, %21
  %129 = getelementptr inbounds i32, ptr %24, i64 %128
  %130 = getelementptr inbounds i32, ptr %129, i64 0
  %131 = load i32, ptr %130, align 4, !tbaa !9
  store i32 %131, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %132

132:                                              ; preds = %145, %127
  %133 = load i32, ptr %17, align 4, !tbaa !9
  %134 = load i32, ptr %5, align 4, !tbaa !9
  %135 = icmp slt i32 %133, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %148

137:                                              ; preds = %132
  %138 = load i32, ptr %17, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = mul nsw i64 %139, %21
  %141 = getelementptr inbounds i32, ptr %24, i64 %140
  %142 = getelementptr inbounds i32, ptr %141, i64 0
  %143 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %142)
  %144 = load i32, ptr %143, align 4, !tbaa !9
  store i32 %144, ptr %16, align 4, !tbaa !9
  br label %145

145:                                              ; preds = %137
  %146 = load i32, ptr %17, align 4, !tbaa !9
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %17, align 4, !tbaa !9
  br label %132, !llvm.loop !14

148:                                              ; preds = %136
  %149 = load i32, ptr %16, align 4, !tbaa !9
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %150 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %150)
  ret i32 %149
}

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #1

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z10getMaxGoldPA100_iii(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = zext i32 %1 to i64
  %9 = zext i32 %2 to i64
  %10 = mul nuw i64 %9, %8
  %11 = alloca i32, i64 %10, align 16
  %12 = shl nuw i64 %10, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %11, i8 0, i64 %12, i1 false)
  %13 = add i32 %2, -1
  %invariant.gep49 = getelementptr i8, ptr %11, i64 4
  %14 = icmp sgt i32 %2, 0
  br i1 %14, label %.preheader.lr.ph, label %._crit_edge55

.preheader.lr.ph:                                 ; preds = %3
  %15 = icmp sgt i32 %1, 0
  br i1 %15, label %.preheader.us.preheader, label %._crit_edge55.thread

._crit_edge55.thread:                             ; preds = %.preheader.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %16 = load i32, ptr %11, align 16, !tbaa !5
  br label %._crit_edge

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %17 = add nsw i32 %1, -1
  %18 = zext nneg i32 %17 to i64
  %19 = zext nneg i32 %13 to i64
  %20 = icmp eq i32 %17, 0
  %exitcond.peel.not = icmp eq i32 %1, 1
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv70 = phi i64 [ %19, %.preheader.us.preheader ], [ %indvars.iv.next71, %._crit_edge.us ]
  %21 = icmp eq i64 %indvars.iv70, %19
  %gep50.us = getelementptr i32, ptr %invariant.gep49, i64 %indvars.iv70
  %invariant.gep48.us = getelementptr inbounds i32, ptr %11, i64 %indvars.iv70
  br i1 %21, label %.thread37.us.us, label %22

22:                                               ; preds = %.preheader.us
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %23 = load i32, ptr %gep50.us, align 4, !tbaa !5
  store i32 %23, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  br i1 %20, label %26, label %24

24:                                               ; preds = %22
  %gep47.us.peel = getelementptr inbounds i32, ptr %gep50.us, i64 %9
  %25 = load i32, ptr %gep47.us.peel, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %24, %22
  %27 = phi i32 [ %25, %24 ], [ 0, %22 ]
  store i32 %27, ptr %6, align 4, !tbaa !5
  %28 = getelementptr inbounds [100 x i32], ptr %0, i64 0, i64 %indvars.iv70
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %30)
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = add nsw i32 %32, %29
  store i32 %33, ptr %invariant.gep48.us, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br i1 %exitcond.peel.not, label %._crit_edge.us, label %.lr.ph.split.us59.peel.next

.lr.ph.split.us59.peel.next:                      ; preds = %26, %._crit_edge78
  %indvars.iv = phi i64 [ %.pre, %._crit_edge78 ], [ 1, %26 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %34 = mul nuw nsw i64 %indvars.iv, %9
  %gep41.us = getelementptr inbounds i32, ptr %gep50.us, i64 %34
  %35 = load i32, ptr %gep41.us, align 4, !tbaa !5
  store i32 %35, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %36 = add nsw i64 %indvars.iv, -1
  %37 = mul nuw nsw i64 %36, %9
  %gep44.us = getelementptr i32, ptr %gep50.us, i64 %37
  %38 = load i32, ptr %gep44.us, align 4, !tbaa !5
  store i32 %38, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %39 = icmp eq i64 %indvars.iv, %18
  %.pre = add nuw nsw i64 %indvars.iv, 1
  br i1 %39, label %._crit_edge78, label %40

40:                                               ; preds = %.lr.ph.split.us59.peel.next
  %41 = mul nuw nsw i64 %.pre, %9
  %gep47.us = getelementptr inbounds i32, ptr %gep50.us, i64 %41
  %42 = load i32, ptr %gep47.us, align 4, !tbaa !5
  br label %._crit_edge78

._crit_edge78:                                    ; preds = %.lr.ph.split.us59.peel.next, %40
  %43 = phi i32 [ %42, %40 ], [ 0, %.lr.ph.split.us59.peel.next ]
  store i32 %43, ptr %6, align 4, !tbaa !5
  %44 = getelementptr inbounds [100 x i32], ptr %0, i64 %indvars.iv, i64 %indvars.iv70
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %46)
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = add nsw i32 %48, %45
  %gep.us57 = getelementptr inbounds i32, ptr %invariant.gep48.us, i64 %34
  store i32 %49, ptr %gep.us57, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %exitcond.not = icmp eq i64 %.pre, %8
  br i1 %exitcond.not, label %._crit_edge.us, label %.lr.ph.split.us59.peel.next, !llvm.loop !9

._crit_edge.us:                                   ; preds = %._crit_edge78, %.thread37.us.us, %26
  %indvars.iv.next71 = add nsw i64 %indvars.iv70, -1
  %50 = icmp sgt i64 %indvars.iv70, 0
  br i1 %50, label %.preheader.us, label %._crit_edge55, !llvm.loop !12

.thread37.us.us:                                  ; preds = %.preheader.us, %.thread37.us.us
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %.thread37.us.us ], [ 0, %.preheader.us ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  %51 = getelementptr inbounds [100 x i32], ptr %0, i64 %indvars.iv65, i64 %19
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %53)
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = add nsw i32 %55, %52
  %57 = mul nuw nsw i64 %indvars.iv65, %9
  %gep.us.us = getelementptr inbounds i32, ptr %invariant.gep48.us, i64 %57
  store i32 %56, ptr %gep.us.us, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next66, %8
  br i1 %exitcond69.not, label %._crit_edge.us, label %.thread37.us.us, !llvm.loop !13

._crit_edge55:                                    ; preds = %._crit_edge.us, %3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %58 = load i32, ptr %11, align 16, !tbaa !5
  store i32 %58, ptr %7, align 4, !tbaa !5
  %59 = icmp sgt i32 %1, 1
  br i1 %59, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %._crit_edge55.thread, %._crit_edge55
  %60 = phi i32 [ %58, %._crit_edge55 ], [ %16, %._crit_edge55.thread ], [ %64, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  ret i32 %60

.lr.ph:                                           ; preds = %._crit_edge55, %.lr.ph
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %.lr.ph ], [ 1, %._crit_edge55 ]
  %61 = mul nuw nsw i64 %indvars.iv73, %9
  %62 = getelementptr inbounds i32, ptr %11, i64 %61
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %62)
  %64 = load i32, ptr %63, align 4, !tbaa !5
  store i32 %64, ptr %7, align 4, !tbaa !5
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next74, %8
  br i1 %exitcond77.not, label %._crit_edge, label %.lr.ph, !llvm.loop !14
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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: 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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass