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

; 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, i64 }
%"struct.vox::geometry::FdmMatrixRow3" = type { double, double, double, double }
%"struct.vox::geometry::FdmLinearSystem3" = type { %"class.vox::geometry::Array", %"class.vox::geometry::Array.0", %"class.vox::geometry::Array.0" }
%"class.vox::geometry::Array" = type { %"class.vox::geometry::ArrayBase", %"class.std::vector" }
%"class.vox::geometry::ArrayBase" = type { ptr, ptr, %"class.vox::geometry::Matrix" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<vox::geometry::FdmMatrixRow3, std::allocator<vox::geometry::FdmMatrixRow3>>::_Vector_impl" }
%"struct.std::_Vector_base<vox::geometry::FdmMatrixRow3, std::allocator<vox::geometry::FdmMatrixRow3>>::_Vector_impl" = type { %"struct.std::_Vector_base<vox::geometry::FdmMatrixRow3, std::allocator<vox::geometry::FdmMatrixRow3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vox::geometry::FdmMatrixRow3, std::allocator<vox::geometry::FdmMatrixRow3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.vox::geometry::Array.0" = type { %"class.vox::geometry::ArrayBase.1", %"class.std::vector.2" }
%"class.vox::geometry::ArrayBase.1" = type { ptr, ptr, %"class.vox::geometry::Matrix" }
%"class.std::vector.2" = type { %"struct.std::_Vector_base.3" }
%"struct.std::_Vector_base.3" = 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 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox8geometry16FdmLinearSystem36resizeERKNS0_6MatrixImLm3ELm1EEE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.vox::geometry::Matrix", align 8
  %6 = alloca %"struct.vox::geometry::FdmMatrixRow3", align 8
  %7 = alloca %"class.vox::geometry::Matrix", align 8
  %8 = alloca double, align 8
  %9 = alloca %"class.vox::geometry::Matrix", align 8
  %10 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8
  %12 = getelementptr inbounds %"struct.vox::geometry::FdmLinearSystem3", ptr %11, i32 0, i32 0
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3vox8geometry6MatrixImLm3ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #3
  %14 = getelementptr inbounds %"struct.vox::geometry::FdmMatrixRow3", ptr %6, i32 0, i32 0
  store double 0.000000e+00, ptr %14, align 8, !tbaa !9
  %15 = getelementptr inbounds %"struct.vox::geometry::FdmMatrixRow3", ptr %6, i32 0, i32 1
  store double 0.000000e+00, ptr %15, align 8, !tbaa !12
  %16 = getelementptr inbounds %"struct.vox::geometry::FdmMatrixRow3", ptr %6, i32 0, i32 2
  store double 0.000000e+00, ptr %16, align 8, !tbaa !13
  %17 = getelementptr inbounds %"struct.vox::geometry::FdmMatrixRow3", ptr %6, i32 0, i32 3
  store double 0.000000e+00, ptr %17, align 8, !tbaa !14
  call void @_ZN3vox8geometry5ArrayINS0_13FdmMatrixRow3ELm3EE6resizeENS0_6MatrixImLm3ELm1EEERKS2_(ptr noundef nonnull align 8 dereferenceable(64) %12, ptr noundef %5, ptr noundef nonnull align 8 dereferenceable(32) %6)
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #3
  %18 = getelementptr inbounds %"struct.vox::geometry::FdmLinearSystem3", ptr %11, i32 0, i32 1
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3vox8geometry6MatrixImLm3ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %19)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  store double 0.000000e+00, ptr %8, align 8, !tbaa !15
  call void @_ZN3vox8geometry5ArrayIdLm3EE6resizeENS0_6MatrixImLm3ELm1EEERKd(ptr noundef nonnull align 8 dereferenceable(64) %18, ptr noundef %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %20 = getelementptr inbounds %"struct.vox::geometry::FdmLinearSystem3", ptr %11, i32 0, i32 2
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3vox8geometry6MatrixImLm3ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %21)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store double 0.000000e+00, ptr %10, align 8, !tbaa !15
  call void @_ZN3vox8geometry5ArrayIdLm3EE6resizeENS0_6MatrixImLm3ELm1EEERKd(ptr noundef nonnull align 8 dereferenceable(64) %20, ptr noundef %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox8geometry5ArrayINS0_13FdmMatrixRow3ELm3EE6resizeENS0_6MatrixImLm3ELm1EEERKS2_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox8geometry5ArrayIdLm3EE6resizeENS0_6MatrixImLm3ELm1EEERKd(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

attributes #0 = { 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 #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 willreturn memory(argmem: readwrite) }
attributes #3 = { 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 0}
!10 = !{!"_ZTSN3vox8geometry13FdmMatrixRow3E", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!11 = !{!"double", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!10, !11, i64 16}
!14 = !{!10, !11, i64 24}
!15 = !{!11, !11, i64 0}


; 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, i64 }
%"struct.vox::geometry::FdmMatrixRow3" = type { double, double, double, double }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox8geometry16FdmLinearSystem36resizeERKNS0_6MatrixImLm3ELm1EEE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #0 align 2 {
  %3 = alloca %"class.vox::geometry::Matrix", align 8
  %4 = alloca %"struct.vox::geometry::FdmMatrixRow3", align 8
  %5 = alloca %"class.vox::geometry::Matrix", align 8
  %6 = alloca double, align 8
  %7 = alloca %"class.vox::geometry::Matrix", align 8
  %8 = alloca double, align 8
  call void @_ZN3vox8geometry6MatrixImLm3ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %1)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %4, i8 0, i64 32, i1 false)
  call void @_ZN3vox8geometry5ArrayINS0_13FdmMatrixRow3ELm3EE6resizeENS0_6MatrixImLm3ELm1EEERKS2_(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull %3, ptr noundef nonnull align 8 dereferenceable(32) %4)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  %9 = getelementptr inbounds i8, ptr %0, i64 64
  call void @_ZN3vox8geometry6MatrixImLm3ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  store double 0.000000e+00, ptr %6, align 8, !tbaa !5
  call void @_ZN3vox8geometry5ArrayIdLm3EE6resizeENS0_6MatrixImLm3ELm1EEERKd(ptr noundef nonnull align 8 dereferenceable(64) %9, ptr noundef nonnull %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %10 = getelementptr inbounds i8, ptr %0, i64 128
  call void @_ZN3vox8geometry6MatrixImLm3ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  store double 0.000000e+00, ptr %8, align 8, !tbaa !5
  call void @_ZN3vox8geometry5ArrayIdLm3EE6resizeENS0_6MatrixImLm3ELm1EEERKd(ptr noundef nonnull align 8 dereferenceable(64) %10, ptr noundef nonnull %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox8geometry5ArrayINS0_13FdmMatrixRow3ELm3EE6resizeENS0_6MatrixImLm3ELm1EEERKS2_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox8geometry5ArrayIdLm3EE6resizeENS0_6MatrixImLm3ELm1EEERKd(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

attributes #0 = { 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 #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 willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass