; LLVM IR from HarshCasper/NeoAlgo :: C-Plus-Plus/sort/counting_sort.ll (Z9CountSortPxx)

; 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
declare dso_local noundef i32 @_Z3MinPxx(ptr noundef, i64 noundef) #0

; 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: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3MaxPxx(ptr noundef, i64 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9CountSortPxx(ptr noundef %0, i64 noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %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
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = load i64, ptr %4, align 8, !tbaa !9
  %16 = call noundef i32 @_Z3MaxPxx(ptr noundef %14, i64 noundef %15)
  %17 = sext i32 %16 to i64
  store i64 %17, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = load i64, ptr %4, align 8, !tbaa !9
  %20 = call noundef i32 @_Z3MinPxx(ptr noundef %18, i64 noundef %19)
  %21 = sext i32 %20 to i64
  store i64 %21, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %22 = load i64, ptr %5, align 8, !tbaa !9
  %23 = load i64, ptr %6, align 8, !tbaa !9
  %24 = sub nsw i64 %22, %23
  %25 = add nsw i64 %24, 1
  %26 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %25, i64 4)
  %27 = extractvalue { i64, i1 } %26, 1
  %28 = extractvalue { i64, i1 } %26, 0
  %29 = select i1 %27, i64 -1, i64 %28
  %30 = call noalias noundef nonnull ptr @_Znam(i64 noundef %29) #7
  store ptr %30, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %45, %2
  %32 = load i64, ptr %8, align 8, !tbaa !9
  %33 = load i64, ptr %4, align 8, !tbaa !9
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %48

36:                                               ; preds = %31
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = load i64, ptr %8, align 8, !tbaa !9
  %40 = getelementptr inbounds i64, ptr %38, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = load i64, ptr %6, align 8, !tbaa !9
  %43 = sub nsw i64 %41, %42
  %44 = getelementptr inbounds i32, ptr %37, i64 %43
  store i32 0, ptr %44, align 4, !tbaa !11
  br label %45

45:                                               ; preds = %36
  %46 = load i64, ptr %8, align 8, !tbaa !9
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr %8, align 8, !tbaa !9
  br label %31, !llvm.loop !13

48:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %49

49:                                               ; preds = %65, %48
  %50 = load i64, ptr %9, align 8, !tbaa !9
  %51 = load i64, ptr %4, align 8, !tbaa !9
  %52 = icmp slt i64 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %68

54:                                               ; preds = %49
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = load i64, ptr %9, align 8, !tbaa !9
  %58 = getelementptr inbounds i64, ptr %56, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !9
  %60 = load i64, ptr %6, align 8, !tbaa !9
  %61 = sub nsw i64 %59, %60
  %62 = getelementptr inbounds i32, ptr %55, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !11
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %62, align 4, !tbaa !11
  br label %65

65:                                               ; preds = %54
  %66 = load i64, ptr %9, align 8, !tbaa !9
  %67 = add nsw i64 %66, 1
  store i64 %67, ptr %9, align 8, !tbaa !9
  br label %49, !llvm.loop !15

68:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %69 = load i64, ptr %5, align 8, !tbaa !9
  %70 = trunc i64 %69 to i32
  store i32 %70, ptr %11, align 4, !tbaa !11
  br label %71

71:                                               ; preds = %101, %68
  %72 = load i32, ptr %11, align 4, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = load i64, ptr %6, align 8, !tbaa !9
  %75 = icmp sge i64 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %71
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %104

77:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %78

78:                                               ; preds = %97, %77
  %79 = load i32, ptr %13, align 4, !tbaa !11
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = load i32, ptr %11, align 4, !tbaa !11
  %82 = sext i32 %81 to i64
  %83 = load i64, ptr %6, align 8, !tbaa !9
  %84 = sub nsw i64 %82, %83
  %85 = getelementptr inbounds i32, ptr %80, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !11
  %87 = icmp slt i32 %79, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %78
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %100

89:                                               ; preds = %78
  %90 = load i32, ptr %11, align 4, !tbaa !11
  %91 = sext i32 %90 to i64
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = load i32, ptr %10, align 4, !tbaa !11
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %10, align 4, !tbaa !11
  %95 = sext i32 %93 to i64
  %96 = getelementptr inbounds i64, ptr %92, i64 %95
  store i64 %91, ptr %96, align 8, !tbaa !9
  br label %97

97:                                               ; preds = %89
  %98 = load i32, ptr %13, align 4, !tbaa !11
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %13, align 4, !tbaa !11
  br label %78, !llvm.loop !16

100:                                              ; preds = %88
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %11, align 4, !tbaa !11
  %103 = add nsw i32 %102, -1
  store i32 %103, ptr %11, align 4, !tbaa !11
  br label %71, !llvm.loop !17

104:                                              ; preds = %76
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = icmp eq ptr %105, null
  br i1 %106, label %108, label %107

107:                                              ; preds = %104
  call void @_ZdaPv(ptr noundef %105) #8
  br label %108

108:                                              ; preds = %107, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #5

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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nobuiltin 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 #5 = { nobuiltin 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3MinPxx(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3MaxPxx(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9CountSortPxx(ptr noundef %0, i64 noundef %1) local_unnamed_addr #1 {
  %3 = tail call noundef i32 @_Z3MaxPxx(ptr noundef %0, i64 noundef %1)
  %4 = sext i32 %3 to i64
  %5 = tail call noundef i32 @_Z3MinPxx(ptr noundef %0, i64 noundef %1)
  %6 = sext i32 %5 to i64
  %7 = sub nsw i64 %4, %6
  %8 = add nsw i64 %7, 1
  %9 = icmp ugt i64 %8, 4611686018427387903
  %10 = shl nuw nsw i64 %8, 2
  %11 = select i1 %9, i64 -1, i64 %10
  %12 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %11) #4
  %13 = icmp sgt i64 %1, 0
  br i1 %13, label %.lr.ph.preheader, label %.preheader39

.lr.ph.preheader:                                 ; preds = %2
  %xtraiter = and i64 %1, 3
  %14 = icmp ult i64 %1, 4
  br i1 %14, label %.preheader40.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %1, 9223372036854775804
  br label %.lr.ph

.preheader40.unr-lcssa:                           ; preds = %.lr.ph, %.lr.ph.preheader
  %.03541.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %40, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader40, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader40.unr-lcssa, %.lr.ph.epil
  %.03541.epil = phi i64 [ %19, %.lr.ph.epil ], [ %.03541.unr, %.preheader40.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader40.unr-lcssa ]
  %15 = getelementptr inbounds i64, ptr %0, i64 %.03541.epil
  %16 = load i64, ptr %15, align 8, !tbaa !5
  %17 = sub nsw i64 %16, %6
  %18 = getelementptr inbounds i32, ptr %12, i64 %17
  store i32 0, ptr %18, align 4, !tbaa !9
  %19 = add nuw nsw i64 %.03541.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 %.preheader40, label %.lr.ph.epil, !llvm.loop !11

.preheader40:                                     ; preds = %.lr.ph.epil, %.preheader40.unr-lcssa
  br i1 %13, label %.lr.ph43.preheader, label %.preheader39

.lr.ph43.preheader:                               ; preds = %.preheader40
  %xtraiter61 = and i64 %1, 1
  %20 = icmp eq i64 %1, 1
  br i1 %20, label %.preheader39.loopexit.unr-lcssa, label %.lr.ph43.preheader.new

.lr.ph43.preheader.new:                           ; preds = %.lr.ph43.preheader
  %unroll_iter64 = and i64 %1, 9223372036854775806
  br label %.lr.ph43

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.03541 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %40, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %21 = getelementptr inbounds i64, ptr %0, i64 %.03541
  %22 = load i64, ptr %21, align 8, !tbaa !5
  %23 = sub nsw i64 %22, %6
  %24 = getelementptr inbounds i32, ptr %12, i64 %23
  store i32 0, ptr %24, align 4, !tbaa !9
  %25 = or disjoint i64 %.03541, 1
  %26 = getelementptr inbounds i64, ptr %0, i64 %25
  %27 = load i64, ptr %26, align 8, !tbaa !5
  %28 = sub nsw i64 %27, %6
  %29 = getelementptr inbounds i32, ptr %12, i64 %28
  store i32 0, ptr %29, align 4, !tbaa !9
  %30 = or disjoint i64 %.03541, 2
  %31 = getelementptr inbounds i64, ptr %0, i64 %30
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = sub nsw i64 %32, %6
  %34 = getelementptr inbounds i32, ptr %12, i64 %33
  store i32 0, ptr %34, align 4, !tbaa !9
  %35 = or disjoint i64 %.03541, 3
  %36 = getelementptr inbounds i64, ptr %0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = sub nsw i64 %37, %6
  %39 = getelementptr inbounds i32, ptr %12, i64 %38
  store i32 0, ptr %39, align 4, !tbaa !9
  %40 = add nuw nsw i64 %.03541, 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 %.preheader40.unr-lcssa, label %.lr.ph, !llvm.loop !13

.preheader39.loopexit.unr-lcssa:                  ; preds = %.lr.ph43, %.lr.ph43.preheader
  %.03442.unr = phi i64 [ 0, %.lr.ph43.preheader ], [ %60, %.lr.ph43 ]
  %lcmp.mod63.not = icmp eq i64 %xtraiter61, 0
  br i1 %lcmp.mod63.not, label %.preheader39, label %.lr.ph43.epil

.lr.ph43.epil:                                    ; preds = %.preheader39.loopexit.unr-lcssa
  %41 = getelementptr inbounds i64, ptr %0, i64 %.03442.unr
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = sub nsw i64 %42, %6
  %44 = getelementptr inbounds i32, ptr %12, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %44, align 4, !tbaa !9
  br label %.preheader39

.preheader39:                                     ; preds = %.lr.ph43.epil, %.preheader39.loopexit.unr-lcssa, %2, %.preheader40
  %.not47 = icmp slt i32 %3, %5
  br i1 %.not47, label %._crit_edge50, label %.preheader

.lr.ph43:                                         ; preds = %.lr.ph43, %.lr.ph43.preheader.new
  %.03442 = phi i64 [ 0, %.lr.ph43.preheader.new ], [ %60, %.lr.ph43 ]
  %niter65 = phi i64 [ 0, %.lr.ph43.preheader.new ], [ %niter65.next.1, %.lr.ph43 ]
  %47 = getelementptr inbounds i64, ptr %0, i64 %.03442
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = sub nsw i64 %48, %6
  %50 = getelementptr inbounds i32, ptr %12, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %50, align 4, !tbaa !9
  %53 = or disjoint i64 %.03442, 1
  %54 = getelementptr inbounds i64, ptr %0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = sub nsw i64 %55, %6
  %57 = getelementptr inbounds i32, ptr %12, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %57, align 4, !tbaa !9
  %60 = add nuw nsw i64 %.03442, 2
  %niter65.next.1 = add i64 %niter65, 2
  %niter65.ncmp.1 = icmp eq i64 %niter65.next.1, %unroll_iter64
  br i1 %niter65.ncmp.1, label %.preheader39.loopexit.unr-lcssa, label %.lr.ph43, !llvm.loop !15

.preheader:                                       ; preds = %.preheader39, %._crit_edge
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %._crit_edge ], [ %4, %.preheader39 ]
  %.03348 = phi i32 [ %.1.lcssa, %._crit_edge ], [ 0, %.preheader39 ]
  %61 = sub nsw i64 %indvars.iv54, %6
  %62 = getelementptr inbounds i32, ptr %12, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %.lr.ph46.preheader, label %._crit_edge

.lr.ph46.preheader:                               ; preds = %.preheader
  %65 = sext i32 %.03348 to i64
  %66 = zext nneg i32 %63 to i64
  %min.iters.check = icmp ult i32 %63, 4
  br i1 %min.iters.check, label %.lr.ph46.preheader59, label %vector.ph

.lr.ph46.preheader59:                             ; preds = %middle.block, %.lr.ph46.preheader
  %indvars.iv.ph = phi i64 [ %65, %.lr.ph46.preheader ], [ %ind.end, %middle.block ]
  %.045.ph = phi i32 [ 0, %.lr.ph46.preheader ], [ %ind.end57, %middle.block ]
  br label %.lr.ph46

vector.ph:                                        ; preds = %.lr.ph46.preheader
  %n.vec = and i64 %66, 2147483644
  %ind.end = add nsw i64 %n.vec, %65
  %ind.end57 = trunc nuw nsw i64 %n.vec to i32
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %indvars.iv54, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  %invariant.gep = getelementptr i64, ptr %0, i64 %65
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %gep = getelementptr i64, ptr %invariant.gep, i64 %index
  %67 = getelementptr inbounds i8, ptr %gep, i64 16
  store <2 x i64> %broadcast.splat, ptr %gep, align 8, !tbaa !5
  store <2 x i64> %broadcast.splat, ptr %67, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %68 = icmp eq i64 %index.next, %n.vec
  br i1 %68, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %66
  br i1 %cmp.n, label %._crit_edge.loopexit, label %.lr.ph46.preheader59

._crit_edge.loopexit:                             ; preds = %.lr.ph46, %middle.block
  %indvars.iv.next.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next, %.lr.ph46 ]
  %69 = trunc nsw i64 %indvars.iv.next.lcssa to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %.1.lcssa = phi i32 [ %.03348, %.preheader ], [ %69, %._crit_edge.loopexit ]
  %indvars.iv.next55 = add nsw i64 %indvars.iv54, -1
  %.not.not = icmp sgt i64 %indvars.iv54, %6
  br i1 %.not.not, label %.preheader, label %._crit_edge50, !llvm.loop !19

.lr.ph46:                                         ; preds = %.lr.ph46.preheader59, %.lr.ph46
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph46 ], [ %indvars.iv.ph, %.lr.ph46.preheader59 ]
  %.045 = phi i32 [ %71, %.lr.ph46 ], [ %.045.ph, %.lr.ph46.preheader59 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %70 = getelementptr inbounds i64, ptr %0, i64 %indvars.iv
  store i64 %indvars.iv54, ptr %70, align 8, !tbaa !5
  %71 = add nuw nsw i32 %.045, 1
  %exitcond53.not = icmp eq i32 %71, %63
  br i1 %exitcond53.not, label %._crit_edge.loopexit, label %.lr.ph46, !llvm.loop !20

._crit_edge50:                                    ; preds = %._crit_edge, %.preheader39
  tail call void @_ZdaPv(ptr noundef nonnull %12) #5
  ret void
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #3

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nobuiltin 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 = { nobuiltin 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 = { builtin allocsize(0) }
attributes #5 = { builtin 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 = !{!"long long", !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.unroll.disable"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14, !18, !17}


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