; LLVM IR from ahampriyanshu/algo-ds-101 :: Algorithms/DP (Count_Square_Matrices)

; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::initializer_list" = type { ptr, i64 }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::initializer_list", align 8
  %14 = alloca [3 x i32], align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = zext i32 %19 to i64
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = zext i32 %21 to i64
  %23 = call ptr @llvm.stacksave.p0()
  store ptr %23, ptr %4, align 8
  %24 = mul nuw i64 %20, %22
  %25 = alloca i32, i64 %24, align 16
  store i64 %20, ptr %5, align 8
  store i64 %22, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %50, %0
  %27 = load i32, ptr %7, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %53

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %32

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

36:                                               ; preds = %32
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %49

37:                                               ; preds = %32
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = mul nsw i64 %39, %22
  %41 = getelementptr inbounds i32, ptr %25, i64 %40
  %42 = load i32, ptr %9, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i32, ptr %41, i64 %43
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %44)
  br label %46

46:                                               ; preds = %37
  %47 = load i32, ptr %9, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %9, align 4, !tbaa !5
  br label %32, !llvm.loop !9

49:                                               ; preds = %36
  br label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %7, align 4, !tbaa !5
  br label %26, !llvm.loop !11

53:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %127, %53
  %55 = load i32, ptr %11, align 4, !tbaa !5
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %130

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

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

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

65:                                               ; preds = %60
  %66 = load i32, ptr %11, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = mul nsw i64 %67, %22
  %69 = getelementptr inbounds i32, ptr %25, i64 %68
  %70 = load i32, ptr %12, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i32, ptr %69, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %76

75:                                               ; preds = %65
  br label %123

76:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #5
  %77 = load i32, ptr %11, align 4, !tbaa !5
  %78 = sub nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = mul nsw i64 %79, %22
  %81 = getelementptr inbounds i32, ptr %25, i64 %80
  %82 = load i32, ptr %12, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %81, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  store i32 %85, ptr %14, align 4, !tbaa !5
  %86 = getelementptr inbounds i32, ptr %14, i64 1
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = mul nsw i64 %88, %22
  %90 = getelementptr inbounds i32, ptr %25, i64 %89
  %91 = load i32, ptr %12, align 4, !tbaa !5
  %92 = sub nsw i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i32, ptr %90, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  store i32 %95, ptr %86, align 4, !tbaa !5
  %96 = getelementptr inbounds i32, ptr %14, i64 2
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = sub nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = mul nsw i64 %99, %22
  %101 = getelementptr inbounds i32, ptr %25, i64 %100
  %102 = load i32, ptr %12, align 4, !tbaa !5
  %103 = sub nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i32, ptr %101, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  store i32 %106, ptr %96, align 4, !tbaa !5
  %107 = getelementptr inbounds %"class.std::initializer_list", ptr %13, i32 0, i32 0
  store ptr %14, ptr %107, align 8, !tbaa !12
  %108 = getelementptr inbounds %"class.std::initializer_list", ptr %13, i32 0, i32 1
  store i64 3, ptr %108, align 8, !tbaa !16
  %109 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8
  %111 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 1
  %112 = load i64, ptr %111, align 8
  %113 = call noundef i32 @_ZSt3minIiET_St16initializer_listIS0_E(ptr %110, i64 %112)
  %114 = add nsw i32 %113, 1
  %115 = load i32, ptr %11, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = mul nsw i64 %116, %22
  %118 = getelementptr inbounds i32, ptr %25, i64 %117
  %119 = load i32, ptr %12, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i32, ptr %118, i64 %120
  store i32 %114, ptr %121, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  br label %122

122:                                              ; preds = %76
  br label %123

123:                                              ; preds = %122, %75
  %124 = load i32, ptr %12, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %12, align 4, !tbaa !5
  br label %60, !llvm.loop !17

126:                                              ; preds = %64
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %11, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %11, align 4, !tbaa !5
  br label %54, !llvm.loop !18

130:                                              ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %157, %130
  %132 = load i32, ptr %15, align 4, !tbaa !5
  %133 = load i32, ptr %2, align 4, !tbaa !5
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %160

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

137:                                              ; preds = %153, %136
  %138 = load i32, ptr %16, align 4, !tbaa !5
  %139 = load i32, ptr %3, align 4, !tbaa !5
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %156

142:                                              ; preds = %137
  %143 = load i32, ptr %15, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = mul nsw i64 %144, %22
  %146 = getelementptr inbounds i32, ptr %25, i64 %145
  %147 = load i32, ptr %16, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i32, ptr %146, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = load i32, ptr %10, align 4, !tbaa !5
  %152 = add nsw i32 %151, %150
  store i32 %152, ptr %10, align 4, !tbaa !5
  br label %153

153:                                              ; preds = %142
  %154 = load i32, ptr %16, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %16, align 4, !tbaa !5
  br label %137, !llvm.loop !19

156:                                              ; preds = %141
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %15, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %15, align 4, !tbaa !5
  br label %131, !llvm.loop !20

160:                                              ; preds = %135
  %161 = load i32, ptr %10, align 4, !tbaa !5
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %161)
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %162, ptr noundef @.str)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %164 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %164)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %165 = load i32, ptr %1, align 4
  ret i32 %165
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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 dso_local noundef i32 @_ZSt3minIiET_St16initializer_listIS0_E(ptr, i64) #4

; 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) #2

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

attributes #0 = { mustprogress norecurse 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 = { "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 willreturn }
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 = { 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 = !{!13, !14, i64 0}
!13 = !{!"_ZTSSt16initializer_listIiE", !14, i64 0, !15, i64 8}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!13, !15, i64 8}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [3 x i32], align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = zext i32 %6 to i64
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = zext i32 %8 to i64
  %10 = call ptr @llvm.stacksave.p0()
  %11 = mul nuw i64 %9, %7
  %12 = alloca i32, i64 %11, align 16
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.preheader38.lr.ph, label %._crit_edge52

.preheader38.lr.ph:                               ; preds = %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.preheader38, label %.preheader37

.preheader38:                                     ; preds = %.preheader38.lr.ph, %._crit_edge
  %17 = phi i32 [ %28, %._crit_edge ], [ %13, %.preheader38.lr.ph ]
  %18 = phi i32 [ %29, %._crit_edge ], [ %15, %.preheader38.lr.ph ]
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %._crit_edge ], [ 0, %.preheader38.lr.ph ]
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader38
  %20 = mul nuw nsw i64 %indvars.iv61, %9
  %21 = getelementptr inbounds i32, ptr %12, i64 %20
  br label %32

.preheader37:                                     ; preds = %._crit_edge, %.preheader38.lr.ph
  %22 = phi i32 [ %13, %.preheader38.lr.ph ], [ %28, %._crit_edge ]
  %23 = icmp sgt i32 %22, 1
  br i1 %23, label %.preheader36.lr.ph, label %.preheader35

.preheader36.lr.ph:                               ; preds = %.preheader37
  %24 = getelementptr inbounds i8, ptr %3, i64 4
  %25 = getelementptr inbounds i8, ptr %3, i64 8
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = icmp sgt i32 %26, 1
  br i1 %27, label %.preheader36, label %.preheader.lr.ph

._crit_edge.loopexit:                             ; preds = %32
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader38
  %28 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %17, %.preheader38 ]
  %29 = phi i32 [ %35, %._crit_edge.loopexit ], [ %18, %.preheader38 ]
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %30 = sext i32 %28 to i64
  %31 = icmp slt i64 %indvars.iv.next62, %30
  br i1 %31, label %.preheader38, label %.preheader37, !llvm.loop !9

32:                                               ; preds = %.lr.ph, %32
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %32 ]
  %33 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %33)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = icmp slt i64 %indvars.iv.next, %36
  br i1 %37, label %32, label %._crit_edge.loopexit, !llvm.loop !12

.preheader36:                                     ; preds = %.preheader36.lr.ph, %._crit_edge43
  %38 = phi i32 [ %62, %._crit_edge43 ], [ %22, %.preheader36.lr.ph ]
  %39 = phi i32 [ %63, %._crit_edge43 ], [ %26, %.preheader36.lr.ph ]
  %40 = phi i32 [ %64, %._crit_edge43 ], [ %26, %.preheader36.lr.ph ]
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %._crit_edge43 ], [ 1, %.preheader36.lr.ph ]
  %41 = icmp sgt i32 %40, 1
  br i1 %41, label %.lr.ph42, label %._crit_edge43

.lr.ph42:                                         ; preds = %.preheader36
  %42 = mul nuw nsw i64 %indvars.iv67, %9
  %43 = getelementptr inbounds i32, ptr %12, i64 %42
  %44 = add nsw i64 %indvars.iv67, -1
  %45 = mul nuw nsw i64 %44, %9
  %46 = getelementptr inbounds i32, ptr %12, i64 %45
  br label %67

.preheader35:                                     ; preds = %._crit_edge43, %.preheader37
  %.lcssa = phi i32 [ %22, %.preheader37 ], [ %62, %._crit_edge43 ]
  %47 = icmp sgt i32 %.lcssa, 0
  br i1 %47, label %.preheader.lr.phthread-pre-split, label %._crit_edge52

.preheader.lr.phthread-pre-split:                 ; preds = %.preheader35
  %.pr = load i32, ptr %2, align 4, !tbaa !5
  br label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader36.lr.ph, %.preheader.lr.phthread-pre-split
  %48 = phi i32 [ %.pr, %.preheader.lr.phthread-pre-split ], [ %26, %.preheader36.lr.ph ]
  %.lcssa81 = phi i32 [ %.lcssa, %.preheader.lr.phthread-pre-split ], [ %22, %.preheader36.lr.ph ]
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %.preheader.us.preheader, label %._crit_edge52

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %wide.trip.count76 = zext nneg i32 %.lcssa81 to i64
  %wide.trip.count = zext nneg i32 %48 to i64
  %min.iters.check = icmp ult i32 %48, 8
  %n.vec = and i64 %wide.trip.count, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge48.us
  %indvars.iv73 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next74, %._crit_edge48.us ]
  %.03350.us = phi i32 [ 0, %.preheader.us.preheader ], [ %.lcssa89, %._crit_edge48.us ]
  %50 = mul nuw nsw i64 %indvars.iv73, %9
  %51 = getelementptr inbounds i32, ptr %12, i64 %50
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.preheader.us
  %52 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.03350.us, i64 0
  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> [ %52, %vector.ph ], [ %55, %vector.body ]
  %vec.phi94 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %56, %vector.body ]
  %53 = getelementptr inbounds i32, ptr %51, i64 %index
  %54 = getelementptr inbounds i8, ptr %53, i64 16
  %wide.load = load <4 x i32>, ptr %53, align 4, !tbaa !5
  %wide.load95 = load <4 x i32>, ptr %54, align 4, !tbaa !5
  %55 = add <4 x i32> %wide.load, %vec.phi
  %56 = add <4 x i32> %wide.load95, %vec.phi94
  %index.next = add nuw i64 %index, 8
  %57 = icmp eq i64 %index.next, %n.vec
  br i1 %57, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %56, %55
  %58 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br i1 %cmp.n, label %._crit_edge48.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader.us
  %indvars.iv70.ph = phi i64 [ 0, %.preheader.us ], [ %n.vec, %middle.block ]
  %.145.us.ph = phi i32 [ %.03350.us, %.preheader.us ], [ %58, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %scalar.ph ], [ %indvars.iv70.ph, %scalar.ph.preheader ]
  %.145.us = phi i32 [ %61, %scalar.ph ], [ %.145.us.ph, %scalar.ph.preheader ]
  %59 = getelementptr inbounds i32, ptr %51, i64 %indvars.iv70
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %60, %.145.us
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge48.us, label %scalar.ph, !llvm.loop !16

._crit_edge48.us:                                 ; preds = %scalar.ph, %middle.block
  %.lcssa89 = phi i32 [ %58, %middle.block ], [ %61, %scalar.ph ]
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count76
  br i1 %exitcond77.not, label %._crit_edge52, label %.preheader.us, !llvm.loop !17

._crit_edge43.loopexit:                           ; preds = %82
  %.pre79 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge43

._crit_edge43:                                    ; preds = %._crit_edge43.loopexit, %.preheader36
  %62 = phi i32 [ %.pre79, %._crit_edge43.loopexit ], [ %38, %.preheader36 ]
  %63 = phi i32 [ %83, %._crit_edge43.loopexit ], [ %39, %.preheader36 ]
  %64 = phi i32 [ %83, %._crit_edge43.loopexit ], [ %40, %.preheader36 ]
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %65 = sext i32 %62 to i64
  %66 = icmp slt i64 %indvars.iv.next68, %65
  br i1 %66, label %.preheader36, label %.preheader35, !llvm.loop !18

67:                                               ; preds = %.lr.ph42, %82
  %68 = phi i32 [ %39, %.lr.ph42 ], [ %83, %82 ]
  %indvars.iv64 = phi i64 [ 1, %.lr.ph42 ], [ %indvars.iv.next65, %82 ]
  %69 = getelementptr inbounds i32, ptr %43, i64 %indvars.iv64
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %82, label %72

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #6
  %73 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv64
  %74 = load i32, ptr %73, align 4, !tbaa !5
  store i32 %74, ptr %3, align 4, !tbaa !5
  %75 = add nsw i64 %indvars.iv64, -1
  %76 = getelementptr inbounds i32, ptr %43, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  store i32 %77, ptr %24, align 4, !tbaa !5
  %78 = getelementptr inbounds i32, ptr %46, i64 %75
  %79 = load i32, ptr %78, align 4, !tbaa !5
  store i32 %79, ptr %25, align 4, !tbaa !5
  %80 = call noundef i32 @_ZSt3minIiET_St16initializer_listIS0_E(ptr nonnull %3, i64 3)
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %69, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #6
  %.pre78 = load i32, ptr %2, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %67, %72
  %83 = phi i32 [ %68, %67 ], [ %.pre78, %72 ]
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %84 = sext i32 %83 to i64
  %85 = icmp slt i64 %indvars.iv.next65, %84
  br i1 %85, label %67, label %._crit_edge43.loopexit, !llvm.loop !19

._crit_edge52:                                    ; preds = %._crit_edge48.us, %0, %.preheader.lr.ph, %.preheader35
  %.033.lcssa = phi i32 [ 0, %.preheader35 ], [ 0, %.preheader.lr.ph ], [ 0, %0 ], [ %.lcssa89, %._crit_edge48.us ]
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.033.lcssa)
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef nonnull @.str)
  call void @llvm.stackrestore.p0(ptr %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZSt3minIiET_St16initializer_listIS0_E(ptr, i64) local_unnamed_addr #4

; 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 #4

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

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

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

attributes #0 = { mustprogress norecurse 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 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !11}
!19 = distinct !{!19, !10}


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