; LLVM IR from Mohammed-Shoaib/Coding-Problems :: HackerRank/Algorithms/Medium/M0016.ll (Z18formingMagicSquareRSt8valarrayIS_IiEE)

; 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::valarray" = type { i64, ptr }
%"class.std::valarray.2" = type { i64, ptr }
%"class.std::_Expr" = type { %"struct.std::__detail::_UnClos" }
%"struct.std::__detail::_UnClos" = type { %"class.std::__detail::_UnBase" }
%"class.std::__detail::_UnBase" = type { %"struct.std::__detail::_BinClos" }
%"struct.std::__detail::_BinClos" = type { %"class.std::__detail::_BinBase" }
%"class.std::__detail::_BinBase" = type { ptr, ptr }
%"class.std::_Expr.4" = type { %"struct.std::__detail::_BinClos" }

@_ZL7squares = external hidden global %"class.std::valarray", align 8

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt8valarrayIiED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z18formingMagicSquareRSt8valarrayIS_IiEE(ptr noundef nonnull align 8 dereferenceable(16) %0) #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::valarray.2", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::valarray.2", align 8
  %9 = alloca %"class.std::_Expr", align 8
  %10 = alloca %"class.std::_Expr.4", align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #5
  call void @_ZNSt8valarrayIiEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %12 = call noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #5
  store i32 %12, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %56, %1
  %14 = load i32, ptr %5, align 4, !tbaa !9
  %15 = sext i32 %14 to i64
  %16 = invoke noundef i64 @_ZNKSt8valarrayIS_IS_IiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) @_ZL7squares)
          to label %17 unwind label %20

17:                                               ; preds = %13
  %18 = icmp ult i64 %15, %16
  br i1 %18, label %24, label %19

19:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %68

20:                                               ; preds = %13
  %21 = landingpad { ptr, i32 }
          cleanup
  %22 = extractvalue { ptr, i32 } %21, 0
  store ptr %22, ptr %6, align 8
  %23 = extractvalue { ptr, i32 } %21, 1
  store i32 %23, ptr %7, align 4
  br label %67

24:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  %25 = load i32, ptr %5, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt8valarrayIS_IS_IiEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) @_ZL7squares, i64 noundef %26) #5
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = invoke { ptr, ptr } @_ZStmiISt8valarrayIiEESt5_ExprINSt8__detail8_BinClosISt7__minusSt9_ValArrayS6_T_S7_EENSt5__funIS5_S7_E11result_typeEERKS0_IS7_ESF_(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %30 unwind label %59

30:                                               ; preds = %24
  %31 = getelementptr inbounds %"class.std::_Expr.4", ptr %10, i32 0, i32 0
  %32 = getelementptr inbounds %"struct.std::__detail::_BinClos", ptr %31, i32 0, i32 0
  %33 = getelementptr inbounds { ptr, ptr }, ptr %32, i32 0, i32 0
  %34 = extractvalue { ptr, ptr } %29, 0
  store ptr %34, ptr %33, align 8
  %35 = getelementptr inbounds { ptr, ptr }, ptr %32, i32 0, i32 1
  %36 = extractvalue { ptr, ptr } %29, 1
  store ptr %36, ptr %35, align 8
  %37 = invoke { ptr, ptr } @_ZSt3absINSt8__detail8_BinClosISt7__minusSt9_ValArrayS3_St8valarrayIiES5_EEESt5_ExprINS0_7_UnClosISt4_AbsS7_T_EENSA_10value_typeEERKS7_ISA_SC_E(ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %38 unwind label %59

38:                                               ; preds = %30
  %39 = getelementptr inbounds %"class.std::_Expr", ptr %9, i32 0, i32 0
  %40 = getelementptr inbounds %"struct.std::__detail::_UnClos", ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds %"class.std::__detail::_UnBase", ptr %40, i32 0, i32 0
  %42 = getelementptr inbounds %"struct.std::__detail::_BinClos", ptr %41, i32 0, i32 0
  %43 = getelementptr inbounds { ptr, ptr }, ptr %42, i32 0, i32 0
  %44 = extractvalue { ptr, ptr } %37, 0
  store ptr %44, ptr %43, align 8
  %45 = getelementptr inbounds { ptr, ptr }, ptr %42, i32 0, i32 1
  %46 = extractvalue { ptr, ptr } %37, 1
  store ptr %46, ptr %45, align 8
  invoke void @_ZNKSt5_ExprINSt8__detail7_UnClosISt4_AbsS_NS0_8_BinClosISt7__minusSt9_ValArrayS5_St8valarrayIiES7_EEEES7_E3sumEv(ptr dead_on_unwind writable sret(%"class.std::valarray.2") align 8 %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %47 unwind label %59

47:                                               ; preds = %38
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt8valarrayIiEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  call void @_ZNSt8valarrayIiED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %49 = call noundef ptr @_ZSt5beginIiEPT_RSt8valarrayIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  %50 = call noundef ptr @_ZSt3endIiEPT_RSt8valarrayIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  %51 = invoke noundef i32 @_ZSt10accumulateIPiiET0_T_S2_S1_(ptr noundef %49, ptr noundef %50, i32 noundef 0)
          to label %52 unwind label %63

52:                                               ; preds = %47
  store i32 %51, ptr %11, align 4, !tbaa !9
  %53 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %54 unwind label %63

54:                                               ; preds = %52
  %55 = load i32, ptr %53, align 4, !tbaa !9
  store i32 %55, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %56

56:                                               ; preds = %54
  %57 = load i32, ptr %5, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %5, align 4, !tbaa !9
  br label %13, !llvm.loop !11

59:                                               ; preds = %38, %30, %24
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %6, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  br label %67

63:                                               ; preds = %52, %47
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %6, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %67

67:                                               ; preds = %63, %59, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @_ZNSt8valarrayIiED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #5
  br label %70

68:                                               ; preds = %19
  %69 = load i32, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @_ZNSt8valarrayIiED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #5
  ret i32 %69

70:                                               ; preds = %67
  %71 = load ptr, ptr %6, align 8
  %72 = load i32, ptr %7, align 4
  %73 = insertvalue { ptr, i32 } poison, ptr %71, 0
  %74 = insertvalue { ptr, i32 } %73, i32 %72, 1
  resume { ptr, i32 } %74
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt8valarrayIiEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt8valarrayIS_IS_IiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, ptr } @_ZSt3absINSt8__detail8_BinClosISt7__minusSt9_ValArrayS3_St8valarrayIiES5_EEESt5_ExprINS0_7_UnClosISt4_AbsS7_T_EENSA_10value_typeEERKS7_ISA_SC_E(ptr noundef nonnull align 8 dereferenceable(16)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, ptr } @_ZStmiISt8valarrayIiEESt5_ExprINSt8__detail8_BinClosISt7__minusSt9_ValArrayS6_T_S7_EENSt5__funIS5_S7_E11result_typeEERKS0_IS7_ESF_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt8valarrayIS_IS_IiEEEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNKSt5_ExprINSt8__detail7_UnClosISt4_AbsS_NS0_8_BinClosISt7__minusSt9_ValArrayS5_St8valarrayIiES7_EEEES7_E3sumEv(ptr dead_on_unwind noalias writable sret(%"class.std::valarray.2") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt8valarrayIiEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZSt10accumulateIPiiET0_T_S2_S1_(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZSt5beginIiEPT_RSt8valarrayIS0_E(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZSt3endIiEPT_RSt8valarrayIS0_E(ptr noundef nonnull align 8 dereferenceable(16)) #1

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


; 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::valarray" = type { i64, ptr }
%"class.std::valarray.2" = type { i64, ptr }
%"class.std::_Expr" = type { %"struct.std::__detail::_UnClos" }
%"struct.std::__detail::_UnClos" = type { %"class.std::__detail::_UnBase" }
%"class.std::__detail::_UnBase" = type { %"struct.std::__detail::_BinClos" }
%"struct.std::__detail::_BinClos" = type { %"class.std::__detail::_BinBase" }
%"class.std::__detail::_BinBase" = type { ptr, ptr }
%"class.std::_Expr.4" = type { %"struct.std::__detail::_BinClos" }

@_ZL7squares = external hidden global %"class.std::valarray", align 8

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt8valarrayIiED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z18formingMagicSquareRSt8valarrayIS_IiEE(ptr noundef nonnull align 8 dereferenceable(16) %0) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::valarray.2", align 8
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::valarray.2", align 8
  %5 = alloca %"class.std::_Expr", align 8
  %6 = alloca %"class.std::_Expr.4", align 8
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  call void @_ZNSt8valarrayIiEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %8 = call noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #5
  store i32 %8, ptr %3, align 4, !tbaa !5
  %9 = call noundef i64 @_ZNKSt8valarrayIS_IS_IiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) @_ZL7squares)
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %10 = getelementptr inbounds i8, ptr %6, i64 8
  %11 = getelementptr inbounds i8, ptr %5, i64 8
  br label %13

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %1
  %12 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %8, %1 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @_ZNSt8valarrayIiED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  ret i32 %12

13:                                               ; preds = %.lr.ph, %23
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %23 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt8valarrayIS_IS_IiEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) @_ZL7squares, i64 noundef %indvars.iv) #5
  %15 = invoke { ptr, ptr } @_ZStmiISt8valarrayIiEESt5_ExprINSt8__detail8_BinClosISt7__minusSt9_ValArrayS6_T_S7_EENSt5__funIS5_S7_E11result_typeEERKS0_IS7_ESF_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %0)
          to label %16 unwind label %32

16:                                               ; preds = %13
  %17 = extractvalue { ptr, ptr } %15, 0
  store ptr %17, ptr %6, align 8
  %18 = extractvalue { ptr, ptr } %15, 1
  store ptr %18, ptr %10, align 8
  %19 = invoke { ptr, ptr } @_ZSt3absINSt8__detail8_BinClosISt7__minusSt9_ValArrayS3_St8valarrayIiES5_EEESt5_ExprINS0_7_UnClosISt4_AbsS7_T_EENSA_10value_typeEERKS7_ISA_SC_E(ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %20 unwind label %32

20:                                               ; preds = %16
  %21 = extractvalue { ptr, ptr } %19, 0
  store ptr %21, ptr %5, align 8
  %22 = extractvalue { ptr, ptr } %19, 1
  store ptr %22, ptr %11, align 8
  invoke void @_ZNKSt5_ExprINSt8__detail7_UnClosISt4_AbsS_NS0_8_BinClosISt7__minusSt9_ValArrayS5_St8valarrayIiES7_EEEES7_E3sumEv(ptr dead_on_unwind nonnull writable sret(%"class.std::valarray.2") align 8 %4, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %23 unwind label %32

23:                                               ; preds = %20
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt8valarrayIiEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  call void @_ZNSt8valarrayIiED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %25 = call noundef ptr @_ZSt5beginIiEPT_RSt8valarrayIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  %26 = call noundef ptr @_ZSt3endIiEPT_RSt8valarrayIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  %27 = call noundef i32 @_ZSt10accumulateIPiiET0_T_S2_S1_(ptr noundef %25, ptr noundef %26, i32 noundef 0)
  store i32 %27, ptr %7, align 4, !tbaa !5
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %29 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %29, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = call noundef i64 @_ZNKSt8valarrayIS_IS_IiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) @_ZL7squares)
  %31 = icmp ugt i64 %30, %indvars.iv.next
  br i1 %31, label %13, label %._crit_edge.loopexit, !llvm.loop !9

32:                                               ; preds = %20, %16, %13
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @_ZNSt8valarrayIiED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  resume { ptr, i32 } %33
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt8valarrayIiEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt8valarrayIS_IS_IiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, ptr } @_ZSt3absINSt8__detail8_BinClosISt7__minusSt9_ValArrayS3_St8valarrayIiES5_EEESt5_ExprINS0_7_UnClosISt4_AbsS7_T_EENSA_10value_typeEERKS7_ISA_SC_E(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, ptr } @_ZStmiISt8valarrayIiEESt5_ExprINSt8__detail8_BinClosISt7__minusSt9_ValArrayS6_T_S7_EENSt5__funIS5_S7_E11result_typeEERKS0_IS7_ESF_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt8valarrayIS_IS_IiEEEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNKSt5_ExprINSt8__detail7_UnClosISt4_AbsS_NS0_8_BinClosISt7__minusSt9_ValArrayS5_St8valarrayIiES7_EEEES7_E3sumEv(ptr dead_on_unwind noalias writable sret(%"class.std::valarray.2") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt8valarrayIiEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZSt10accumulateIPiiET0_T_S2_S1_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZSt5beginIiEPT_RSt8valarrayIS0_E(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZSt3endIiEPT_RSt8valarrayIS0_E(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass