; LLVM IR from buresjan/optim_lbm :: nomad/ext/sgtelib/src/Matrix.ll (ZN7SGTELIB6Matrix7productERKS0_S2_)

; 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.SGTELIB::Matrix" = type { ptr, %"class.std::__cxx11::basic_string", i32, i32, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str.50 = external hidden unnamed_addr constant [2 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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7SGTELIB6Matrix7productERKS0_S2_(ptr dead_on_unwind noalias writable sret(%"class.SGTELIB::Matrix") align 8 %0, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 8 dereferenceable(56) %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator", align 1
  %10 = alloca ptr, align 8
  %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 ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  store i1 false, ptr %7, align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef @.str.50, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %18 unwind label %55

18:                                               ; preds = %3
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = invoke noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %19)
          to label %21 unwind label %59

21:                                               ; preds = %18
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = invoke noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56) %22)
          to label %24 unwind label %59

24:                                               ; preds = %21
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %20, i32 noundef %23)
          to label %25 unwind label %59

25:                                               ; preds = %24
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %26 = invoke noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
          to label %27 unwind label %64

27:                                               ; preds = %25
  store i32 %26, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %28 = invoke noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
          to label %29 unwind label %68

29:                                               ; preds = %27
  store i32 %28, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = invoke noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56) %30)
          to label %32 unwind label %72

32:                                               ; preds = %29
  store i32 %31, ptr %17, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %128, %32
  %34 = load i32, ptr %12, align 4, !tbaa !9
  %35 = load i32, ptr %15, align 4, !tbaa !9
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %37, label %131

37:                                               ; preds = %33
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %52, %37
  %39 = load i32, ptr %13, align 4, !tbaa !9
  %40 = load i32, ptr %16, align 4, !tbaa !9
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %42, label %76

42:                                               ; preds = %38
  %43 = getelementptr inbounds %"class.SGTELIB::Matrix", ptr %0, i32 0, i32 4
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = load i32, ptr %12, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds ptr, ptr %44, i64 %46
  %48 = load ptr, ptr %47, align 8, !tbaa !5
  %49 = load i32, ptr %13, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds double, ptr %48, i64 %50
  store double 0.000000e+00, ptr %51, align 8, !tbaa !16
  br label %52

52:                                               ; preds = %42
  %53 = load i32, ptr %13, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %13, align 4, !tbaa !9
  br label %38, !llvm.loop !18

55:                                               ; preds = %3
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %10, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %11, align 4
  br label %63

59:                                               ; preds = %24, %21, %18
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %10, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  br label %63

63:                                               ; preds = %59, %55
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  br label %137

64:                                               ; preds = %25
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %10, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %11, align 4
  br label %134

68:                                               ; preds = %27
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %10, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %11, align 4
  br label %133

72:                                               ; preds = %29
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %10, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %133

76:                                               ; preds = %38
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %124, %76
  %78 = load i32, ptr %14, align 4, !tbaa !9
  %79 = load i32, ptr %17, align 4, !tbaa !9
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %81, label %127

81:                                               ; preds = %77
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %120, %81
  %83 = load i32, ptr %13, align 4, !tbaa !9
  %84 = load i32, ptr %16, align 4, !tbaa !9
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %86, label %123

86:                                               ; preds = %82
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %"class.SGTELIB::Matrix", ptr %87, i32 0, i32 4
  %89 = load ptr, ptr %88, align 8, !tbaa !11
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds ptr, ptr %89, i64 %91
  %93 = load ptr, ptr %92, align 8, !tbaa !5
  %94 = load i32, ptr %14, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds double, ptr %93, i64 %95
  %97 = load double, ptr %96, align 8, !tbaa !16
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = getelementptr inbounds %"class.SGTELIB::Matrix", ptr %98, i32 0, i32 4
  %100 = load ptr, ptr %99, align 8, !tbaa !11
  %101 = load i32, ptr %14, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds ptr, ptr %100, i64 %102
  %104 = load ptr, ptr %103, align 8, !tbaa !5
  %105 = load i32, ptr %13, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds double, ptr %104, i64 %106
  %108 = load double, ptr %107, align 8, !tbaa !16
  %109 = getelementptr inbounds %"class.SGTELIB::Matrix", ptr %0, i32 0, i32 4
  %110 = load ptr, ptr %109, align 8, !tbaa !11
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds ptr, ptr %110, i64 %112
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  %115 = load i32, ptr %13, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds double, ptr %114, i64 %116
  %118 = load double, ptr %117, align 8, !tbaa !16
  %119 = call double @llvm.fmuladd.f64(double %97, double %108, double %118)
  store double %119, ptr %117, align 8, !tbaa !16
  br label %120

120:                                              ; preds = %86
  %121 = load i32, ptr %13, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %13, align 4, !tbaa !9
  br label %82, !llvm.loop !20

123:                                              ; preds = %82
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %14, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %14, align 4, !tbaa !9
  br label %77, !llvm.loop !21

127:                                              ; preds = %77
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %12, align 4, !tbaa !9
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %12, align 4, !tbaa !9
  br label %33, !llvm.loop !22

131:                                              ; preds = %33
  store i1 true, ptr %7, align 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %132 = load i1, ptr %7, align 1
  br i1 %132, label %136, label %135

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

134:                                              ; preds = %133, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #5
  br label %137

135:                                              ; preds = %131
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #5
  br label %136

136:                                              ; preds = %135, %131
  ret void

137:                                              ; preds = %134, %63
  %138 = load ptr, ptr %10, align 8
  %139 = load i32, ptr %11, align 4
  %140 = insertvalue { ptr, i32 } poison, ptr %138, 0
  %141 = insertvalue { ptr, i32 } %140, i32 %139, 1
  resume { ptr, i32 } %141
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56)) #3 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

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

declare void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr, ptr, i32, i32)

declare void @_ZN7SGTELIB6MatrixD1Ev(ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!12, !6, i64 48}
!12 = !{!"_ZTSN7SGTELIB6MatrixE", !13, i64 8, !10, i64 40, !10, i64 44, !6, i64 48}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !15, i64 8, !7, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !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"

%"class.SGTELIB::Matrix" = type { ptr, %"class.std::__cxx11::basic_string", i32, i32, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str.50 = external hidden unnamed_addr constant [2 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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7SGTELIB6Matrix7productERKS0_S2_(ptr dead_on_unwind noalias writable sret(%"class.SGTELIB::Matrix") align 8 %0, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 8 dereferenceable(56) %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.50, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %6 unwind label %83

6:                                                ; preds = %3
  %7 = call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %8 = call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56) %2)
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef %7, i32 noundef %8)
          to label %9 unwind label %85

9:                                                ; preds = %6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  %10 = call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %11 = call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %12 = call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %13 = icmp sgt i32 %10, 0
  br i1 %13, label %.preheader34.lr.ph, label %._crit_edge

.preheader34.lr.ph:                               ; preds = %9
  %14 = icmp sgt i32 %11, 0
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  %16 = load ptr, ptr %15, align 8
  %17 = icmp sgt i32 %12, 0
  %18 = getelementptr inbounds i8, ptr %1, i64 48
  %19 = getelementptr inbounds i8, ptr %2, i64 48
  br i1 %17, label %.preheader34.lr.ph.split.us, label %.preheader34.lr.ph.split

.preheader34.lr.ph.split.us:                      ; preds = %.preheader34.lr.ph
  br i1 %14, label %.preheader34.us.us.preheader, label %._crit_edge

.preheader34.us.us.preheader:                     ; preds = %.preheader34.lr.ph.split.us
  %20 = zext nneg i32 %11 to i64
  %21 = shl nuw nsw i64 %20, 3
  %wide.trip.count78 = zext nneg i32 %10 to i64
  %wide.trip.count73 = zext nneg i32 %12 to i64
  %22 = shl nuw nsw i64 %20, 3
  %23 = shl nuw nsw i64 %wide.trip.count73, 3
  %min.iters.check = icmp ult i32 %11, 4
  %n.vec = and i64 %20, 2147483644
  %cmp.n = icmp eq i64 %n.vec, %20
  %xtraiter93 = and i64 %20, 1
  %lcmp.mod94.not = icmp eq i64 %xtraiter93, 0
  %24 = add nsw i64 %20, -1
  br label %.preheader33.us.us

.preheader33.us.us:                               ; preds = %._crit_edge39.split.us.us.us, %.preheader34.us.us.preheader
  %indvars.iv75 = phi i64 [ 0, %.preheader34.us.us.preheader ], [ %indvars.iv.next76, %._crit_edge39.split.us.us.us ]
  %25 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv75
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %26, i8 0, i64 %21, i1 false), !tbaa !9
  %27 = load ptr, ptr %18, align 8
  %28 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv75
  %29 = load ptr, ptr %19, align 8
  %30 = load ptr, ptr %15, align 8
  %31 = getelementptr inbounds ptr, ptr %30, i64 %indvars.iv75
  %32 = load ptr, ptr %28, align 8, !tbaa !5
  %33 = load ptr, ptr %31, align 8, !tbaa !5
  %scevgep = getelementptr i8, ptr %33, i64 %22
  %scevgep82 = getelementptr i8, ptr %32, i64 %23
  %bound0 = icmp ult ptr %33, %scevgep82
  %bound1 = icmp ult ptr %32, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br label %.preheader.us.us.us

.preheader.us.us.us:                              ; preds = %._crit_edge.us.us.us, %.preheader33.us.us
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %._crit_edge.us.us.us ], [ 0, %.preheader33.us.us ]
  %34 = getelementptr inbounds double, ptr %32, i64 %indvars.iv70
  %35 = getelementptr inbounds ptr, ptr %29, i64 %indvars.iv70
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.preheader.us.us.us
  %scevgep83 = getelementptr i8, ptr %36, i64 %22
  %bound084 = icmp ult ptr %33, %scevgep83
  %bound185 = icmp ult ptr %36, %scevgep
  %found.conflict86 = and i1 %bound084, %bound185
  %conflict.rdx = or i1 %found.conflict, %found.conflict86
  br i1 %conflict.rdx, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %37 = load double, ptr %34, align 8, !tbaa !9, !alias.scope !11
  %broadcast.splatinsert90 = insertelement <2 x double> poison, double %37, i64 0
  %broadcast.splat91 = shufflevector <2 x double> %broadcast.splatinsert90, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %38 = getelementptr inbounds double, ptr %36, i64 %index
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %wide.load = load <2 x double>, ptr %38, align 8, !tbaa !9, !alias.scope !14
  %wide.load87 = load <2 x double>, ptr %39, align 8, !tbaa !9, !alias.scope !14
  %40 = getelementptr inbounds double, ptr %33, i64 %index
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %wide.load88 = load <2 x double>, ptr %40, align 8, !tbaa !9, !alias.scope !16, !noalias !18
  %wide.load89 = load <2 x double>, ptr %41, align 8, !tbaa !9, !alias.scope !16, !noalias !18
  %42 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat91, <2 x double> %wide.load, <2 x double> %wide.load88)
  %43 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat91, <2 x double> %wide.load87, <2 x double> %wide.load89)
  store <2 x double> %42, ptr %40, align 8, !tbaa !9, !alias.scope !16, !noalias !18
  store <2 x double> %43, ptr %41, align 8, !tbaa !9, !alias.scope !16, !noalias !18
  %index.next = add nuw i64 %index, 4
  %44 = icmp eq i64 %index.next, %n.vec
  br i1 %44, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.us.us.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.preheader.us.us.us
  %indvars.iv65.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.preheader.us.us.us ], [ %n.vec, %middle.block ]
  br i1 %lcmp.mod94.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %45 = load double, ptr %34, align 8, !tbaa !9
  %46 = getelementptr inbounds double, ptr %36, i64 %indvars.iv65.ph
  %47 = load double, ptr %46, align 8, !tbaa !9
  %48 = getelementptr inbounds double, ptr %33, i64 %indvars.iv65.ph
  %49 = load double, ptr %48, align 8, !tbaa !9
  %50 = call double @llvm.fmuladd.f64(double %45, double %47, double %49)
  store double %50, ptr %48, align 8, !tbaa !9
  %indvars.iv.next66.prol = or disjoint i64 %indvars.iv65.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv65.unr = phi i64 [ %indvars.iv65.ph, %scalar.ph.preheader ], [ %indvars.iv.next66.prol, %scalar.ph.prol ]
  %51 = icmp eq i64 %indvars.iv65.ph, %24
  br i1 %51, label %._crit_edge.us.us.us, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv65 = phi i64 [ %indvars.iv.next66.1, %scalar.ph ], [ %indvars.iv65.unr, %scalar.ph.prol.loopexit ]
  %52 = load double, ptr %34, align 8, !tbaa !9
  %53 = getelementptr inbounds double, ptr %36, i64 %indvars.iv65
  %54 = load double, ptr %53, align 8, !tbaa !9
  %55 = getelementptr inbounds double, ptr %33, i64 %indvars.iv65
  %56 = load double, ptr %55, align 8, !tbaa !9
  %57 = call double @llvm.fmuladd.f64(double %52, double %54, double %56)
  store double %57, ptr %55, align 8, !tbaa !9
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %58 = load double, ptr %34, align 8, !tbaa !9
  %59 = getelementptr inbounds double, ptr %36, i64 %indvars.iv.next66
  %60 = load double, ptr %59, align 8, !tbaa !9
  %61 = getelementptr inbounds double, ptr %33, i64 %indvars.iv.next66
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = call double @llvm.fmuladd.f64(double %58, double %60, double %62)
  store double %63, ptr %61, align 8, !tbaa !9
  %indvars.iv.next66.1 = add nuw nsw i64 %indvars.iv65, 2
  %exitcond69.not.1 = icmp eq i64 %indvars.iv.next66.1, %20
  br i1 %exitcond69.not.1, label %._crit_edge.us.us.us, label %scalar.ph, !llvm.loop !23

._crit_edge.us.us.us:                             ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count73
  br i1 %exitcond74.not, label %._crit_edge39.split.us.us.us, label %.preheader.us.us.us, !llvm.loop !24

._crit_edge39.split.us.us.us:                     ; preds = %._crit_edge.us.us.us
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78
  br i1 %exitcond79.not, label %._crit_edge, label %.preheader33.us.us, !llvm.loop !25

.preheader34.lr.ph.split:                         ; preds = %.preheader34.lr.ph
  br i1 %14, label %.preheader34.us45.preheader, label %._crit_edge

.preheader34.us45.preheader:                      ; preds = %.preheader34.lr.ph.split
  %64 = zext nneg i32 %11 to i64
  %65 = shl nuw nsw i64 %64, 3
  %wide.trip.count = zext nneg i32 %10 to i64
  %xtraiter = and i64 %wide.trip.count, 7
  %66 = icmp ult i32 %10, 8
  br i1 %66, label %._crit_edge.loopexit92.unr-lcssa, label %.preheader34.us45.preheader.new

.preheader34.us45.preheader.new:                  ; preds = %.preheader34.us45.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483640
  br label %.preheader34.us45

.preheader34.us45:                                ; preds = %.preheader34.us45, %.preheader34.us45.preheader.new
  %indvars.iv = phi i64 [ 0, %.preheader34.us45.preheader.new ], [ %indvars.iv.next.7, %.preheader34.us45 ]
  %niter = phi i64 [ 0, %.preheader34.us45.preheader.new ], [ %niter.next.7, %.preheader34.us45 ]
  %67 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %68, i8 0, i64 %65, i1 false), !tbaa !9
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %69 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv.next
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %70, i8 0, i64 %65, i1 false), !tbaa !9
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %71 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv.next.1
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %72, i8 0, i64 %65, i1 false), !tbaa !9
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %73 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv.next.2
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %74, i8 0, i64 %65, i1 false), !tbaa !9
  %indvars.iv.next.3 = or disjoint i64 %indvars.iv, 4
  %75 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv.next.3
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %76, i8 0, i64 %65, i1 false), !tbaa !9
  %indvars.iv.next.4 = or disjoint i64 %indvars.iv, 5
  %77 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv.next.4
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %78, i8 0, i64 %65, i1 false), !tbaa !9
  %indvars.iv.next.5 = or disjoint i64 %indvars.iv, 6
  %79 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv.next.5
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %80, i8 0, i64 %65, i1 false), !tbaa !9
  %indvars.iv.next.6 = or disjoint i64 %indvars.iv, 7
  %81 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv.next.6
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %82, i8 0, i64 %65, i1 false), !tbaa !9
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge.loopexit92.unr-lcssa, label %.preheader34.us45, !llvm.loop !25

83:                                               ; preds = %3
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %87

85:                                               ; preds = %6
  %86 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  br label %87

87:                                               ; preds = %85, %83
  %.pn = phi { ptr, i32 } [ %86, %85 ], [ %84, %83 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn

._crit_edge.loopexit92.unr-lcssa:                 ; preds = %.preheader34.us45, %.preheader34.us45.preheader
  %indvars.iv.unr = phi i64 [ 0, %.preheader34.us45.preheader ], [ %indvars.iv.next.7, %.preheader34.us45 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.preheader34.us45.epil

.preheader34.us45.epil:                           ; preds = %._crit_edge.loopexit92.unr-lcssa, %.preheader34.us45.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.preheader34.us45.epil ], [ %indvars.iv.unr, %._crit_edge.loopexit92.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader34.us45.epil ], [ 0, %._crit_edge.loopexit92.unr-lcssa ]
  %88 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv.epil
  %89 = load ptr, ptr %88, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %89, i8 0, i64 %65, i1 false), !tbaa !9
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.preheader34.us45.epil, !llvm.loop !26

._crit_edge:                                      ; preds = %._crit_edge.loopexit92.unr-lcssa, %.preheader34.us45.epil, %._crit_edge39.split.us.us.us, %.preheader34.lr.ph.split, %.preheader34.lr.ph.split.us, %9
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

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

declare void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr, ptr, i32, i32) local_unnamed_addr

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12}
!12 = distinct !{!12, !13}
!13 = distinct !{!13, !"LVerDomain"}
!14 = !{!15}
!15 = distinct !{!15, !13}
!16 = !{!17}
!17 = distinct !{!17, !13}
!18 = !{!12, !15}
!19 = distinct !{!19, !20, !21, !22}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !20, !21}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !20}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.unroll.disable"}


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