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

; 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 }

; 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 #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(24) ptr @_ZNK3vox8geometry9ArrayBaseIdLm3ENS0_5ArrayIdLm3EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3vox8geometry9ArrayBaseIdLm3ENS0_5ArrayIdLm3EEEEclIJmmEEERKdmDpT_(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, i64 noundef, i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN3vox8geometry8FdmBlas38lInfNormERKNS0_5ArrayIdLm3EEE(ptr noundef nonnull align 8 dereferenceable(64) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.vox::geometry::Matrix", align 8
  %4 = alloca double, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #4
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3vox8geometry9ArrayBaseIdLm3ENS0_5ArrayIdLm3EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %9)
  call void @_ZN3vox8geometry6MatrixImLm3ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store double 0.000000e+00, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store i64 0, ptr %5, align 8, !tbaa !11
  br label %11

11:                                               ; preds = %48, %1
  %12 = load i64, ptr %5, align 8, !tbaa !11
  %13 = getelementptr inbounds %"class.vox::geometry::Matrix", ptr %3, i32 0, i32 2
  %14 = load i64, ptr %13, align 8, !tbaa !13
  %15 = icmp ult i64 %12, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %11
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %51

17:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i64 0, ptr %7, align 8, !tbaa !11
  br label %18

18:                                               ; preds = %44, %17
  %19 = load i64, ptr %7, align 8, !tbaa !11
  %20 = getelementptr inbounds %"class.vox::geometry::Matrix", ptr %3, i32 0, i32 1
  %21 = load i64, ptr %20, align 8, !tbaa !15
  %22 = icmp ult i64 %19, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %18
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %47

24:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %25

25:                                               ; preds = %40, %24
  %26 = load i64, ptr %8, align 8, !tbaa !11
  %27 = getelementptr inbounds %"class.vox::geometry::Matrix", ptr %3, i32 0, i32 0
  %28 = load i64, ptr %27, align 8, !tbaa !16
  %29 = icmp ult i64 %26, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %25
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %43

31:                                               ; preds = %25
  %32 = load double, ptr %4, align 8, !tbaa !9
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = load i64, ptr %8, align 8, !tbaa !11
  %35 = load i64, ptr %7, align 8, !tbaa !11
  %36 = load i64, ptr %5, align 8, !tbaa !11
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3vox8geometry9ArrayBaseIdLm3ENS0_5ArrayIdLm3EEEEclIJmmEEERKdmDpT_(ptr noundef nonnull align 8 dereferenceable(40) %33, i64 noundef %34, i64 noundef %35, i64 noundef %36)
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = call noundef double @_ZN3vox8geometry6absmaxIdEENSt9enable_ifIXsr3std13is_arithmeticIT_EE5valueES3_E4typeES3_S3_(double noundef %32, double noundef %38)
  store double %39, ptr %4, align 8, !tbaa !9
  br label %40

40:                                               ; preds = %31
  %41 = load i64, ptr %8, align 8, !tbaa !11
  %42 = add i64 %41, 1
  store i64 %42, ptr %8, align 8, !tbaa !11
  br label %25, !llvm.loop !17

43:                                               ; preds = %30
  br label %44

44:                                               ; preds = %43
  %45 = load i64, ptr %7, align 8, !tbaa !11
  %46 = add i64 %45, 1
  store i64 %46, ptr %7, align 8, !tbaa !11
  br label %18, !llvm.loop !19

47:                                               ; preds = %23
  br label %48

48:                                               ; preds = %47
  %49 = load i64, ptr %5, align 8, !tbaa !11
  %50 = add i64 %49, 1
  store i64 %50, ptr %5, align 8, !tbaa !11
  br label %11, !llvm.loop !20

51:                                               ; preds = %16
  %52 = load double, ptr %4, align 8, !tbaa !9
  %53 = call double @llvm.fabs.f64(double %52)
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #4
  ret double %53
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3vox8geometry6absmaxIdEENSt9enable_ifIXsr3std13is_arithmeticIT_EE5valueES3_E4typeES3_S3_(double noundef, double noundef) #0

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 16}
!14 = !{!"_ZTSN3vox8geometry6MatrixImLm3ELm1EEE", !12, i64 0, !12, i64 8, !12, i64 16}
!15 = !{!14, !12, i64 8}
!16 = !{!14, !12, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


; 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 }

; 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 #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(24) ptr @_ZNK3vox8geometry9ArrayBaseIdLm3ENS0_5ArrayIdLm3EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN3vox8geometry8FdmBlas38lInfNormERKNS0_5ArrayIdLm3EEE(ptr noundef nonnull align 8 dereferenceable(64) %0) local_unnamed_addr #2 align 2 {
  %2 = alloca %"class.vox::geometry::Matrix", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #4
  %3 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3vox8geometry9ArrayBaseIdLm3ENS0_5ArrayIdLm3EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  call void @_ZN3vox8geometry6MatrixImLm3ELm1EEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3)
  %4 = getelementptr inbounds i8, ptr %2, i64 16
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %._crit_edge25, label %.preheader15.lr.ph

.preheader15.lr.ph:                               ; preds = %1
  %6 = getelementptr inbounds i8, ptr %2, i64 8
  %7 = load i64, ptr %6, align 8, !tbaa !10
  %.not28 = icmp eq i64 %7, 0
  br i1 %.not28, label %._crit_edge25, label %.preheader15

.preheader15:                                     ; preds = %.preheader15.lr.ph, %._crit_edge20
  %8 = phi i64 [ %15, %._crit_edge20 ], [ %5, %.preheader15.lr.ph ]
  %9 = phi i64 [ %16, %._crit_edge20 ], [ %7, %.preheader15.lr.ph ]
  %10 = phi i64 [ %17, %._crit_edge20 ], [ %7, %.preheader15.lr.ph ]
  %.01323 = phi i64 [ %18, %._crit_edge20 ], [ 0, %.preheader15.lr.ph ]
  %.01422 = phi double [ %.1.lcssa, %._crit_edge20 ], [ 0.000000e+00, %.preheader15.lr.ph ]
  %.not29 = icmp eq i64 %10, 0
  br i1 %.not29, label %._crit_edge20, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader15
  %11 = load i64, ptr %2, align 8, !tbaa !11
  %.not30 = icmp eq i64 %11, 0
  br i1 %.not30, label %._crit_edge20, label %.preheader

._crit_edge25:                                    ; preds = %._crit_edge20, %.preheader15.lr.ph, %1
  %.014.lcssa = phi double [ 0.000000e+00, %1 ], [ 0.000000e+00, %.preheader15.lr.ph ], [ %.1.lcssa, %._crit_edge20 ]
  %12 = call double @llvm.fabs.f64(double %.014.lcssa)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  ret double %12

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %13 = phi i64 [ %20, %._crit_edge ], [ %9, %.preheader.lr.ph ]
  %14 = phi i64 [ %21, %._crit_edge ], [ 1, %.preheader.lr.ph ]
  %.01219 = phi i64 [ %22, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %.118 = phi double [ %.2.lcssa, %._crit_edge ], [ %.01422, %.preheader.lr.ph ]
  %.not31 = icmp eq i64 %14, 0
  br i1 %.not31, label %._crit_edge, label %.lr.ph

._crit_edge20.loopexit32:                         ; preds = %._crit_edge
  %.pre34 = load i64, ptr %4, align 8, !tbaa !5
  br label %._crit_edge20

._crit_edge20:                                    ; preds = %.preheader.lr.ph, %._crit_edge20.loopexit32, %.preheader15
  %15 = phi i64 [ %8, %.preheader15 ], [ %.pre34, %._crit_edge20.loopexit32 ], [ %8, %.preheader.lr.ph ]
  %16 = phi i64 [ %9, %.preheader15 ], [ %20, %._crit_edge20.loopexit32 ], [ %9, %.preheader.lr.ph ]
  %17 = phi i64 [ 0, %.preheader15 ], [ %20, %._crit_edge20.loopexit32 ], [ %10, %.preheader.lr.ph ]
  %.1.lcssa = phi double [ %.01422, %.preheader15 ], [ %.2.lcssa, %._crit_edge20.loopexit32 ], [ %.01422, %.preheader.lr.ph ]
  %18 = add nuw i64 %.01323, 1
  %19 = icmp ult i64 %18, %15
  br i1 %19, label %.preheader15, label %._crit_edge25, !llvm.loop !12

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i64, ptr %6, align 8, !tbaa !10
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %20 = phi i64 [ %13, %.preheader ], [ %.pre, %._crit_edge.loopexit ]
  %21 = phi i64 [ 0, %.preheader ], [ %28, %._crit_edge.loopexit ]
  %.2.lcssa = phi double [ %.118, %.preheader ], [ %26, %._crit_edge.loopexit ]
  %22 = add nuw i64 %.01219, 1
  %23 = icmp ult i64 %22, %20
  br i1 %23, label %.preheader, label %._crit_edge20.loopexit32, !llvm.loop !15

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.017 = phi i64 [ %27, %.lr.ph ], [ 0, %.preheader ]
  %.216 = phi double [ %26, %.lr.ph ], [ %.118, %.preheader ]
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3vox8geometry9ArrayBaseIdLm3ENS0_5ArrayIdLm3EEEEclIJmmEEERKdmDpT_(ptr noundef nonnull align 8 dereferenceable(40) %0, i64 noundef %.017, i64 noundef %.01219, i64 noundef %.01323)
  %25 = load double, ptr %24, align 8, !tbaa !16
  %26 = call noundef double @_ZN3vox8geometry6absmaxIdEENSt9enable_ifIXsr3std13is_arithmeticIT_EE5valueES3_E4typeES3_S3_(double noundef %.216, double noundef %25)
  %27 = add nuw i64 %.017, 1
  %28 = load i64, ptr %2, align 8, !tbaa !11
  %29 = icmp ult i64 %27, %28
  br i1 %29, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !18
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3vox8geometry6absmaxIdEENSt9enable_ifIXsr3std13is_arithmeticIT_EE5valueES3_E4typeES3_S3_(double noundef, double noundef) local_unnamed_addr #0

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

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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 16}
!6 = !{!"_ZTSN3vox8geometry6MatrixImLm3ELm1EEE", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 0}
!12 = distinct !{!12, !13, !14}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !13, !14}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !8, i64 0}
!18 = distinct !{!18, !13}


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