; LLVM IR from yangfengzzz/DigitalVox3 :: vox.geometry (fdm_linear_system2)

; 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.vox::geometry::Matrix" = type { i64, i64 }
%class.anon.16 = type { ptr, ptr, ptr, ptr }

@_ZTISt16invalid_argument = external constant ptr
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3vox8geometry6MatrixImLm2ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox8geometry9ArrayBaseIdLm2ENS0_5ArrayIdLm2EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3vox8geometryneImLm2ELm1ELm2ELm1ENS0_6MatrixImLm2ELm1EEES3_EEbRKNS0_16MatrixExpressionIT_XT0_EXT1_ET4_EERKNS4_IS5_XT2_EXT3_ET5_EE(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) #2

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt16invalid_argumentD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox8geometry8FdmBlas23mvmERKNS0_5ArrayINS0_13FdmMatrixRow2ELm2EEERKNS2_IdLm2EEEPS7_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef %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 %"class.vox::geometry::Matrix", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %class.anon.16, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox8geometry9ArrayBaseINS0_13FdmMatrixRow2ELm2ENS0_5ArrayIS2_Lm2EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  call void @_ZN3vox8geometry6MatrixImLm2ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %12)
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox8geometry9ArrayBaseIdLm2ENS0_5ArrayIdLm2EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %13)
  %15 = call noundef zeroext i1 @_ZN3vox8geometryneImLm2ELm1ELm2ELm1ENS0_6MatrixImLm2ELm1EEES3_EEbRKNS0_16MatrixExpressionIT_XT0_EXT1_ET4_EERKNS4_IS5_XT2_EXT3_ET5_EE(ptr noundef nonnull align 1 dereferenceable(1) %7, ptr noundef nonnull align 1 dereferenceable(1) %14)
  br i1 %15, label %16, label %23

16:                                               ; preds = %3
  %17 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef @.str.3)
          to label %18 unwind label %19

18:                                               ; preds = %16
  call void @__cxa_throw(ptr %17, ptr @_ZTISt16invalid_argument, ptr @_ZNSt16invalid_argumentD1Ev) #6
  unreachable

19:                                               ; preds = %16
  %20 = landingpad { ptr, i32 }
          cleanup
  %21 = extractvalue { ptr, i32 } %20, 0
  store ptr %21, ptr %8, align 8
  %22 = extractvalue { ptr, i32 } %20, 1
  store i32 %22, ptr %9, align 4
  call void @__cxa_free_exception(ptr %17) #5
  br label %41

23:                                               ; preds = %3
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox8geometry9ArrayBaseIdLm2ENS0_5ArrayIdLm2EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %24)
  %26 = call noundef zeroext i1 @_ZN3vox8geometryneImLm2ELm1ELm2ELm1ENS0_6MatrixImLm2ELm1EEES3_EEbRKNS0_16MatrixExpressionIT_XT0_EXT1_ET4_EERKNS4_IS5_XT2_EXT3_ET5_EE(ptr noundef nonnull align 1 dereferenceable(1) %7, ptr noundef nonnull align 1 dereferenceable(1) %25)
  br i1 %26, label %27, label %34

27:                                               ; preds = %23
  %28 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef @.str.2)
          to label %29 unwind label %30

29:                                               ; preds = %27
  call void @__cxa_throw(ptr %28, ptr @_ZTISt16invalid_argument, ptr @_ZNSt16invalid_argumentD1Ev) #6
  unreachable

30:                                               ; preds = %27
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %8, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %9, align 4
  call void @__cxa_free_exception(ptr %28) #5
  br label %41

34:                                               ; preds = %23
  %35 = getelementptr inbounds %class.anon.16, ptr %10, i32 0, i32 0
  store ptr %6, ptr %35, align 8, !tbaa !5
  %36 = getelementptr inbounds %class.anon.16, ptr %10, i32 0, i32 1
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %37, ptr %36, align 8, !tbaa !5
  %38 = getelementptr inbounds %class.anon.16, ptr %10, i32 0, i32 2
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %39, ptr %38, align 8, !tbaa !5
  %40 = getelementptr inbounds %class.anon.16, ptr %10, i32 0, i32 3
  store ptr %7, ptr %40, align 8, !tbaa !5
  call void @"_ZN3vox8geometry20parallelForEachIndexImLm2EZNS0_8FdmBlas23mvmERKNS0_5ArrayINS0_13FdmMatrixRow2ELm2EEERKNS3_IdLm2EEEPS8_E3$_0EEvRKNS0_6MatrixIT_XT0_ELm1EEET1_NS0_15ExecutionPolicyE"(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef byval(%class.anon.16) align 8 %10, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  ret void

41:                                               ; preds = %30, %19
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  br label %42

42:                                               ; preds = %41
  %43 = load ptr, ptr %8, align 8
  %44 = load i32, ptr %9, align 4
  %45 = insertvalue { ptr, i32 } poison, ptr %43, 0
  %46 = insertvalue { ptr, i32 } %45, i32 %44, 1
  resume { ptr, i32 } %46
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox8geometry9ArrayBaseINS0_13FdmMatrixRow2ELm2ENS0_5ArrayIS2_Lm2EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZN3vox8geometry20parallelForEachIndexImLm2EZNS0_8FdmBlas23mvmERKNS0_5ArrayINS0_13FdmMatrixRow2ELm2EEERKNS3_IdLm2EEEPS8_E3$_0EEvRKNS0_6MatrixIT_XT0_ELm1EEET1_NS0_15ExecutionPolicyE"(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef byval(%class.anon.16) align 8, i32 noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn }

!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"}


; 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.vox::geometry::Matrix" = type { i64, i64 }
%class.anon.16 = type { ptr, ptr, ptr, ptr }

@_ZTISt16invalid_argument = external constant ptr
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3vox8geometry6MatrixImLm2ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox8geometry9ArrayBaseIdLm2ENS0_5ArrayIdLm2EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3vox8geometryneImLm2ELm1ELm2ELm1ENS0_6MatrixImLm2ELm1EEES3_EEbRKNS0_16MatrixExpressionIT_XT0_EXT1_ET4_EERKNS4_IS5_XT2_EXT3_ET5_EE(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt16invalid_argumentD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox8geometry8FdmBlas23mvmERKNS0_5ArrayINS0_13FdmMatrixRow2ELm2EEERKNS2_IdLm2EEEPS7_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca %"class.vox::geometry::Matrix", align 8
  %6 = alloca %class.anon.16, align 8
  store ptr %2, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox8geometry9ArrayBaseINS0_13FdmMatrixRow2ELm2ENS0_5ArrayIS2_Lm2EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @_ZN3vox8geometry6MatrixImLm2ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %7)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox8geometry9ArrayBaseIdLm2ENS0_5ArrayIdLm2EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %9 = call noundef zeroext i1 @_ZN3vox8geometryneImLm2ELm1ELm2ELm1ENS0_6MatrixImLm2ELm1EEES3_EEbRKNS0_16MatrixExpressionIT_XT0_EXT1_ET4_EERKNS4_IS5_XT2_EXT3_ET5_EE(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull align 1 dereferenceable(1) %8)
  br i1 %9, label %10, label %15

10:                                               ; preds = %3
  %11 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull @.str.3)
          to label %12 unwind label %13

12:                                               ; preds = %10
  call void @__cxa_throw(ptr nonnull %11, ptr nonnull @_ZTISt16invalid_argument, ptr nonnull @_ZNSt16invalid_argumentD1Ev) #6
  unreachable

13:                                               ; preds = %10
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %27

15:                                               ; preds = %3
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox8geometry9ArrayBaseIdLm2ENS0_5ArrayIdLm2EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
  %17 = call noundef zeroext i1 @_ZN3vox8geometryneImLm2ELm1ELm2ELm1ENS0_6MatrixImLm2ELm1EEES3_EEbRKNS0_16MatrixExpressionIT_XT0_EXT1_ET4_EERKNS4_IS5_XT2_EXT3_ET5_EE(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull align 1 dereferenceable(1) %16)
  br i1 %17, label %18, label %23

18:                                               ; preds = %15
  %19 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull @.str.2)
          to label %20 unwind label %21

20:                                               ; preds = %18
  call void @__cxa_throw(ptr nonnull %19, ptr nonnull @_ZTISt16invalid_argument, ptr nonnull @_ZNSt16invalid_argumentD1Ev) #6
  unreachable

21:                                               ; preds = %18
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %27

23:                                               ; preds = %15
  store ptr %4, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %0, ptr %24, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %1, ptr %25, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr %5, ptr %26, align 8, !tbaa !5
  call void @"_ZN3vox8geometry20parallelForEachIndexImLm2EZNS0_8FdmBlas23mvmERKNS0_5ArrayINS0_13FdmMatrixRow2ELm2EEERKNS3_IdLm2EEEPS8_E3$_0EEvRKNS0_6MatrixIT_XT0_ELm1EEET1_NS0_15ExecutionPolicyE"(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull byval(%class.anon.16) align 8 %6, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  ret void

27:                                               ; preds = %21, %13
  %.sink = phi ptr [ %19, %21 ], [ %11, %13 ]
  %.pn = phi { ptr, i32 } [ %22, %21 ], [ %14, %13 ]
  call void @__cxa_free_exception(ptr %.sink) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3vox8geometry9ArrayBaseINS0_13FdmMatrixRow2ELm2ENS0_5ArrayIS2_Lm2EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZN3vox8geometry20parallelForEachIndexImLm2EZNS0_8FdmBlas23mvmERKNS0_5ArrayINS0_13FdmMatrixRow2ELm2EEERKNS3_IdLm2EEEPS8_E3$_0EEvRKNS0_6MatrixIT_XT0_ELm1EEET1_NS0_15ExecutionPolicyE"(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef byval(%class.anon.16) align 8, i32 noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn }

!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"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass