; LLVM IR from moarseniy/CudaFEMproject :: deprecated/Linal2/src/Linal2.ll (ZN6Matrix7inverseERS_ib)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.28 = external hidden unnamed_addr constant [33 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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) #3 align 2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6MatrixaSERKS_(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN6Matrix9transposeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Matrix10Get_matrixEiRS_ii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN6Matrix3detEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Matrix7inverseERS_ib(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2, i1 noundef zeroext %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca %class.Matrix, align 8
  %10 = alloca float, align 4
  %11 = alloca ptr, align 8
  %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 %class.Matrix, align 8
  %18 = alloca %class.Matrix, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  %19 = zext i1 %3 to i8
  store i8 %19, ptr %8, align 1, !tbaa !11
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  %21 = load i32, ptr %7, align 4, !tbaa !9
  %22 = load i32, ptr %7, align 4, !tbaa !9
  call void @_ZN6MatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %21, i32 noundef %22)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = invoke noundef float @_ZN6Matrix3detEi(ptr noundef nonnull align 8 dereferenceable(24) %20, i32 noundef %23)
          to label %25 unwind label %34

25:                                               ; preds = %4
  store float %24, ptr %10, align 4, !tbaa !13
  %26 = load float, ptr %10, align 4, !tbaa !13
  %27 = fcmp une float %26, 0.000000e+00
  br i1 %27, label %28, label %88

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %84, %28
  %30 = load i32, ptr %13, align 4, !tbaa !9
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %38, label %33

33:                                               ; preds = %29
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %87

34:                                               ; preds = %95, %93, %90, %88, %4
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %11, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %12, align 4
  br label %98

38:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %71, %38
  %40 = load i32, ptr %15, align 4, !tbaa !9
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %83

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = sub nsw i32 %45, 1
  store i32 %46, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #6
  %47 = load i32, ptr %16, align 4, !tbaa !9
  %48 = load i32, ptr %16, align 4, !tbaa !9
  invoke void @_ZN6MatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(24) %17, i32 noundef %47, i32 noundef %48)
          to label %49 unwind label %74

49:                                               ; preds = %44
  %50 = load i32, ptr %7, align 4, !tbaa !9
  %51 = load i32, ptr %13, align 4, !tbaa !9
  %52 = load i32, ptr %15, align 4, !tbaa !9
  call void @_ZN6Matrix10Get_matrixEiRS_ii(ptr noundef nonnull align 8 dereferenceable(24) %20, i32 noundef %50, ptr noundef nonnull align 8 dereferenceable(24) %17, i32 noundef %51, i32 noundef %52)
  %53 = load i32, ptr %13, align 4, !tbaa !9
  %54 = load i32, ptr %15, align 4, !tbaa !9
  %55 = add nsw i32 %53, %54
  %56 = add nsw i32 %55, 2
  %57 = invoke noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef -1.000000e+00, i32 noundef %56)
          to label %58 unwind label %78

58:                                               ; preds = %49
  %59 = load i32, ptr %16, align 4, !tbaa !9
  %60 = invoke noundef float @_ZN6Matrix3detEi(ptr noundef nonnull align 8 dereferenceable(24) %17, i32 noundef %59)
          to label %61 unwind label %78

61:                                               ; preds = %58
  %62 = fpext float %60 to double
  %63 = fmul double %57, %62
  %64 = load float, ptr %10, align 4, !tbaa !13
  %65 = fpext float %64 to double
  %66 = fdiv double %63, %65
  %67 = fptrunc double %66 to float
  %68 = load i32, ptr %13, align 4, !tbaa !9
  %69 = load i32, ptr %15, align 4, !tbaa !9
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %68, i32 noundef %69)
  store float %67, ptr %70, align 4, !tbaa !13
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %71

71:                                               ; preds = %61
  %72 = load i32, ptr %15, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %15, align 4, !tbaa !9
  br label %39, !llvm.loop !15

74:                                               ; preds = %44
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %11, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %12, align 4
  br label %82

78:                                               ; preds = %58, %49
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %11, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %12, align 4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  br label %82

82:                                               ; preds = %78, %74
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %98

83:                                               ; preds = %43
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %13, align 4, !tbaa !9
  br label %29, !llvm.loop !17

87:                                               ; preds = %33
  br label %93

88:                                               ; preds = %25
  %89 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.28)
          to label %90 unwind label %34

90:                                               ; preds = %88
  %91 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %92 unwind label %34

92:                                               ; preds = %90
  call void @exit(i32 noundef -1) #7
  unreachable

93:                                               ; preds = %87
  %94 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6Matrix9transposeEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %95 unwind label %34

95:                                               ; preds = %93
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN6MatrixaSERKS_(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %97 unwind label %34

97:                                               ; preds = %95
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  ret void

98:                                               ; preds = %82, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  br label %99

99:                                               ; preds = %98
  %100 = load ptr, ptr %11, align 8
  %101 = load i32, ptr %12, align 4
  %102 = insertvalue { ptr, i32 } poison, ptr %100, 0
  %103 = insertvalue { ptr, i32 } %102, i32 %101, 1
  resume { ptr, i32 } %103
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef, i32 noundef) #5

declare void @_ZN6MatrixC1Eii(ptr, i32, i32)

declare void @_ZN6MatrixD1Ev(ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn 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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.28 = external hidden unnamed_addr constant [33 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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6MatrixaSERKS_(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN6Matrix9transposeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Matrix10Get_matrixEiRS_ii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN6Matrix3detEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Matrix7inverseERS_ib(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2, i1 noundef zeroext %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %class.Matrix, align 8
  %6 = alloca %class.Matrix, align 8
  %7 = alloca %class.Matrix, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZN6MatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %2, i32 noundef %2)
  %8 = invoke noundef float @_ZN6Matrix3detEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %2)
          to label %9 unwind label %31

9:                                                ; preds = %4
  %10 = fcmp une float %8, 0.000000e+00
  br i1 %10, label %.preheader33, label %34

.preheader33:                                     ; preds = %9
  %11 = icmp sgt i32 %2, 0
  br i1 %11, label %.preheader.lr.ph, label %._crit_edge36

.preheader.lr.ph:                                 ; preds = %.preheader33
  %12 = add nsw i32 %2, -1
  %13 = fpext float %8 to double
  br label %.preheader.us

.preheader.us:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph
  %.02635.us = phi i32 [ 0, %.preheader.lr.ph ], [ %27, %._crit_edge.us ]
  %14 = add nuw nsw i32 %.02635.us, 2
  br label %15

15:                                               ; preds = %.preheader.us, %20
  %.02534.us = phi i32 [ 0, %.preheader.us ], [ %26, %20 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  invoke void @_ZN6MatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %12, i32 noundef %12)
          to label %16 unwind label %.split.us

16:                                               ; preds = %15
  call void @_ZN6Matrix10Get_matrixEiRS_ii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %.02635.us, i32 noundef %.02534.us)
  %17 = add nuw nsw i32 %14, %.02534.us
  %18 = call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef -1.000000e+00, i32 noundef %17)
  %19 = invoke noundef float @_ZN6Matrix3detEi(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %12)
          to label %20 unwind label %.split38.us

20:                                               ; preds = %16
  %21 = fpext float %19 to double
  %22 = fmul double %18, %21
  %23 = fdiv double %22, %13
  %24 = fptrunc double %23 to float
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEii(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %.02635.us, i32 noundef %.02534.us)
  store float %24, ptr %25, align 4, !tbaa !5
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  %26 = add nuw nsw i32 %.02534.us, 1
  %exitcond.not = icmp eq i32 %26, %2
  br i1 %exitcond.not, label %._crit_edge.us, label %15, !llvm.loop !9

._crit_edge.us:                                   ; preds = %20
  %27 = add nuw nsw i32 %.02635.us, 1
  %exitcond40.not = icmp eq i32 %27, %2
  br i1 %exitcond40.not, label %._crit_edge36, label %.preheader.us, !llvm.loop !11

.split.us:                                        ; preds = %15
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %33

.split38.us:                                      ; preds = %16
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  br label %33

._crit_edge36:                                    ; preds = %._crit_edge.us, %.preheader33
  %30 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6Matrix9transposeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %39 unwind label %31

31:                                               ; preds = %39, %._crit_edge36, %36, %34, %4
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %41

33:                                               ; preds = %.split38.us, %.split.us
  %.pn = phi { ptr, i32 } [ %29, %.split38.us ], [ %28, %.split.us ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  br label %41

34:                                               ; preds = %9
  %35 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.28)
          to label %36 unwind label %31

36:                                               ; preds = %34
  %37 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %38 unwind label %31

38:                                               ; preds = %36
  call void @exit(i32 noundef -1) #7
  unreachable

39:                                               ; preds = %._crit_edge36
  invoke void @_ZN6MatrixaSERKS_(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %7, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %40 unwind label %31

40:                                               ; preds = %39
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  ret void

41:                                               ; preds = %33, %31
  %.pn.pn = phi { ptr, i32 } [ %.pn, %33 ], [ %32, %31 ]
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef, i32 noundef) local_unnamed_addr #5

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

declare void @_ZN6MatrixD1Ev(ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass