; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/1015_KUPC_2012_practice/D.ll (Z8multiply6matrixS_)

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

%struct.matrix = type { i32, i32, %"class.std::valarray" }
%"class.std::valarray" = type { i64, ptr }
%"class.std::_Expr" = type { %"struct.std::__detail::_BinClos" }
%"struct.std::__detail::_BinClos" = type { %"class.std::__detail::_BinBase" }
%"class.std::__detail::_BinBase" = type { ptr, ptr }
%"class.std::slice_array" = type { i64, i64, %"struct.std::_Array" }
%"struct.std::_Array" = type { ptr }
%"class.std::slice" = type { i64, i64, i64 }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [101 x i8], align 1
@__PRETTY_FUNCTION__._Z8multiply6matrixS_ = external hidden unnamed_addr constant [32 x i8], align 1

; 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: 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 void @_Z8multiply6matrixS_(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 8 %0, ptr noundef %1, ptr noundef %2) #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i1, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::_Expr", align 8
  %13 = alloca %"class.std::valarray", align 8
  %14 = alloca %"class.std::slice_array", align 8
  %15 = alloca %"class.std::slice", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::valarray", align 8
  %19 = alloca %"class.std::slice_array", align 8
  %20 = alloca %"class.std::slice", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.matrix, ptr %1, i32 0, i32 1
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = getelementptr inbounds %struct.matrix, ptr %2, i32 0, i32 0
  %24 = load i32, ptr %23, align 8, !tbaa !14
  %25 = icmp eq i32 %22, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %3
  br label %29

27:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 81, ptr noundef @__PRETTY_FUNCTION__._Z8multiply6matrixS_) #5
  unreachable

28:                                               ; No predecessors!
  br label %29

29:                                               ; preds = %28, %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %30 = getelementptr inbounds %struct.matrix, ptr %1, i32 0, i32 1
  %31 = load i32, ptr %30, align 4, !tbaa !9
  store i32 %31, ptr %7, align 4, !tbaa !15
  store i1 false, ptr %8, align 1
  %32 = getelementptr inbounds %struct.matrix, ptr %1, i32 0, i32 0
  %33 = load i32, ptr %32, align 8, !tbaa !14
  %34 = getelementptr inbounds %struct.matrix, ptr %2, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !9
  call void @_ZN6matrixC2Eii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %33, i32 noundef %35)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !15
  br label %36

36:                                               ; preds = %109, %29
  %37 = load i32, ptr %9, align 4, !tbaa !15
  %38 = getelementptr inbounds %struct.matrix, ptr %0, i32 0, i32 0
  %39 = load i32, ptr %38, align 8, !tbaa !14
  %40 = icmp slt i32 %37, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %36
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %112

42:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !15
  br label %43

43:                                               ; preds = %91, %42
  %44 = load i32, ptr %11, align 4, !tbaa !15
  %45 = getelementptr inbounds %struct.matrix, ptr %0, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = icmp slt i32 %44, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %43
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %108

49:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #6
  %50 = getelementptr inbounds %struct.matrix, ptr %1, i32 0, i32 2
  %51 = load i32, ptr %9, align 4, !tbaa !15
  %52 = getelementptr inbounds %struct.matrix, ptr %1, i32 0, i32 1
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = mul nsw i32 %51, %53
  %55 = sext i32 %54 to i64
  %56 = load i32, ptr %7, align 4, !tbaa !15
  %57 = sext i32 %56 to i64
  invoke void @_ZNSt5sliceC2Emmm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %55, i64 noundef %57, i64 noundef 1)
          to label %58 unwind label %94

58:                                               ; preds = %49
  invoke void @_ZNSt8valarrayIxEixESt5slice(ptr dead_on_unwind writable sret(%"class.std::slice_array") align 8 %14, ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef byval(%"class.std::slice") align 8 %15)
          to label %59 unwind label %94

59:                                               ; preds = %58
  invoke void @_ZNSt8valarrayIxEC2ERKSt11slice_arrayIxE(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %60 unwind label %94

60:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #6
  %61 = getelementptr inbounds %struct.matrix, ptr %2, i32 0, i32 2
  %62 = load i32, ptr %11, align 4, !tbaa !15
  %63 = sext i32 %62 to i64
  %64 = load i32, ptr %7, align 4, !tbaa !15
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.matrix, ptr %2, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  invoke void @_ZNSt5sliceC2Emmm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %63, i64 noundef %65, i64 noundef %68)
          to label %69 unwind label %98

69:                                               ; preds = %60
  invoke void @_ZNSt8valarrayIxEixESt5slice(ptr dead_on_unwind writable sret(%"class.std::slice_array") align 8 %19, ptr noundef nonnull align 8 dereferenceable(16) %61, ptr noundef byval(%"class.std::slice") align 8 %20)
          to label %70 unwind label %98

70:                                               ; preds = %69
  invoke void @_ZNSt8valarrayIxEC2ERKSt11slice_arrayIxE(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %71 unwind label %98

71:                                               ; preds = %70
  %72 = invoke { ptr, ptr } @_ZStmlIxESt5_ExprINSt8__detail8_BinClosISt12__multipliesSt9_ValArrayS4_T_S5_EENSt5__funIS3_S5_E11result_typeEERKSt8valarrayIS5_ESE_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %73 unwind label %102

73:                                               ; preds = %71
  %74 = getelementptr inbounds %"class.std::_Expr", ptr %12, i32 0, i32 0
  %75 = getelementptr inbounds %"struct.std::__detail::_BinClos", ptr %74, i32 0, i32 0
  %76 = getelementptr inbounds { ptr, ptr }, ptr %75, i32 0, i32 0
  %77 = extractvalue { ptr, ptr } %72, 0
  store ptr %77, ptr %76, align 8
  %78 = getelementptr inbounds { ptr, ptr }, ptr %75, i32 0, i32 1
  %79 = extractvalue { ptr, ptr } %72, 1
  store ptr %79, ptr %78, align 8
  %80 = invoke noundef i64 @_ZNKSt5_ExprINSt8__detail8_BinClosISt12__multipliesSt9_ValArrayS3_xxEExE3sumEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %81 unwind label %102

81:                                               ; preds = %73
  %82 = getelementptr inbounds %struct.matrix, ptr %0, i32 0, i32 2
  %83 = load i32, ptr %9, align 4, !tbaa !15
  %84 = getelementptr inbounds %struct.matrix, ptr %0, i32 0, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = mul nsw i32 %83, %85
  %87 = load i32, ptr %11, align 4, !tbaa !15
  %88 = add nsw i32 %86, %87
  %89 = sext i32 %88 to i64
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIxEixEm(ptr noundef nonnull align 8 dereferenceable(16) %82, i64 noundef %89) #6
  store i64 %80, ptr %90, align 8, !tbaa !16
  call void @_ZNSt8valarrayIxED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  call void @_ZNSt8valarrayIxED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  br label %91

91:                                               ; preds = %81
  %92 = load i32, ptr %11, align 4, !tbaa !15
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %11, align 4, !tbaa !15
  br label %43, !llvm.loop !18

94:                                               ; preds = %59, %58, %49
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %16, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %17, align 4
  br label %107

98:                                               ; preds = %70, %69, %60
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %16, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %17, align 4
  br label %106

102:                                              ; preds = %73, %71
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %16, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %17, align 4
  call void @_ZNSt8valarrayIxED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #6
  br label %106

106:                                              ; preds = %102, %98
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  call void @_ZNSt8valarrayIxED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  br label %107

107:                                              ; preds = %106, %94
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %116

108:                                              ; preds = %48
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %9, align 4, !tbaa !15
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %9, align 4, !tbaa !15
  br label %36, !llvm.loop !20

112:                                              ; preds = %41
  store i1 true, ptr %8, align 1
  store i32 1, ptr %10, align 4
  %113 = load i1, ptr %8, align 1
  br i1 %113, label %115, label %114

114:                                              ; preds = %112
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %115

115:                                              ; preds = %114, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  ret void

116:                                              ; preds = %107
  %117 = load ptr, ptr %16, align 8
  %118 = load i32, ptr %17, align 4
  %119 = insertvalue { ptr, i32 } poison, ptr %117, 0
  %120 = insertvalue { ptr, i32 } %119, i32 %118, 1
  resume { ptr, i32 } %120
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6matrixC2Eii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) unnamed_addr #1 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5sliceC2Emmm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef, i64 noundef) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt8valarrayIxEC2ERKSt11slice_arrayIxE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn 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 #3 = { 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 #4 = { 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 #5 = { noreturn nounwind }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 4}
!10 = !{!"_ZTS6matrix", !11, i64 0, !11, i64 4, !12, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt8valarrayIxE", !13, i64 0, !6, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !11, i64 0}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


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

%struct.matrix = type { i32, i32, %"class.std::valarray" }
%"class.std::valarray" = type { i64, ptr }
%"class.std::_Expr" = type { %"struct.std::__detail::_BinClos" }
%"struct.std::__detail::_BinClos" = type { %"class.std::__detail::_BinBase" }
%"class.std::__detail::_BinBase" = type { ptr, ptr }
%"class.std::slice_array" = type { i64, i64, %"struct.std::_Array" }
%"struct.std::_Array" = type { ptr }
%"class.std::slice" = type { i64, i64, i64 }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [101 x i8], align 1
@__PRETTY_FUNCTION__._Z8multiply6matrixS_ = external hidden unnamed_addr constant [32 x i8], align 1

; 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: 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 void @_Z8multiply6matrixS_(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 8 %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::_Expr", align 8
  %5 = alloca %"class.std::valarray", align 8
  %6 = alloca %"class.std::slice_array", align 8
  %7 = alloca %"class.std::slice", align 8
  %8 = alloca %"class.std::valarray", align 8
  %9 = alloca %"class.std::slice_array", align 8
  %10 = alloca %"class.std::slice", align 8
  %11 = getelementptr inbounds i8, ptr %1, i64 4
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = load i32, ptr %2, align 8, !tbaa !13
  %14 = icmp eq i32 %12, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 81, ptr noundef nonnull @__PRETTY_FUNCTION__._Z8multiply6matrixS_) #5
  unreachable

16:                                               ; preds = %3
  %17 = load i32, ptr %1, align 8, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %2, i64 4
  %19 = load i32, ptr %18, align 4, !tbaa !5
  tail call void @_ZN6matrixC2Eii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %17, i32 noundef %19)
  %20 = load i32, ptr %0, align 8, !tbaa !13
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.preheader.lr.ph, label %._crit_edge21

.preheader.lr.ph:                                 ; preds = %16
  %22 = getelementptr inbounds i8, ptr %0, i64 4
  %23 = getelementptr inbounds i8, ptr %1, i64 8
  %24 = sext i32 %12 to i64
  %25 = getelementptr inbounds i8, ptr %2, i64 8
  %26 = getelementptr inbounds i8, ptr %4, i64 8
  %27 = getelementptr inbounds i8, ptr %0, i64 8
  %28 = load i32, ptr %22, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.preheader, label %._crit_edge21

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %30 = phi i32 [ %33, %._crit_edge ], [ %20, %.preheader.lr.ph ]
  %31 = phi i32 [ %34, %._crit_edge ], [ %28, %.preheader.lr.ph ]
  %.01520 = phi i32 [ %35, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %51
  %.pre = load i32, ptr %0, align 8, !tbaa !13
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %33 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %30, %.preheader ]
  %34 = phi i32 [ %58, %._crit_edge.loopexit ], [ %31, %.preheader ]
  %35 = add nuw nsw i32 %.01520, 1
  %36 = icmp slt i32 %35, %33
  br i1 %36, label %.preheader, label %._crit_edge21, !llvm.loop !14

.lr.ph:                                           ; preds = %.preheader, %51
  %indvars.iv = phi i64 [ %indvars.iv.next, %51 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  %37 = load i32, ptr %11, align 4, !tbaa !5
  %38 = mul nsw i32 %37, %.01520
  %39 = sext i32 %38 to i64
  call void @_ZNSt5sliceC2Emmm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %39, i64 noundef %24, i64 noundef 1)
  invoke void @_ZNSt8valarrayIxEixESt5slice(ptr dead_on_unwind nonnull writable sret(%"class.std::slice_array") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull byval(%"class.std::slice") align 8 %7)
          to label %40 unwind label %61

40:                                               ; preds = %.lr.ph
  invoke void @_ZNSt8valarrayIxEC2ERKSt11slice_arrayIxE(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %41 unwind label %61

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  %42 = load i32, ptr %18, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  call void @_ZNSt5sliceC2Emmm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %indvars.iv, i64 noundef %24, i64 noundef %43)
  invoke void @_ZNSt8valarrayIxEixESt5slice(ptr dead_on_unwind nonnull writable sret(%"class.std::slice_array") align 8 %9, ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull byval(%"class.std::slice") align 8 %10)
          to label %44 unwind label %63

44:                                               ; preds = %41
  invoke void @_ZNSt8valarrayIxEC2ERKSt11slice_arrayIxE(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %45 unwind label %63

45:                                               ; preds = %44
  %46 = invoke { ptr, ptr } @_ZStmlIxESt5_ExprINSt8__detail8_BinClosISt12__multipliesSt9_ValArrayS4_T_S5_EENSt5__funIS3_S5_E11result_typeEERKSt8valarrayIS5_ESE_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %47 unwind label %65

47:                                               ; preds = %45
  %48 = extractvalue { ptr, ptr } %46, 0
  store ptr %48, ptr %4, align 8
  %49 = extractvalue { ptr, ptr } %46, 1
  store ptr %49, ptr %26, align 8
  %50 = invoke noundef i64 @_ZNKSt5_ExprINSt8__detail8_BinClosISt12__multipliesSt9_ValArrayS3_xxEExE3sumEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %51 unwind label %65

51:                                               ; preds = %47
  %52 = load i32, ptr %22, align 4, !tbaa !5
  %53 = mul nsw i32 %52, %.01520
  %54 = trunc nuw nsw i64 %indvars.iv to i32
  %55 = add nsw i32 %53, %54
  %56 = sext i32 %55 to i64
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIxEixEm(ptr noundef nonnull align 8 dereferenceable(16) %27, i64 noundef %56) #6
  store i64 %50, ptr %57, align 8, !tbaa !17
  call void @_ZNSt8valarrayIxED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @_ZNSt8valarrayIxED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %58 = load i32, ptr %22, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = icmp slt i64 %indvars.iv.next, %59
  br i1 %60, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !19

61:                                               ; preds = %40, %.lr.ph
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %68

63:                                               ; preds = %44, %41
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %67

65:                                               ; preds = %47, %45
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt8valarrayIxED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  br label %67

67:                                               ; preds = %65, %63
  %.pn = phi { ptr, i32 } [ %66, %65 ], [ %64, %63 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @_ZNSt8valarrayIxED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  br label %68

68:                                               ; preds = %67, %61
  %.pn.pn = phi { ptr, i32 } [ %.pn, %67 ], [ %62, %61 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  call void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  resume { ptr, i32 } %.pn.pn

._crit_edge21:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %16
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6matrixC2Eii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) unnamed_addr #1 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5sliceC2Emmm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef, i64 noundef) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt8valarrayIxEC2ERKSt11slice_arrayIxE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6matrixD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn 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 #3 = { 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 #4 = { 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 #5 = { noreturn nounwind }
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, !7, i64 4}
!6 = !{!"_ZTS6matrix", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt8valarrayIxE", !11, i64 0, !12, i64 8}
!11 = !{!"long", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !7, i64 0}
!14 = distinct !{!14, !15, !16}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = !{!18, !18, i64 0}
!18 = !{!"long long", !8, i64 0}
!19 = distinct !{!19, !15}


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