; LLVM IR from DimitrisJim/leetcode_solutions :: C/Algorithms (807)

; 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: nounwind uwtable
define dso_local i32 @maxIncreaseKeepingSkyline(ptr noundef %0, i32 noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %24 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %24, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = load i32, ptr %25, align 4, !tbaa !9
  store i32 %26, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = mul i64 %28, 4
  %30 = call noalias ptr @malloc(i64 noundef %29) #5
  store ptr %30, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %144, %3
  %32 = load i32, ptr %12, align 4, !tbaa !9
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %147

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = load i32, ptr %12, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds ptr, ptr %37, i64 %39
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  store ptr %41, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 -1, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %59, %36
  %43 = load i32, ptr %16, align 4, !tbaa !9
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %62

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %48 = load ptr, ptr %14, align 8, !tbaa !5
  %49 = load i32, ptr %16, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %48, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !9
  store i32 %52, ptr %17, align 4, !tbaa !9
  %53 = load i32, ptr %17, align 4, !tbaa !9
  %54 = load i32, ptr %15, align 4, !tbaa !9
  %55 = icmp sgt i32 %53, %54
  br i1 %55, label %56, label %58

56:                                               ; preds = %47
  %57 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %57, ptr %15, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %56, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %16, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %16, align 4, !tbaa !9
  br label %42, !llvm.loop !11

62:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %140, %62
  %64 = load i32, ptr %18, align 4, !tbaa !9
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %143

68:                                               ; preds = %63
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %102

71:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 -1, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %72

72:                                               ; preds = %93, %71
  %73 = load i32, ptr %20, align 4, !tbaa !9
  %74 = load i32, ptr %7, align 4, !tbaa !9
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  store i32 11, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %96

77:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = load i32, ptr %20, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds ptr, ptr %78, i64 %80
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  %83 = load i32, ptr %18, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i32, ptr %82, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !9
  store i32 %86, ptr %21, align 4, !tbaa !9
  %87 = load i32, ptr %21, align 4, !tbaa !9
  %88 = load i32, ptr %19, align 4, !tbaa !9
  %89 = icmp sgt i32 %87, %88
  br i1 %89, label %90, label %92

90:                                               ; preds = %77
  %91 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %91, ptr %19, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %90, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %93

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

96:                                               ; preds = %76
  %97 = load i32, ptr %19, align 4, !tbaa !9
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = load i32, ptr %18, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %98, i64 %100
  store i32 %97, ptr %101, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %102

102:                                              ; preds = %96, %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds ptr, ptr %103, i64 %105
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %108 = load i32, ptr %18, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i32, ptr %107, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !9
  store i32 %111, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %112 = load i32, ptr %15, align 4, !tbaa !9
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = load i32, ptr %18, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i32, ptr %113, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !9
  %118 = icmp slt i32 %112, %117
  br i1 %118, label %119, label %123

119:                                              ; preds = %102
  %120 = load i32, ptr %15, align 4, !tbaa !9
  %121 = load i32, ptr %22, align 4, !tbaa !9
  %122 = sub nsw i32 %120, %121
  br label %131

123:                                              ; preds = %102
  %124 = load ptr, ptr %10, align 8, !tbaa !5
  %125 = load i32, ptr %18, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %124, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !9
  %129 = load i32, ptr %22, align 4, !tbaa !9
  %130 = sub nsw i32 %128, %129
  br label %131

131:                                              ; preds = %123, %119
  %132 = phi i32 [ %122, %119 ], [ %130, %123 ]
  store i32 %132, ptr %23, align 4, !tbaa !9
  %133 = load i32, ptr %23, align 4, !tbaa !9
  %134 = icmp sgt i32 %133, 0
  br i1 %134, label %135, label %139

135:                                              ; preds = %131
  %136 = load i32, ptr %23, align 4, !tbaa !9
  %137 = load i32, ptr %11, align 4, !tbaa !9
  %138 = add nsw i32 %137, %136
  store i32 %138, ptr %11, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %135, %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %18, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %18, align 4, !tbaa !9
  br label %63, !llvm.loop !14

143:                                              ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %12, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %12, align 4, !tbaa !9
  br label %31, !llvm.loop !15

147:                                              ; preds = %35
  %148 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %148) #4
  %149 = load i32, ptr %11, align 4, !tbaa !9
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret i32 %149
}

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(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 "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 }
attributes #5 = { nounwind allocsize(0) }

!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/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}
!15 = distinct !{!15, !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: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local range(i32 0, -2147483648) i32 @maxIncreaseKeepingSkyline(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef readonly %2) local_unnamed_addr #0 {
  %4 = load i32, ptr %2, align 4, !tbaa !5
  %5 = icmp sgt i32 %1, 0
  %6 = icmp sgt i32 %4, 0
  %or.cond = select i1 %5, i1 %6, i1 false
  br i1 %or.cond, label %.lr.ph75.split.us.split.us.preheader, label %._crit_edge

.lr.ph75.split.us.split.us.preheader:             ; preds = %3
  %wide.trip.count124 = zext nneg i32 %1 to i64
  %wide.trip.count = zext nneg i32 %4 to i64
  %min.iters.check = icmp ult i32 %4, 8
  %n.vec = and i64 %wide.trip.count, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  %xtraiter = and i64 %wide.trip.count124, 3
  %7 = icmp ult i32 %1, 4
  %unroll_iter = and i64 %wide.trip.count124, 2147483644
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph.us.us.preheader

.lr.ph.us.us.preheader:                           ; preds = %._crit_edge71.split.us.us.us, %.lr.ph75.split.us.split.us.preheader
  %indvars.iv121 = phi i64 [ 0, %.lr.ph75.split.us.split.us.preheader ], [ %indvars.iv.next122, %._crit_edge71.split.us.us.us ]
  %.074.us.us = phi i32 [ 0, %.lr.ph75.split.us.split.us.preheader ], [ %.2.us.us.us, %._crit_edge71.split.us.us.us ]
  %8 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv121
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  br i1 %min.iters.check, label %.lr.ph.us.us.preheader128, label %vector.body

vector.body:                                      ; preds = %.lr.ph.us.us.preheader, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.lr.ph.us.us.preheader ]
  %vec.phi = phi <4 x i32> [ %12, %vector.body ], [ <i32 -1, i32 -1, i32 -1, i32 -1>, %.lr.ph.us.us.preheader ]
  %vec.phi126 = phi <4 x i32> [ %13, %vector.body ], [ <i32 -1, i32 -1, i32 -1, i32 -1>, %.lr.ph.us.us.preheader ]
  %10 = getelementptr inbounds i32, ptr %9, i64 %index
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  %wide.load = load <4 x i32>, ptr %10, align 4, !tbaa !5
  %wide.load127 = load <4 x i32>, ptr %11, align 4, !tbaa !5
  %12 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
  %13 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load127, <4 x i32> %vec.phi126)
  %index.next = add nuw i64 %index, 8
  %14 = icmp eq i64 %index.next, %n.vec
  br i1 %14, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %12, <4 x i32> %13)
  %15 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
  br i1 %cmp.n, label %.preheader62.us.us, label %.lr.ph.us.us.preheader128

.lr.ph.us.us.preheader128:                        ; preds = %middle.block, %.lr.ph.us.us.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.us.us.preheader ], [ %n.vec, %middle.block ]
  %.05264.us.us.ph = phi i32 [ -1, %.lr.ph.us.us.preheader ], [ %15, %middle.block ]
  br label %.lr.ph.us.us

.lr.ph.us.us:                                     ; preds = %.lr.ph.us.us.preheader128, %.lr.ph.us.us
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph.us.us ], [ %indvars.iv.ph, %.lr.ph.us.us.preheader128 ]
  %.05264.us.us = phi i32 [ %spec.select.us.us, %.lr.ph.us.us ], [ %.05264.us.us.ph, %.lr.ph.us.us.preheader128 ]
  %16 = getelementptr inbounds i32, ptr %9, i64 %indvars.iv
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %spec.select.us.us = tail call i32 @llvm.smax.i32(i32 %17, i32 %.05264.us.us)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader62.us.us, label %.lr.ph.us.us, !llvm.loop !15

.preheader62.us.us:                               ; preds = %.lr.ph.us.us, %middle.block
  %spec.select.us.us.lcssa = phi i32 [ %15, %middle.block ], [ %spec.select.us.us, %.lr.ph.us.us ]
  br label %.preheader.us.us.us

.preheader.us.us.us:                              ; preds = %._crit_edge.us.us.us, %.preheader62.us.us
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %._crit_edge.us.us.us ], [ 0, %.preheader62.us.us ]
  %.170.us.us.us = phi i32 [ %.2.us.us.us, %._crit_edge.us.us.us ], [ %.074.us.us, %.preheader62.us.us ]
  br i1 %7, label %._crit_edge.us.us.us.unr-lcssa, label %.preheader.us.us.us.new

.preheader.us.us.us.new:                          ; preds = %.preheader.us.us.us, %.preheader.us.us.us.new
  %indvars.iv111 = phi i64 [ %indvars.iv.next112.3, %.preheader.us.us.us.new ], [ 0, %.preheader.us.us.us ]
  %.04965.us.us.us = phi i32 [ %spec.select61.us.us.us.3, %.preheader.us.us.us.new ], [ -1, %.preheader.us.us.us ]
  %niter = phi i64 [ %niter.next.3, %.preheader.us.us.us.new ], [ 0, %.preheader.us.us.us ]
  %18 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv111
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv116
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %spec.select61.us.us.us = tail call i32 @llvm.smax.i32(i32 %21, i32 %.04965.us.us.us)
  %indvars.iv.next112 = or disjoint i64 %indvars.iv111, 1
  %22 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv.next112
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv116
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %spec.select61.us.us.us.1 = tail call i32 @llvm.smax.i32(i32 %25, i32 %spec.select61.us.us.us)
  %indvars.iv.next112.1 = or disjoint i64 %indvars.iv111, 2
  %26 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv.next112.1
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = getelementptr inbounds i32, ptr %27, i64 %indvars.iv116
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %spec.select61.us.us.us.2 = tail call i32 @llvm.smax.i32(i32 %29, i32 %spec.select61.us.us.us.1)
  %indvars.iv.next112.2 = or disjoint i64 %indvars.iv111, 3
  %30 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv.next112.2
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv116
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %spec.select61.us.us.us.3 = tail call i32 @llvm.smax.i32(i32 %33, i32 %spec.select61.us.us.us.2)
  %indvars.iv.next112.3 = add nuw nsw i64 %indvars.iv111, 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 %._crit_edge.us.us.us.unr-lcssa, label %.preheader.us.us.us.new, !llvm.loop !16

._crit_edge.us.us.us.unr-lcssa:                   ; preds = %.preheader.us.us.us.new, %.preheader.us.us.us
  %spec.select61.us.us.us.lcssa.ph = phi i32 [ poison, %.preheader.us.us.us ], [ %spec.select61.us.us.us.3, %.preheader.us.us.us.new ]
  %indvars.iv111.unr = phi i64 [ 0, %.preheader.us.us.us ], [ %indvars.iv.next112.3, %.preheader.us.us.us.new ]
  %.04965.us.us.us.unr = phi i32 [ -1, %.preheader.us.us.us ], [ %spec.select61.us.us.us.3, %.preheader.us.us.us.new ]
  br i1 %lcmp.mod.not, label %._crit_edge.us.us.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us.us.us.unr-lcssa, %.epil.preheader
  %indvars.iv111.epil = phi i64 [ %indvars.iv.next112.epil, %.epil.preheader ], [ %indvars.iv111.unr, %._crit_edge.us.us.us.unr-lcssa ]
  %.04965.us.us.us.epil = phi i32 [ %spec.select61.us.us.us.epil, %.epil.preheader ], [ %.04965.us.us.us.unr, %._crit_edge.us.us.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.us.us.us.unr-lcssa ]
  %34 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv111.epil
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = getelementptr inbounds i32, ptr %35, i64 %indvars.iv116
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %spec.select61.us.us.us.epil = tail call i32 @llvm.smax.i32(i32 %37, i32 %.04965.us.us.us.epil)
  %indvars.iv.next112.epil = add nuw nsw i64 %indvars.iv111.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 %._crit_edge.us.us.us, label %.epil.preheader, !llvm.loop !17

._crit_edge.us.us.us:                             ; preds = %.epil.preheader, %._crit_edge.us.us.us.unr-lcssa
  %spec.select61.us.us.us.lcssa = phi i32 [ %spec.select61.us.us.us.lcssa.ph, %._crit_edge.us.us.us.unr-lcssa ], [ %spec.select61.us.us.us.epil, %.epil.preheader ]
  %38 = getelementptr inbounds i32, ptr %9, i64 %indvars.iv116
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %.052.pn.us.us.us = tail call i32 @llvm.smin.i32(i32 %spec.select.us.us.lcssa, i32 %spec.select61.us.us.us.lcssa)
  %40 = sub nsw i32 %.052.pn.us.us.us, %39
  %41 = tail call i32 @llvm.smax.i32(i32 %40, i32 0)
  %.2.us.us.us = add nuw nsw i32 %41, %.170.us.us.us
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond120.not = icmp eq i64 %indvars.iv.next117, %wide.trip.count
  br i1 %exitcond120.not, label %._crit_edge71.split.us.us.us, label %.preheader.us.us.us, !llvm.loop !19

._crit_edge71.split.us.us.us:                     ; preds = %._crit_edge.us.us.us
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %exitcond125.not = icmp eq i64 %indvars.iv.next122, %wide.trip.count124
  br i1 %exitcond125.not, label %._crit_edge, label %.lr.ph.us.us.preheader, !llvm.loop !20

._crit_edge:                                      ; preds = %._crit_edge71.split.us.us.us, %3
  %.0.lcssa = phi i32 [ 0, %3 ], [ %.2.us.us.us, %._crit_edge71.split.us.us.us ]
  ret i32 %.0.lcssa
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #1

attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) 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 speculatable willreturn memory(none) }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!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, !14, !13}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


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