; LLVM IR from ippeb/ACM-ICPC :: sorting/radixsort/radixsort.ll (Z9radixsortPii)

; 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 nounwind uwtable
define dso_local void @_Z9radixsortPii(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca [100 x i32], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [10 x i32], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 400, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds i32, ptr %14, i64 0
  %16 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %16, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 1, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %37, %2
  %18 = load i32, ptr %8, align 4, !tbaa !9
  %19 = load i32, ptr %4, align 4, !tbaa !9
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %40

22:                                               ; preds = %17
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds i32, ptr %23, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !9
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = icmp sgt i32 %27, %28
  br i1 %29, label %30, label %36

30:                                               ; preds = %22
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = load i32, ptr %8, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds i32, ptr %31, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !9
  store i32 %35, ptr %6, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %30, %22
  br label %37

37:                                               ; preds = %36
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %8, align 4, !tbaa !9
  br label %17, !llvm.loop !11

40:                                               ; preds = %21
  br label %41

41:                                               ; preds = %135, %40
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = load i32, ptr %7, align 4, !tbaa !9
  %44 = sdiv i32 %42, %43
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %46, label %138

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #3
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 40, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %65, %46
  %48 = load i32, ptr %10, align 4, !tbaa !9
  %49 = load i32, ptr %4, align 4, !tbaa !9
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %68

52:                                               ; preds = %47
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i32, ptr %53, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = load i32, ptr %7, align 4, !tbaa !9
  %59 = sdiv i32 %57, %58
  %60 = srem i32 %59, 10
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [10 x i32], ptr %9, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %62, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %52
  %66 = load i32, ptr %10, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %10, align 4, !tbaa !9
  br label %47, !llvm.loop !13

68:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %84, %68
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = icmp slt i32 %70, 10
  br i1 %71, label %73, label %72

72:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %87

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

84:                                               ; preds = %73
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %11, align 4, !tbaa !9
  br label %69, !llvm.loop !14

87:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %88 = load i32, ptr %4, align 4, !tbaa !9
  %89 = sub nsw i32 %88, 1
  store i32 %89, ptr %12, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %114, %87
  %91 = load i32, ptr %12, align 4, !tbaa !9
  %92 = icmp sge i32 %91, 0
  br i1 %92, label %94, label %93

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

94:                                               ; preds = %90
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = load i32, ptr %12, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i32, ptr %95, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !9
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = load i32, ptr %12, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i32, ptr %100, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !9
  %105 = load i32, ptr %7, align 4, !tbaa !9
  %106 = sdiv i32 %104, %105
  %107 = srem i32 %106, 10
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [10 x i32], ptr %9, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !9
  %111 = add nsw i32 %110, -1
  store i32 %111, ptr %109, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100 x i32], ptr %5, i64 0, i64 %112
  store i32 %99, ptr %113, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %94
  %115 = load i32, ptr %12, align 4, !tbaa !9
  %116 = add nsw i32 %115, -1
  store i32 %116, ptr %12, align 4, !tbaa !9
  br label %90, !llvm.loop !15

117:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %132, %117
  %119 = load i32, ptr %13, align 4, !tbaa !9
  %120 = load i32, ptr %4, align 4, !tbaa !9
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %135

123:                                              ; preds = %118
  %124 = load i32, ptr %13, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100 x i32], ptr %5, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !9
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = load i32, ptr %13, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i32, ptr %128, i64 %130
  store i32 %127, ptr %131, align 4, !tbaa !9
  br label %132

132:                                              ; preds = %123
  %133 = load i32, ptr %13, align 4, !tbaa !9
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %13, align 4, !tbaa !9
  br label %118, !llvm.loop !16

135:                                              ; preds = %122
  %136 = load i32, ptr %7, align 4, !tbaa !9
  %137 = mul nsw i32 %136, 10
  store i32 %137, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #3
  br label %41, !llvm.loop !17

138:                                              ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 400, ptr %5) #3
  ret void
}

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"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}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !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 nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @_Z9radixsortPii(ptr nocapture noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca [100 x i32], align 16
  %4 = alloca [10 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %3) #5
  %5 = load i32, ptr %0, align 4, !tbaa !5
  %6 = icmp sgt i32 %1, 0
  br i1 %6, label %.lr.ph.preheader, label %.preheader45.thread

.lr.ph.preheader:                                 ; preds = %2
  %wide.trip.count = zext nneg i32 %1 to i64
  %min.iters.check = icmp ult i32 %1, 8
  br i1 %min.iters.check, label %.lr.ph.preheader122, label %vector.ph

.lr.ph.preheader122:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %.04046.ph = phi i32 [ %5, %.lr.ph.preheader ], [ %12, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %5, i64 0
  %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %9, %vector.body ]
  %vec.phi119 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %10, %vector.body ]
  %7 = getelementptr inbounds i32, ptr %0, i64 %index
  %8 = getelementptr inbounds i8, ptr %7, i64 16
  %wide.load = load <4 x i32>, ptr %7, align 4, !tbaa !5
  %wide.load120 = load <4 x i32>, ptr %8, align 4, !tbaa !5
  %9 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
  %10 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load120, <4 x i32> %vec.phi119)
  %index.next = add nuw i64 %index, 8
  %11 = icmp eq i64 %index.next, %n.vec
  br i1 %11, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %9, <4 x i32> %10)
  %12 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader45, label %.lr.ph.preheader122

.preheader45:                                     ; preds = %.lr.ph, %middle.block
  %spec.select.lcssa = phi i32 [ %12, %middle.block ], [ %spec.select, %.lr.ph ]
  %13 = icmp sgt i32 %spec.select.lcssa, 0
  br i1 %13, label %.lr.ph56, label %._crit_edge57

.preheader45.thread:                              ; preds = %2
  %14 = icmp sgt i32 %5, 0
  br i1 %14, label %.preheader44.preheader, label %._crit_edge57

.lr.ph56:                                         ; preds = %.preheader45
  br i1 %6, label %.lr.ph56.split.us.preheader, label %.preheader44.preheader

.preheader44.preheader:                           ; preds = %.preheader45.thread, %.lr.ph56
  %.040.lcssa114116 = phi i32 [ %spec.select.lcssa, %.lr.ph56 ], [ %5, %.preheader45.thread ]
  br label %.preheader44

.lr.ph56.split.us.preheader:                      ; preds = %.lr.ph56
  %15 = zext nneg i32 %1 to i64
  %16 = shl nuw nsw i64 %15, 2
  %.phi.trans.insert111 = getelementptr inbounds i8, ptr %4, i64 36
  %.phi.trans.insert109 = getelementptr inbounds i8, ptr %4, i64 32
  %.phi.trans.insert107 = getelementptr inbounds i8, ptr %4, i64 28
  %.phi.trans.insert105 = getelementptr inbounds i8, ptr %4, i64 24
  %.phi.trans.insert103 = getelementptr inbounds i8, ptr %4, i64 20
  %.phi.trans.insert101 = getelementptr inbounds i8, ptr %4, i64 16
  %.phi.trans.insert99 = getelementptr inbounds i8, ptr %4, i64 12
  %.phi.trans.insert97 = getelementptr inbounds i8, ptr %4, i64 8
  %.phi.trans.insert = getelementptr inbounds i8, ptr %4, i64 4
  %17 = getelementptr inbounds i8, ptr %4, i64 4
  %18 = getelementptr inbounds i8, ptr %4, i64 8
  %19 = getelementptr inbounds i8, ptr %4, i64 12
  %20 = getelementptr inbounds i8, ptr %4, i64 16
  %21 = getelementptr inbounds i8, ptr %4, i64 20
  %22 = getelementptr inbounds i8, ptr %4, i64 24
  %23 = getelementptr inbounds i8, ptr %4, i64 28
  %24 = getelementptr inbounds i8, ptr %4, i64 32
  %25 = getelementptr inbounds i8, ptr %4, i64 36
  br label %.lr.ph49.us.preheader

.lr.ph49.us.preheader:                            ; preds = %._crit_edge.us, %.lr.ph56.split.us.preheader
  %.03955.us = phi i32 [ %26, %._crit_edge.us ], [ 1, %.lr.ph56.split.us.preheader ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %4, i8 0, i64 40, i1 false)
  br label %.lr.ph49.us

._crit_edge.us:                                   ; preds = %.preheader43.us
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %0, ptr nonnull align 16 %3, i64 %16, i1 false), !tbaa !5
  %26 = mul nuw nsw i32 %.03955.us, 10
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #5
  %27 = udiv i32 %spec.select.lcssa, %26
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph49.us.preheader, label %._crit_edge57, !llvm.loop !13

.preheader43.us:                                  ; preds = %.preheader44.us, %.preheader43.us
  %indvars.iv90 = phi i64 [ %15, %.preheader44.us ], [ %indvars.iv.next91, %.preheader43.us ]
  %indvars.iv.next91 = add nsw i64 %indvars.iv90, -1
  %29 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next91
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sdiv i32 %30, %.03955.us
  %32 = srem i32 %31, 10
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [10 x i32], ptr %4, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = add nsw i32 %35, -1
  store i32 %36, ptr %34, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %37
  store i32 %30, ptr %38, align 4, !tbaa !5
  %39 = icmp sgt i64 %indvars.iv90, 1
  br i1 %39, label %.preheader43.us, label %._crit_edge.us, !llvm.loop !14

.lr.ph49.us:                                      ; preds = %.lr.ph49.us.preheader, %.lr.ph49.us
  %indvars.iv81 = phi i64 [ 0, %.lr.ph49.us.preheader ], [ %indvars.iv.next82, %.lr.ph49.us ]
  %40 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv81
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sdiv i32 %41, %.03955.us
  %43 = srem i32 %42, 10
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [10 x i32], ptr %4, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %45, align 4, !tbaa !5
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %exitcond85.not = icmp eq i64 %indvars.iv.next82, %15
  br i1 %exitcond85.not, label %.preheader44.us, label %.lr.ph49.us, !llvm.loop !15

.preheader44.us:                                  ; preds = %.lr.ph49.us
  %.pre112 = load i32, ptr %.phi.trans.insert111, align 4, !tbaa !5
  %.pre110 = load i32, ptr %.phi.trans.insert109, align 16, !tbaa !5
  %.pre108 = load i32, ptr %.phi.trans.insert107, align 4, !tbaa !5
  %.pre106 = load i32, ptr %.phi.trans.insert105, align 8, !tbaa !5
  %.pre104 = load i32, ptr %.phi.trans.insert103, align 4, !tbaa !5
  %.pre102 = load i32, ptr %.phi.trans.insert101, align 16, !tbaa !5
  %.pre100 = load i32, ptr %.phi.trans.insert99, align 4, !tbaa !5
  %.pre98 = load i32, ptr %.phi.trans.insert97, align 8, !tbaa !5
  %.pre96 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  %.pre = load i32, ptr %4, align 16, !tbaa !5
  %48 = add nsw i32 %.pre96, %.pre
  store i32 %48, ptr %17, align 4, !tbaa !5
  %49 = add nsw i32 %.pre98, %48
  store i32 %49, ptr %18, align 8, !tbaa !5
  %50 = add nsw i32 %.pre100, %49
  store i32 %50, ptr %19, align 4, !tbaa !5
  %51 = add nsw i32 %.pre102, %50
  store i32 %51, ptr %20, align 16, !tbaa !5
  %52 = add nsw i32 %.pre104, %51
  store i32 %52, ptr %21, align 4, !tbaa !5
  %53 = add nsw i32 %.pre106, %52
  store i32 %53, ptr %22, align 8, !tbaa !5
  %54 = add nsw i32 %.pre108, %53
  store i32 %54, ptr %23, align 4, !tbaa !5
  %55 = add nsw i32 %.pre110, %54
  store i32 %55, ptr %24, align 16, !tbaa !5
  %56 = add nsw i32 %.pre112, %55
  store i32 %56, ptr %25, align 4, !tbaa !5
  br label %.preheader43.us

.lr.ph:                                           ; preds = %.lr.ph.preheader122, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader122 ]
  %.04046 = phi i32 [ %spec.select, %.lr.ph ], [ %.04046.ph, %.lr.ph.preheader122 ]
  %57 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %spec.select = tail call i32 @llvm.smax.i32(i32 %58, i32 %.04046)
  %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 %.preheader45, label %.lr.ph, !llvm.loop !16

.preheader44:                                     ; preds = %.preheader44.preheader, %.preheader44
  %.03955 = phi i32 [ %59, %.preheader44 ], [ 1, %.preheader44.preheader ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #5
  %59 = mul nuw nsw i32 %.03955, 10
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #5
  %60 = udiv i32 %.040.lcssa114116, %59
  %61 = icmp sgt i32 %60, 0
  br i1 %61, label %.preheader44, label %._crit_edge57, !llvm.loop !13

._crit_edge57:                                    ; preds = %.preheader44, %._crit_edge.us, %.preheader45.thread, %.preheader45
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %3) #5
  ret void
}

; 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: mustprogress 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 speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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

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


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