; LLVM IR from sp-nitech/SPTK :: src/math/matrix.ll (ZNK4sptk6Matrix14GetDeterminantEPd)

; 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.sptk::Matrix" = type { ptr, i32, i32, %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<double *, std::allocator<double *>>::_Vector_impl" }
%"struct.std::_Vector_base<double *, std::allocator<double *>>::_Vector_impl" = type { %"struct.std::_Vector_base<double *, std::allocator<double *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double *, std::allocator<double *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; 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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk6Matrix14GetDeterminantEPd(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.sptk::Matrix", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  %18 = getelementptr inbounds %"class.sptk::Matrix", ptr %17, i32 0, i32 1
  %19 = load i32, ptr %18, align 8, !tbaa !9
  %20 = getelementptr inbounds %"class.sptk::Matrix", ptr %17, i32 0, i32 2
  %21 = load i32, ptr %20, align 4, !tbaa !20
  %22 = icmp ne i32 %19, %21
  br i1 %22, label %30, label %23

23:                                               ; preds = %2
  %24 = getelementptr inbounds %"class.sptk::Matrix", ptr %17, i32 0, i32 1
  %25 = load i32, ptr %24, align 8, !tbaa !9
  %26 = icmp sle i32 %25, 0
  br i1 %26, label %30, label %27

27:                                               ; preds = %23
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = icmp eq ptr null, %28
  br i1 %29, label %30, label %31

30:                                               ; preds = %27, %23, %2
  store i1 false, ptr %3, align 1
  br label %148

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %32 = getelementptr inbounds %"class.sptk::Matrix", ptr %17, i32 0, i32 1
  %33 = load i32, ptr %32, align 8, !tbaa !9
  store i32 %33, ptr %6, align 4, !tbaa !21
  %34 = load i32, ptr %6, align 4, !tbaa !21
  %35 = icmp eq i32 1, %34
  br i1 %35, label %36, label %43

36:                                               ; preds = %31
  %37 = getelementptr inbounds %"class.sptk::Matrix", ptr %17, i32 0, i32 4
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %37, i64 noundef 0) #4
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = getelementptr inbounds double, ptr %39, i64 0
  %41 = load double, ptr %40, align 8, !tbaa !22
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  store double %41, ptr %42, align 8, !tbaa !22
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %147

43:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %44 = load i32, ptr %6, align 4, !tbaa !21
  %45 = sub nsw i32 %44, 1
  store i32 %45, ptr %8, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #4
  %46 = load i32, ptr %8, align 4, !tbaa !21
  %47 = load i32, ptr %8, align 4, !tbaa !21
  call void @_ZN4sptk6MatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(64) %9, i32 noundef %46, i32 noundef %47)
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  store double 0.000000e+00, ptr %48, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !21
  br label %49

49:                                               ; preds = %139, %43
  %50 = load i32, ptr %10, align 4, !tbaa !21
  %51 = load i32, ptr %6, align 4, !tbaa !21
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 2, ptr %7, align 4
  br label %142

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !21
  br label %55

55:                                               ; preds = %98, %54
  %56 = load i32, ptr %11, align 4, !tbaa !21
  %57 = load i32, ptr %8, align 4, !tbaa !21
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %101

60:                                               ; preds = %55
  %61 = load i32, ptr %10, align 4, !tbaa !21
  %62 = load i32, ptr %11, align 4, !tbaa !21
  %63 = icmp eq i32 %61, %62
  br i1 %63, label %64, label %65

64:                                               ; preds = %60
  store i32 1, ptr %12, align 4, !tbaa !21
  br label %65

65:                                               ; preds = %64, %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !21
  br label %66

66:                                               ; preds = %90, %65
  %67 = load i32, ptr %13, align 4, !tbaa !21
  %68 = load i32, ptr %8, align 4, !tbaa !21
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %97

71:                                               ; preds = %66
  %72 = getelementptr inbounds %"class.sptk::Matrix", ptr %17, i32 0, i32 4
  %73 = load i32, ptr %11, align 4, !tbaa !21
  %74 = load i32, ptr %12, align 4, !tbaa !21
  %75 = add nsw i32 %73, %74
  %76 = sext i32 %75 to i64
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %72, i64 noundef %76) #4
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  %79 = load i32, ptr %13, align 4, !tbaa !21
  %80 = add nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %78, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !22
  %84 = load i32, ptr %11, align 4, !tbaa !21
  %85 = invoke noundef ptr @_ZN4sptk6MatrixixEi(ptr noundef nonnull align 8 dereferenceable(64) %9, i32 noundef %84)
          to label %86 unwind label %93

86:                                               ; preds = %71
  %87 = load i32, ptr %13, align 4, !tbaa !21
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds double, ptr %85, i64 %88
  store double %83, ptr %89, align 8, !tbaa !22
  br label %90

90:                                               ; preds = %86
  %91 = load i32, ptr %13, align 4, !tbaa !21
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %13, align 4, !tbaa !21
  br label %66, !llvm.loop !24

93:                                               ; preds = %71
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %14, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %144

97:                                               ; preds = %70
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %11, align 4, !tbaa !21
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %11, align 4, !tbaa !21
  br label %55, !llvm.loop !26

101:                                              ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %102 = invoke noundef zeroext i1 @_ZNK4sptk6Matrix14GetDeterminantEPd(ptr noundef nonnull align 8 dereferenceable(64) %9, ptr noundef %16)
          to label %103 unwind label %105

103:                                              ; preds = %101
  br i1 %102, label %109, label %104

104:                                              ; preds = %103
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %136

105:                                              ; preds = %101
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %14, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %144

109:                                              ; preds = %103
  %110 = load i32, ptr %10, align 4, !tbaa !21
  %111 = srem i32 %110, 2
  %112 = icmp eq i32 0, %111
  br i1 %112, label %113, label %121

113:                                              ; preds = %109
  %114 = getelementptr inbounds %"class.sptk::Matrix", ptr %17, i32 0, i32 4
  %115 = load i32, ptr %10, align 4, !tbaa !21
  %116 = sext i32 %115 to i64
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %114, i64 noundef %116) #4
  %118 = load ptr, ptr %117, align 8, !tbaa !5
  %119 = getelementptr inbounds double, ptr %118, i64 0
  %120 = load double, ptr %119, align 8, !tbaa !22
  br label %130

121:                                              ; preds = %109
  %122 = getelementptr inbounds %"class.sptk::Matrix", ptr %17, i32 0, i32 4
  %123 = load i32, ptr %10, align 4, !tbaa !21
  %124 = sext i32 %123 to i64
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %122, i64 noundef %124) #4
  %126 = load ptr, ptr %125, align 8, !tbaa !5
  %127 = getelementptr inbounds double, ptr %126, i64 0
  %128 = load double, ptr %127, align 8, !tbaa !22
  %129 = fneg double %128
  br label %130

130:                                              ; preds = %121, %113
  %131 = phi double [ %120, %113 ], [ %129, %121 ]
  %132 = load double, ptr %16, align 8, !tbaa !22
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = load double, ptr %133, align 8, !tbaa !22
  %135 = call double @llvm.fmuladd.f64(double %131, double %132, double %134)
  store double %135, ptr %133, align 8, !tbaa !22
  store i32 0, ptr %7, align 4
  br label %136

136:                                              ; preds = %130, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %137 = load i32, ptr %7, align 4
  switch i32 %137, label %142 [
    i32 0, label %138
  ]

138:                                              ; preds = %136
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %10, align 4, !tbaa !21
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %10, align 4, !tbaa !21
  br label %49, !llvm.loop !27

142:                                              ; preds = %136, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %143 = load i32, ptr %7, align 4
  switch i32 %143, label %146 [
    i32 2, label %145
  ]

144:                                              ; preds = %105, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @_ZN4sptk6MatrixD2Ev(ptr noundef nonnull align 8 dereferenceable(64) %9) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %150

145:                                              ; preds = %142
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %146

146:                                              ; preds = %145, %142
  call void @_ZN4sptk6MatrixD2Ev(ptr noundef nonnull align 8 dereferenceable(64) %9) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %147

147:                                              ; preds = %146, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %148

148:                                              ; preds = %147, %30
  %149 = load i1, ptr %3, align 1
  ret i1 %149

150:                                              ; preds = %144
  %151 = load ptr, ptr %14, align 8
  %152 = load i32, ptr %15, align 4
  %153 = insertvalue { ptr, i32 } poison, ptr %151, 0
  %154 = insertvalue { ptr, i32 } %153, i32 %152, 1
  resume { ptr, i32 } %154
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4sptk6MatrixixEi(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) #1 align 2

declare void @_ZN4sptk6MatrixC1Eii(ptr, i32, i32)

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 = { 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 8}
!10 = !{!"_ZTSN4sptk6MatrixE", !11, i64 8, !11, i64 12, !12, i64 16, !16, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIdSaIdEE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"_ZTSSt6vectorIPdSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIPdSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPdSaIS0_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIPdSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!10, !11, i64 12}
!21 = !{!11, !11, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"double", !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = distinct !{!27, !25}


; 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.sptk::Matrix" = type { ptr, i32, i32, %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<double *, std::allocator<double *>>::_Vector_impl" }
%"struct.std::_Vector_base<double *, std::allocator<double *>>::_Vector_impl" = type { %"struct.std::_Vector_base<double *, std::allocator<double *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double *, std::allocator<double *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; 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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk6Matrix14GetDeterminantEPd(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.sptk::Matrix", align 8
  %4 = alloca double, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 12
  %8 = load i32, ptr %7, align 4, !tbaa !19
  %.not = icmp eq i32 %6, %8
  br i1 %.not, label %9, label %49

9:                                                ; preds = %2
  %10 = icmp slt i32 %6, 1
  %11 = icmp eq ptr %1, null
  %or.cond = or i1 %11, %10
  br i1 %or.cond, label %49, label %12

12:                                               ; preds = %9
  %13 = icmp eq i32 %6, 1
  br i1 %13, label %14, label %.preheader.us.preheader

14:                                               ; preds = %12
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef 0) #4
  %17 = load ptr, ptr %16, align 8, !tbaa !20
  %18 = load double, ptr %17, align 8, !tbaa !21
  store double %18, ptr %1, align 8, !tbaa !21
  br label %49

.preheader.us.preheader:                          ; preds = %12
  %19 = add nsw i32 %6, -1
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #4
  call void @_ZN4sptk6MatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(64) %3, i32 noundef %19, i32 noundef %19)
  store double 0.000000e+00, ptr %1, align 8, !tbaa !21
  %20 = getelementptr inbounds i8, ptr %0, i64 40
  %21 = zext nneg i32 %6 to i64
  %wide.trip.count69 = zext nneg i32 %6 to i64
  %wide.trip.count = zext i32 %19 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %23
  %indvars.iv67 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next68, %23 ]
  %.not4457.us = phi i1 [ false, %.preheader.us.preheader ], [ %.not44.us, %23 ]
  br label %.lr.ph.us.us

22:                                               ; preds = %._crit_edge54.split.us.us
  br i1 %46, label %23, label %.critedge

23:                                               ; preds = %22
  %24 = and i64 %indvars.iv67, 1
  %25 = icmp eq i64 %24, 0
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %indvars.iv67) #4
  %27 = load ptr, ptr %26, align 8, !tbaa !20
  %28 = load double, ptr %27, align 8, !tbaa !21
  %29 = fneg double %28
  %30 = select i1 %25, double %28, double %29
  %31 = load double, ptr %4, align 8, !tbaa !21
  %32 = load double, ptr %1, align 8, !tbaa !21
  %33 = call double @llvm.fmuladd.f64(double %30, double %31, double %32)
  store double %33, ptr %1, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %.not44.us = icmp uge i64 %indvars.iv.next68, %21
  %exitcond70 = icmp eq i64 %indvars.iv.next68, %wide.trip.count69
  br i1 %exitcond70, label %.critedge46, label %.preheader.us, !llvm.loop !23

.lr.ph.us.us:                                     ; preds = %._crit_edge.us.us, %.preheader.us
  %.03752.us.us = phi i32 [ 0, %.preheader.us ], [ %spec.select.us.us, %._crit_edge.us.us ]
  %.03951.us.us = phi i32 [ 0, %.preheader.us ], [ %45, %._crit_edge.us.us ]
  %34 = zext nneg i32 %.03951.us.us to i64
  %35 = icmp eq i64 %indvars.iv67, %34
  %spec.select.us.us = select i1 %35, i32 1, i32 %.03752.us.us
  %36 = add nsw i32 %spec.select.us.us, %.03951.us.us
  %37 = sext i32 %36 to i64
  br label %38

38:                                               ; preds = %38, %.lr.ph.us.us
  %indvars.iv = phi i64 [ %indvars.iv.next, %38 ], [ 0, %.lr.ph.us.us ]
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %37) #4
  %40 = load ptr, ptr %39, align 8, !tbaa !20
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %41 = getelementptr inbounds double, ptr %40, i64 %indvars.iv.next
  %42 = load double, ptr %41, align 8, !tbaa !21
  %43 = call noundef ptr @_ZN4sptk6MatrixixEi(ptr noundef nonnull align 8 dereferenceable(64) %3, i32 noundef %.03951.us.us)
  %44 = getelementptr inbounds double, ptr %43, i64 %indvars.iv
  store double %42, ptr %44, align 8, !tbaa !21
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us.us, label %38, !llvm.loop !25

._crit_edge.us.us:                                ; preds = %38
  %45 = add nuw nsw i32 %.03951.us.us, 1
  %exitcond66.not = icmp eq i32 %45, %19
  br i1 %exitcond66.not, label %._crit_edge54.split.us.us, label %.lr.ph.us.us, !llvm.loop !26

._crit_edge54.split.us.us:                        ; preds = %._crit_edge.us.us
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %46 = invoke noundef zeroext i1 @_ZNK4sptk6Matrix14GetDeterminantEPd(ptr noundef nonnull align 8 dereferenceable(64) %3, ptr noundef nonnull %4)
          to label %22 unwind label %47

47:                                               ; preds = %._crit_edge54.split.us.us
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @_ZN4sptk6MatrixD2Ev(ptr noundef nonnull align 8 dereferenceable(64) %3) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #4
  resume { ptr, i32 } %48

.critedge:                                        ; preds = %22
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  br label %.critedge46

.critedge46:                                      ; preds = %23, %.critedge
  %.not4449 = phi i1 [ %.not4457.us, %.critedge ], [ %.not44.us, %23 ]
  call void @_ZN4sptk6MatrixD2Ev(ptr noundef nonnull align 8 dereferenceable(64) %3) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #4
  br label %49

49:                                               ; preds = %14, %.critedge46, %2, %9
  %.5 = phi i1 [ false, %9 ], [ false, %2 ], [ true, %14 ], [ %.not4449, %.critedge46 ]
  ret i1 %.5
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4sptk6MatrixixEi(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) local_unnamed_addr #1 align 2

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

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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 = { 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 8}
!6 = !{!"_ZTSN4sptk6MatrixE", !7, i64 8, !7, i64 12, !10, i64 16, !15, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIdSaIdEE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"_ZTSSt6vectorIPdSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIPdSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPdSaIS0_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPdSaIS0_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!19 = !{!6, !7, i64 12}
!20 = !{!14, !14, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !8, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !24}


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