; LLVM IR from UtkarshPathrabe/Competitive-Coding :: Model Algorithms/Dynamic Programming/Egg Dropping Puzzle.ll (Z7eggDropii)

; 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 @_Z7eggDropii(i32 noundef %0, i32 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %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
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = add nsw i32 %15, 1
  %17 = zext i32 %16 to i64
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  %20 = zext i32 %19 to i64
  %21 = call ptr @llvm.stacksave.p0()
  store ptr %21, ptr %5, align 8
  %22 = mul nuw i64 %17, %20
  %23 = alloca i32, i64 %22, align 16
  store i64 %17, ptr %6, align 8
  store i64 %20, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %40, %2
  %25 = load i32, ptr %8, align 4, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = icmp sle i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %43

29:                                               ; preds = %24
  %30 = load i32, ptr %8, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = mul nsw i64 %31, %20
  %33 = getelementptr inbounds i32, ptr %23, i64 %32
  %34 = getelementptr inbounds i32, ptr %33, i64 1
  store i32 1, ptr %34, align 4, !tbaa !5
  %35 = load i32, ptr %8, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = mul nsw i64 %36, %20
  %38 = getelementptr inbounds i32, ptr %23, i64 %37
  %39 = getelementptr inbounds i32, ptr %38, i64 0
  store i32 0, ptr %39, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %29
  %41 = load i32, ptr %8, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %8, align 4, !tbaa !5
  br label %24, !llvm.loop !9

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

44:                                               ; preds = %56, %43
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = icmp sle i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %59

49:                                               ; preds = %44
  %50 = load i32, ptr %9, align 4, !tbaa !5
  %51 = mul nsw i64 1, %20
  %52 = getelementptr inbounds i32, ptr %23, i64 %51
  %53 = load i32, ptr %9, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i32, ptr %52, i64 %54
  store i32 %50, ptr %55, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %49
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %9, align 4, !tbaa !5
  br label %44, !llvm.loop !11

59:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 2, ptr %10, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %130, %59
  %61 = load i32, ptr %10, align 4, !tbaa !5
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = icmp sle i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %133

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 2, ptr %12, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %126, %65
  %67 = load i32, ptr %12, align 4, !tbaa !5
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = icmp sle i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %129

71:                                               ; preds = %66
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = mul nsw i64 %73, %20
  %75 = getelementptr inbounds i32, ptr %23, i64 %74
  %76 = load i32, ptr %12, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr %75, i64 %77
  store i32 2147483647, ptr %78, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %122, %71
  %80 = load i32, ptr %13, align 4, !tbaa !5
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = icmp sle i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %125

84:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %85 = load i32, ptr %10, align 4, !tbaa !5
  %86 = sub nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = mul nsw i64 %87, %20
  %89 = getelementptr inbounds i32, ptr %23, i64 %88
  %90 = load i32, ptr %13, align 4, !tbaa !5
  %91 = sub nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i32, ptr %89, i64 %92
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = mul nsw i64 %95, %20
  %97 = getelementptr inbounds i32, ptr %23, i64 %96
  %98 = load i32, ptr %12, align 4, !tbaa !5
  %99 = load i32, ptr %13, align 4, !tbaa !5
  %100 = sub nsw i32 %98, %99
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i32, ptr %97, i64 %101
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %93, ptr noundef nonnull align 4 dereferenceable(4) %102)
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = add nsw i32 1, %104
  store i32 %105, ptr %14, align 4, !tbaa !5
  %106 = load i32, ptr %10, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = mul nsw i64 %107, %20
  %109 = getelementptr inbounds i32, ptr %23, i64 %108
  %110 = load i32, ptr %12, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i32, ptr %109, i64 %111
  %113 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %112)
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = load i32, ptr %10, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = mul nsw i64 %116, %20
  %118 = getelementptr inbounds i32, ptr %23, i64 %117
  %119 = load i32, ptr %12, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i32, ptr %118, i64 %120
  store i32 %114, ptr %121, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %122

122:                                              ; preds = %84
  %123 = load i32, ptr %13, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %13, align 4, !tbaa !5
  br label %79, !llvm.loop !12

125:                                              ; preds = %83
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %12, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %12, align 4, !tbaa !5
  br label %66, !llvm.loop !13

129:                                              ; preds = %70
  br label %130

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

133:                                              ; preds = %64
  %134 = load i32, ptr %3, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = mul nsw i64 %135, %20
  %137 = getelementptr inbounds i32, ptr %23, i64 %136
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds i32, ptr %137, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  store i32 1, ptr %11, align 4
  %142 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %142)
  ret i32 %141
}

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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 @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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)) #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 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}
!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"

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z7eggDropii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = add i32 %0, 1
  %5 = zext i32 %4 to i64
  %6 = add i32 %1, 1
  %7 = zext i32 %6 to i64
  %8 = mul nuw i64 %7, %5
  %9 = alloca i32, i64 %8, align 16
  %.not46 = icmp slt i32 %0, 1
  br i1 %.not46, label %.preheader45, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %2
  %10 = add nsw i64 %5, -1
  %11 = add nsw i64 %5, -2
  %xtraiter = and i64 %10, 3
  %12 = icmp ult i64 %11, 3
  br i1 %12, label %.preheader45.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %10, -4
  br label %.lr.ph

.preheader45.loopexit.unr-lcssa:                  ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader45, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader45.loopexit.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader45.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader45.loopexit.unr-lcssa ]
  %13 = mul nuw nsw i64 %indvars.iv.epil, %7
  %14 = getelementptr inbounds i32, ptr %9, i64 %13
  %15 = getelementptr inbounds i8, ptr %14, i64 4
  store i32 1, ptr %15, align 4, !tbaa !5
  store i32 0, ptr %14, align 4, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.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 %.preheader45, label %.lr.ph.epil, !llvm.loop !9

.preheader45:                                     ; preds = %.preheader45.loopexit.unr-lcssa, %.lr.ph.epil, %2
  %.not4048 = icmp slt i32 %1, 1
  br i1 %.not4048, label %.preheader44, label %.lr.ph50

.lr.ph50:                                         ; preds = %.preheader45
  %16 = getelementptr inbounds i32, ptr %9, i64 %7
  %17 = add nsw i64 %7, -1
  %min.iters.check = icmp ult i32 %6, 9
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph50
  %indvars.iv62.ph = phi i64 [ 1, %.lr.ph50 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph50
  %n.vec = and i64 %17, -8
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %offset.idx = or disjoint i64 %index, 1
  %18 = getelementptr inbounds i32, ptr %16, i64 %offset.idx
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  store <4 x i32> %vec.ind, ptr %18, align 4, !tbaa !5
  store <4 x i32> %step.add, ptr %19, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %20 = icmp eq i64 %index.next, %n.vec
  br i1 %20, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %17, %n.vec
  br i1 %cmp.n, label %.preheader44, label %scalar.ph.preheader

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %21 = mul nuw nsw i64 %indvars.iv, %7
  %22 = getelementptr inbounds i32, ptr %9, i64 %21
  %23 = getelementptr inbounds i8, ptr %22, i64 4
  store i32 1, ptr %23, align 4, !tbaa !5
  store i32 0, ptr %22, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = mul nuw nsw i64 %indvars.iv.next, %7
  %25 = getelementptr inbounds i32, ptr %9, i64 %24
  %26 = getelementptr inbounds i8, ptr %25, i64 4
  store i32 1, ptr %26, align 4, !tbaa !5
  store i32 0, ptr %25, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %27 = mul nuw nsw i64 %indvars.iv.next.1, %7
  %28 = getelementptr inbounds i32, ptr %9, i64 %27
  %29 = getelementptr inbounds i8, ptr %28, i64 4
  store i32 1, ptr %29, align 4, !tbaa !5
  store i32 0, ptr %28, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %30 = mul nuw nsw i64 %indvars.iv.next.2, %7
  %31 = getelementptr inbounds i32, ptr %9, i64 %30
  %32 = getelementptr inbounds i8, ptr %31, i64 4
  store i32 1, ptr %32, align 4, !tbaa !5
  store i32 0, ptr %31, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 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 %.preheader45.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !15

.preheader44:                                     ; preds = %scalar.ph, %middle.block, %.preheader45
  %.not4157 = icmp slt i32 %0, 2
  br i1 %.not4157, label %._crit_edge59, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader44
  %invariant.gep52 = getelementptr i8, ptr %9, i64 -4
  %.not4254 = icmp slt i32 %1, 2
  br i1 %.not4254, label %._crit_edge59, label %.preheader

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %scalar.ph ], [ %indvars.iv62.ph, %scalar.ph.preheader ]
  %33 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv62
  %34 = trunc nuw nsw i64 %indvars.iv62 to i32
  store i32 %34, ptr %33, align 4, !tbaa !5
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next63, %7
  br i1 %exitcond66.not, label %.preheader44, label %scalar.ph, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %._crit_edge ], [ 2, %.preheader.lr.ph ]
  %35 = mul nuw nsw i64 %indvars.iv83, %7
  %36 = getelementptr inbounds i32, ptr %9, i64 %35
  %37 = add nsw i64 %indvars.iv83, -1
  %38 = mul nuw nsw i64 %37, %7
  %gep53 = getelementptr i32, ptr %invariant.gep52, i64 %38
  br label %45

._crit_edge59:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %.preheader44
  %39 = sext i32 %0 to i64
  %40 = mul nsw i64 %7, %39
  %41 = getelementptr inbounds i32, ptr %9, i64 %40
  %42 = sext i32 %1 to i64
  %43 = getelementptr inbounds i32, ptr %41, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  ret i32 %44

._crit_edge:                                      ; preds = %47
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next84, %5
  br i1 %exitcond87.not, label %._crit_edge59, label %.preheader, !llvm.loop !17

45:                                               ; preds = %.preheader, %47
  %indvars.iv76 = phi i64 [ 2, %.preheader ], [ %indvars.iv.next77, %47 ]
  %indvars.iv74 = phi i64 [ 3, %.preheader ], [ %indvars.iv.next75, %47 ]
  %46 = getelementptr inbounds i32, ptr %36, i64 %indvars.iv76
  store i32 2147483647, ptr %46, align 4, !tbaa !5
  br label %48

47:                                               ; preds = %48
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next77, %7
  br i1 %exitcond82.not, label %._crit_edge, label %45, !llvm.loop !18

48:                                               ; preds = %45, %48
  %indvars.iv67 = phi i64 [ 1, %45 ], [ %indvars.iv.next68, %48 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %gep = getelementptr i32, ptr %gep53, i64 %indvars.iv67
  %49 = sub nsw i64 %indvars.iv76, %indvars.iv67
  %50 = getelementptr inbounds i32, ptr %36, i64 %49
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %gep, ptr noundef nonnull align 4 dereferenceable(4) %50)
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %3, align 4, !tbaa !5
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %46)
  %55 = load i32, ptr %54, align 4, !tbaa !5
  store i32 %55, ptr %46, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %exitcond73.not = icmp eq i64 %indvars.iv.next68, %indvars.iv74
  br i1 %exitcond73.not, label %47, label %48, !llvm.loop !19
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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 #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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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.unroll.disable"}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !14, !13}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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