; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 04. Arrays/distribute_n_candies_k_kids.ll (Z7candiesii)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

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

24:                                               ; preds = %50, %2
  %25 = load i32, ptr %9, align 4, !tbaa !5
  %26 = load i32, ptr %10, align 4, !tbaa !5
  %27 = icmp sle i32 %25, %26
  br i1 %27, label %28, label %51

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %29 = load i32, ptr %9, align 4, !tbaa !5
  %30 = load i32, ptr %10, align 4, !tbaa !5
  %31 = add nsw i32 %29, %30
  %32 = ashr i32 %31, 1
  store i32 %32, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %33 = load i32, ptr %11, align 4, !tbaa !5
  %34 = load i32, ptr %11, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  %36 = mul nsw i32 %33, %35
  %37 = ashr i32 %36, 1
  store i32 %37, ptr %12, align 4, !tbaa !5
  %38 = load i32, ptr %12, align 4, !tbaa !5
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %41, label %47

41:                                               ; preds = %28
  %42 = load i32, ptr %11, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sdiv i32 %42, %43
  store i32 %44, ptr %5, align 4, !tbaa !5
  %45 = load i32, ptr %11, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %9, align 4, !tbaa !5
  br label %50

47:                                               ; preds = %28
  %48 = load i32, ptr %11, align 4, !tbaa !5
  %49 = sub nsw i32 %48, 1
  store i32 %49, ptr %10, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %47, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %24, !llvm.loop !9

51:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = mul nsw i32 %52, %53
  store i32 %54, ptr %13, align 4, !tbaa !5
  %55 = load i32, ptr %13, align 4, !tbaa !5
  %56 = load i32, ptr %13, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  %58 = mul nsw i32 %55, %57
  %59 = sdiv i32 %58, 2
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = sub nsw i32 %60, %59
  store i32 %61, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = mul nsw i32 %62, %63
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %15, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %91, %51
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %92

69:                                               ; preds = %66
  %70 = load i32, ptr %15, align 4, !tbaa !5
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = icmp sle i32 %70, %71
  br i1 %72, label %73, label %84

73:                                               ; preds = %69
  %74 = load i32, ptr %15, align 4, !tbaa !5
  %75 = load i32, ptr %14, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %14, align 4, !tbaa !5
  %77 = sext i32 %75 to i64
  %78 = getelementptr inbounds i32, ptr %21, i64 %77
  store i32 %74, ptr %78, align 4, !tbaa !5
  %79 = load i32, ptr %15, align 4, !tbaa !5
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = sub nsw i32 %80, %79
  store i32 %81, ptr %3, align 4, !tbaa !5
  %82 = load i32, ptr %15, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %15, align 4, !tbaa !5
  br label %91

84:                                               ; preds = %69
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = load i32, ptr %14, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr %21, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = add nsw i32 %89, %85
  store i32 %90, ptr %88, align 4, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %84, %73
  br label %66, !llvm.loop !11

92:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %116, %92
  %94 = load i32, ptr %16, align 4, !tbaa !5
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %119

98:                                               ; preds = %93
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = load i32, ptr %16, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  %102 = mul nsw i32 %99, %101
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = sub nsw i32 %105, 1
  %107 = mul nsw i32 %104, %106
  %108 = mul nsw i32 %103, %107
  %109 = sdiv i32 %108, 2
  %110 = add nsw i32 %102, %109
  %111 = load i32, ptr %16, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr %21, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = add nsw i32 %114, %110
  store i32 %115, ptr %113, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %98
  %117 = load i32, ptr %16, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %16, align 4, !tbaa !5
  br label %93, !llvm.loop !12

119:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %132, %119
  %121 = load i32, ptr %17, align 4, !tbaa !5
  %122 = load i32, ptr %4, align 4, !tbaa !5
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %135

125:                                              ; preds = %120
  %126 = load i32, ptr %17, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i32, ptr %21, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %129)
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %130, ptr noundef @.str)
  br label %132

132:                                              ; preds = %125
  %133 = load i32, ptr %17, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %17, align 4, !tbaa !5
  br label %120, !llvm.loop !13

135:                                              ; preds = %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %136 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %136)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  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
declare ptr @llvm.stacksave.p0() #2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5

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

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

!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}


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7candiesii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = zext i32 %1 to i64
  %4 = alloca i32, i64 %3, align 16
  %5 = shl nuw nsw i64 %3, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %4, i8 0, i64 %5, i1 false)
  %.not62 = icmp slt i32 %0, 0
  br i1 %.not62, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2, %15
  %.05065 = phi i32 [ %.151, %15 ], [ 0, %2 ]
  %.05264 = phi i32 [ %.153, %15 ], [ 0, %2 ]
  %.05463 = phi i32 [ %.155, %15 ], [ %0, %2 ]
  %6 = add nuw nsw i32 %.05264, %.05463
  %7 = lshr i32 %6, 1
  %8 = add nuw nsw i32 %7, 1
  %9 = mul nuw nsw i32 %8, %7
  %10 = lshr i32 %9, 1
  %.not60 = icmp sgt i32 %10, %0
  br i1 %.not60, label %13, label %11

11:                                               ; preds = %.lr.ph
  %12 = sdiv i32 %7, %1
  br label %15

13:                                               ; preds = %.lr.ph
  %14 = add nsw i32 %7, -1
  br label %15

15:                                               ; preds = %13, %11
  %.155 = phi i32 [ %.05463, %11 ], [ %14, %13 ]
  %.153 = phi i32 [ %8, %11 ], [ %.05264, %13 ]
  %.151 = phi i32 [ %12, %11 ], [ %.05065, %13 ]
  %.not = icmp sgt i32 %.153, %.155
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

._crit_edge:                                      ; preds = %15, %2
  %.050.lcssa = phi i32 [ 0, %2 ], [ %.151, %15 ]
  %16 = mul i32 %.050.lcssa, %1
  %17 = add nsw i32 %16, 1
  %18 = mul nsw i32 %17, %16
  %.neg = sdiv i32 %18, -2
  %19 = add i32 %.neg, %0
  %.not5866 = icmp eq i32 %19, 0
  br i1 %.not5866, label %.preheader61, label %.lr.ph71

.preheader61:                                     ; preds = %41, %.thread, %._crit_edge
  %20 = icmp sgt i32 %1, 0
  br i1 %20, label %.lr.ph73, label %._crit_edge76

.lr.ph73:                                         ; preds = %.preheader61
  %21 = add nsw i32 %.050.lcssa, -1
  %22 = mul i32 %16, %21
  %23 = sdiv i32 %22, 2
  %min.iters.check = icmp ult i32 %1, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph73
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph73 ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph73
  %n.vec = and i64 %3, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.050.lcssa, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert93 = insertelement <4 x i32> poison, i32 %23, i64 0
  %broadcast.splat94 = shufflevector <4 x i32> %broadcast.splatinsert93, <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.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %24 = getelementptr inbounds i32, ptr %4, i64 %index
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  %wide.load = load <4 x i32>, ptr %24, align 16, !tbaa !7
  %wide.load92 = load <4 x i32>, ptr %25, align 16, !tbaa !7
  %26 = trunc <4 x i64> %vec.ind to <4 x i32>
  %27 = add <4 x i32> %26, <i32 1, i32 1, i32 1, i32 1>
  %28 = trunc <4 x i64> %vec.ind to <4 x i32>
  %29 = add <4 x i32> %28, <i32 5, i32 5, i32 5, i32 5>
  %30 = mul <4 x i32> %broadcast.splat, %27
  %31 = mul <4 x i32> %broadcast.splat, %29
  %32 = add <4 x i32> %30, %broadcast.splat94
  %33 = add <4 x i32> %31, %broadcast.splat94
  %34 = add nsw <4 x i32> %32, %wide.load
  %35 = add nsw <4 x i32> %33, %wide.load92
  store <4 x i32> %34, ptr %24, align 16, !tbaa !7
  store <4 x i32> %35, ptr %25, align 16, !tbaa !7
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %36 = icmp eq i64 %index.next, %n.vec
  br i1 %36, label %middle.block, label %vector.body, !llvm.loop !11

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

.lr.ph71:                                         ; preds = %._crit_edge, %41
  %.04569 = phi i32 [ %46, %41 ], [ %17, %._crit_edge ]
  %.04668 = phi i32 [ %42, %41 ], [ 0, %._crit_edge ]
  %.04867 = phi i32 [ %45, %41 ], [ %19, %._crit_edge ]
  %.not59 = icmp sgt i32 %.04569, %.04867
  br i1 %.not59, label %.thread, label %41

.thread:                                          ; preds = %.lr.ph71
  %37 = zext nneg i32 %.04668 to i64
  %38 = getelementptr inbounds i32, ptr %4, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !7
  %40 = add nsw i32 %39, %.04867
  store i32 %40, ptr %38, align 4, !tbaa !7
  br label %.preheader61

41:                                               ; preds = %.lr.ph71
  %42 = add nuw nsw i32 %.04668, 1
  %43 = zext nneg i32 %.04668 to i64
  %44 = getelementptr inbounds i32, ptr %4, i64 %43
  store i32 %.04569, ptr %44, align 4, !tbaa !7
  %45 = sub nsw i32 %.04867, %.04569
  %46 = add nsw i32 %.04569, 1
  %.not58 = icmp eq i32 %45, 0
  br i1 %.not58, label %.preheader61, label %.lr.ph71, !llvm.loop !14

.preheader:                                       ; preds = %scalar.ph, %middle.block
  br i1 %20, label %.lr.ph75, label %._crit_edge76

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %47 = getelementptr inbounds i32, ptr %4, i64 %indvars.iv
  %48 = load i32, ptr %47, align 4, !tbaa !7
  %49 = trunc i64 %indvars.iv.next to i32
  %50 = mul i32 %.050.lcssa, %49
  %51 = add i32 %50, %23
  %52 = add nsw i32 %51, %48
  store i32 %52, ptr %47, align 4, !tbaa !7
  %exitcond.not = icmp eq i64 %indvars.iv.next, %3
  br i1 %exitcond.not, label %.preheader, label %scalar.ph, !llvm.loop !15

._crit_edge76:                                    ; preds = %.lr.ph75, %.preheader61, %.preheader
  ret void

.lr.ph75:                                         ; preds = %.preheader, %.lr.ph75
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %.lr.ph75 ], [ 0, %.preheader ]
  %53 = getelementptr inbounds i32, ptr %4, i64 %indvars.iv78
  %54 = load i32, ptr %53, align 4, !tbaa !7
  %55 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %54)
  %56 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull @.str)
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next79, %3
  br i1 %exitcond82.not, label %._crit_edge76, label %.lr.ph75, !llvm.loop !16
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { inlinehint 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 = { "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" }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6, !13, !12}
!16 = distinct !{!16, !6}


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