; 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 }
%"struct.vox::geometry::FdmMatrixRow2" = type { double, double, double }
%"struct.vox::geometry::FdmLinearSystem2" = 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::FdmMatrixRow2, std::allocator<vox::geometry::FdmMatrixRow2>>::_Vector_impl" }
%"struct.std::_Vector_base<vox::geometry::FdmMatrixRow2, std::allocator<vox::geometry::FdmMatrixRow2>>::_Vector_impl" = type { %"struct.std::_Vector_base<vox::geometry::FdmMatrixRow2, std::allocator<vox::geometry::FdmMatrixRow2>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vox::geometry::FdmMatrixRow2, std::allocator<vox::geometry::FdmMatrixRow2>>::_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 @_ZN3vox8geometry16FdmLinearSystem26resizeERKNS0_6MatrixImLm2ELm1EEE(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef nonnull align 8 dereferenceable(16) %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::FdmMatrixRow2", 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::FdmLinearSystem2", ptr %11, i32 0, i32 0
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3vox8geometry6MatrixImLm2ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %13)
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #3
  %14 = getelementptr inbounds %"struct.vox::geometry::FdmMatrixRow2", ptr %6, i32 0, i32 0
  store double 0.000000e+00, ptr %14, align 8, !tbaa !9
  %15 = getelementptr inbounds %"struct.vox::geometry::FdmMatrixRow2", ptr %6, i32 0, i32 1
  store double 0.000000e+00, ptr %15, align 8, !tbaa !12
  %16 = getelementptr inbounds %"struct.vox::geometry::FdmMatrixRow2", ptr %6, i32 0, i32 2
  store double 0.000000e+00, ptr %16, align 8, !tbaa !13
  call void @_ZN3vox8geometry5ArrayINS0_13FdmMatrixRow2ELm2EE6resizeENS0_6MatrixImLm2ELm1EEERKS2_(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef %5, ptr noundef nonnull align 8 dereferenceable(24) %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #3
  %17 = getelementptr inbounds %"struct.vox::geometry::FdmLinearSystem2", ptr %11, i32 0, i32 1
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3vox8geometry6MatrixImLm2ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %18)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  store double 0.000000e+00, ptr %8, align 8, !tbaa !14
  call void @_ZN3vox8geometry5ArrayIdLm2EE6resizeENS0_6MatrixImLm2ELm1EEERKd(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %19 = getelementptr inbounds %"struct.vox::geometry::FdmLinearSystem2", ptr %11, i32 0, i32 2
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3vox8geometry6MatrixImLm2ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store double 0.000000e+00, ptr %10, align 8, !tbaa !14
  call void @_ZN3vox8geometry5ArrayIdLm2EE6resizeENS0_6MatrixImLm2ELm1EEERKd(ptr noundef nonnull align 8 dereferenceable(56) %19, 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_13FdmMatrixRow2ELm2EE6resizeENS0_6MatrixImLm2ELm1EEERKS2_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; 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 #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 @_ZN3vox8geometry5ArrayIdLm2EE6resizeENS0_6MatrixImLm2ELm1EEERKd(ptr noundef nonnull align 8 dereferenceable(56), 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 = !{!"_ZTSN3vox8geometry13FdmMatrixRow2E", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"double", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!10, !11, i64 16}
!14 = !{!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 }
%"struct.vox::geometry::FdmMatrixRow2" = type { double, double, double }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox8geometry16FdmLinearSystem26resizeERKNS0_6MatrixImLm2ELm1EEE(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #0 align 2 {
  %3 = alloca %"class.vox::geometry::Matrix", align 8
  %4 = alloca %"struct.vox::geometry::FdmMatrixRow2", 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 @_ZN3vox8geometry6MatrixImLm2ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, i8 0, i64 24, i1 false)
  call void @_ZN3vox8geometry5ArrayINS0_13FdmMatrixRow2ELm2EE6resizeENS0_6MatrixImLm2ELm1EEERKS2_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  %9 = getelementptr inbounds i8, ptr %0, i64 56
  call void @_ZN3vox8geometry6MatrixImLm2ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %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 @_ZN3vox8geometry5ArrayIdLm2EE6resizeENS0_6MatrixImLm2ELm1EEERKd(ptr noundef nonnull align 8 dereferenceable(56) %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 112
  call void @_ZN3vox8geometry6MatrixImLm2ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %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 @_ZN3vox8geometry5ArrayIdLm2EE6resizeENS0_6MatrixImLm2ELm1EEERKd(ptr noundef nonnull align 8 dereferenceable(56) %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_13FdmMatrixRow2ELm2EE6resizeENS0_6MatrixImLm2ELm1EEERKS2_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; 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 #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 @_ZN3vox8geometry5ArrayIdLm2EE6resizeENS0_6MatrixImLm2ELm1EEERKd(ptr noundef nonnull align 8 dereferenceable(56), 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