; LLVM IR from Dimandragon/non-parametric-dsp :: alglib-cpp/src (linalg)

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

%"struct.alglib_impl::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%union.anon.1 = type { ptr }
%"struct.alglib_impl::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }
%"struct.alglib_impl::matinvreport" = type { i64, double, double }

@.str.505 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.506 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.507 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.508 = external hidden unnamed_addr constant [53 x i8], align 1

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

declare void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl15rmatrixtrrcond1EPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl17rmatrixtrrcondinfEPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16rmatrixtrinverseEPNS_9ae_matrixElbbPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %4, ptr noundef %5) #3 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"struct.alglib_impl::ae_frame", align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca %"struct.alglib_impl::ae_vector", align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  %18 = zext i1 %2 to i8
  store i8 %18, ptr %9, align 1, !tbaa !11
  %19 = zext i1 %3 to i8
  store i8 %19, ptr %10, align 1, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #4
  %20 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %20, ptr noundef %13)
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 64, i1 false)
  %21 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %21)
  %22 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %16, i64 noundef 0, i64 noundef 3, ptr noundef %22, i1 noundef zeroext true)
  %23 = load i64, ptr %8, align 8, !tbaa !9
  %24 = icmp sgt i64 %23, 0
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %24, ptr noundef @.str.505, ptr noundef %25)
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %26, i32 0, i32 1
  %28 = load i64, ptr %27, align 8, !tbaa !13
  %29 = load i64, ptr %8, align 8, !tbaa !9
  %30 = icmp sge i64 %28, %29
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %30, ptr noundef @.str.506, ptr noundef %31)
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %32, i32 0, i32 0
  %34 = load i64, ptr %33, align 8, !tbaa !16
  %35 = load i64, ptr %8, align 8, !tbaa !9
  %36 = icmp sge i64 %34, %35
  %37 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %36, ptr noundef @.str.507, ptr noundef %37)
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = load i64, ptr %8, align 8, !tbaa !9
  %40 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %41 = trunc i8 %40 to i1
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = call noundef zeroext i1 @_ZN11alglib_impl17isfinitertrmatrixEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef %38, i64 noundef %39, i1 noundef zeroext %41, ptr noundef %42)
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %43, ptr noundef @.str.508, ptr noundef %44)
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %45, i32 0, i32 0
  store i64 1, ptr %46, align 8, !tbaa !19
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = load i64, ptr %8, align 8, !tbaa !9
  %49 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %50 = trunc i8 %49 to i1
  %51 = load i8, ptr %10, align 1, !tbaa !11, !range !17, !noundef !18
  %52 = trunc i8 %51 to i1
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = call noundef double @_ZN11alglib_impl15rmatrixtrrcond1EPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef %47, i64 noundef %48, i1 noundef zeroext %50, i1 noundef zeroext %52, ptr noundef %53)
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %55, i32 0, i32 1
  store double %54, ptr %56, align 8, !tbaa !22
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = load i64, ptr %8, align 8, !tbaa !9
  %59 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %60 = trunc i8 %59 to i1
  %61 = load i8, ptr %10, align 1, !tbaa !11, !range !17, !noundef !18
  %62 = trunc i8 %61 to i1
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = call noundef double @_ZN11alglib_impl17rmatrixtrrcondinfEPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef %57, i64 noundef %58, i1 noundef zeroext %60, i1 noundef zeroext %62, ptr noundef %63)
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %65, i32 0, i32 2
  store double %64, ptr %66, align 8, !tbaa !23
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %67, i32 0, i32 1
  %69 = load double, ptr %68, align 8, !tbaa !22
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %70)
  %72 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %69, double noundef %71)
  br i1 %72, label %80, label %73

73:                                               ; preds = %6
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %74, i32 0, i32 2
  %76 = load double, ptr %75, align 8, !tbaa !23
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %77)
  %79 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %76, double noundef %78)
  br i1 %79, label %80, label %116

80:                                               ; preds = %73, %6
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %81

81:                                               ; preds = %105, %80
  %82 = load i64, ptr %14, align 8, !tbaa !9
  %83 = load i64, ptr %8, align 8, !tbaa !9
  %84 = sub nsw i64 %83, 1
  %85 = icmp sle i64 %82, %84
  br i1 %85, label %86, label %108

86:                                               ; preds = %81
  store i64 0, ptr %15, align 8, !tbaa !9
  br label %87

87:                                               ; preds = %101, %86
  %88 = load i64, ptr %15, align 8, !tbaa !9
  %89 = load i64, ptr %8, align 8, !tbaa !9
  %90 = sub nsw i64 %89, 1
  %91 = icmp sle i64 %88, %90
  br i1 %91, label %92, label %104

92:                                               ; preds = %87
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %93, i32 0, i32 6
  %95 = load ptr, ptr %94, align 8, !tbaa !24
  %96 = load i64, ptr %14, align 8, !tbaa !9
  %97 = getelementptr inbounds ptr, ptr %95, i64 %96
  %98 = load ptr, ptr %97, align 8, !tbaa !5
  %99 = load i64, ptr %15, align 8, !tbaa !9
  %100 = getelementptr inbounds double, ptr %98, i64 %99
  store double 0.000000e+00, ptr %100, align 8, !tbaa !25
  br label %101

101:                                              ; preds = %92
  %102 = load i64, ptr %15, align 8, !tbaa !9
  %103 = add nsw i64 %102, 1
  store i64 %103, ptr %15, align 8, !tbaa !9
  br label %87, !llvm.loop !26

104:                                              ; preds = %87
  br label %105

105:                                              ; preds = %104
  %106 = load i64, ptr %14, align 8, !tbaa !9
  %107 = add nsw i64 %106, 1
  store i64 %107, ptr %14, align 8, !tbaa !9
  br label %81, !llvm.loop !28

108:                                              ; preds = %81
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %109, i32 0, i32 1
  store double 0.000000e+00, ptr %110, align 8, !tbaa !22
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %111, i32 0, i32 2
  store double 0.000000e+00, ptr %112, align 8, !tbaa !23
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %113, i32 0, i32 0
  store i64 -3, ptr %114, align 8, !tbaa !19
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %115)
  store i32 1, ptr %17, align 4
  br label %128

116:                                              ; preds = %73
  %117 = load i64, ptr %8, align 8, !tbaa !9
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %16, i64 noundef %117, ptr noundef %118)
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = load i64, ptr %8, align 8, !tbaa !9
  %121 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %122 = trunc i8 %121 to i1
  %123 = load i8, ptr %10, align 1, !tbaa !11, !range !17, !noundef !18
  %124 = trunc i8 %123 to i1
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  %126 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_implL26matinv_rmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %119, i64 noundef 0, i64 noundef %120, i1 noundef zeroext %122, i1 noundef zeroext %124, ptr noundef %16, ptr noundef %125, ptr noundef %126)
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %127)
  store i32 0, ptr %17, align 4
  br label %128

128:                                              ; preds = %116, %108
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #4
  %129 = load i32, ptr %17, align 4
  switch i32 %129, label %131 [
    i32 0, label %130
    i32 1, label %130
  ]

130:                                              ; preds = %128, %128
  ret void

131:                                              ; preds = %128
  unreachable
}

declare noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef, double noundef) #2

declare void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef, ptr noundef) #2

declare void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef, i64 noundef, i64 noundef, ptr noundef, i1 noundef zeroext) #2

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #2

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #2

declare noundef zeroext i1 @_ZN11alglib_impl17isfinitertrmatrixEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL26matinv_rmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { "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 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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ZTSN11alglib_impl9ae_matrixE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !15, i64 40, !7, i64 72}
!15 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!16 = !{!14, !10, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !10, i64 0}
!20 = !{!"_ZTSN11alglib_impl12matinvreportE", !10, i64 0, !21, i64 8, !21, i64 16}
!21 = !{!"double", !7, i64 0}
!22 = !{!20, !21, i64 8}
!23 = !{!20, !21, i64 16}
!24 = !{!7, !7, i64 0}
!25 = !{!21, !21, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}


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

%"struct.alglib_impl::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%union.anon.1 = type { ptr }

@.str.505 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.506 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.507 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.508 = external hidden unnamed_addr constant [53 x i8], align 1

; 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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

declare void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl15rmatrixtrrcond1EPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl17rmatrixtrrcondinfEPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16rmatrixtrinverseEPNS_9ae_matrixElbbPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #3 {
  %7 = alloca %"struct.alglib_impl::ae_frame", align 8
  %8 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %5, ptr noundef nonnull %7)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %8, i8 0, i64 64, i1 false)
  call void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %4)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %8, i64 noundef 0, i64 noundef 3, ptr noundef %5, i1 noundef zeroext true)
  %9 = icmp sgt i64 %1, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef nonnull @.str.505, ptr noundef %5)
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load i64, ptr %10, align 8, !tbaa !5
  %12 = icmp sge i64 %11, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %12, ptr noundef nonnull @.str.506, ptr noundef %5)
  %13 = load i64, ptr %0, align 8, !tbaa !13
  %14 = icmp sge i64 %13, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.507, ptr noundef %5)
  %15 = call noundef zeroext i1 @_ZN11alglib_impl17isfinitertrmatrixEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %5)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %15, ptr noundef nonnull @.str.508, ptr noundef %5)
  store i64 1, ptr %4, align 8, !tbaa !14
  %16 = call noundef double @_ZN11alglib_impl15rmatrixtrrcond1EPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %5)
  %17 = getelementptr inbounds i8, ptr %4, i64 8
  store double %16, ptr %17, align 8, !tbaa !17
  %18 = call noundef double @_ZN11alglib_impl17rmatrixtrrcondinfEPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %5)
  %19 = getelementptr inbounds i8, ptr %4, i64 16
  store double %18, ptr %19, align 8, !tbaa !18
  %20 = load double, ptr %17, align 8, !tbaa !17
  %21 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %5)
  %22 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %20, double noundef %21)
  br i1 %22, label %27, label %23

23:                                               ; preds = %6
  %24 = load double, ptr %19, align 8, !tbaa !18
  %25 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %5)
  %26 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %24, double noundef %25)
  br i1 %26, label %27, label %56

27:                                               ; preds = %23, %6
  br i1 %9, label %.preheader.lr.ph, label %._crit_edge61

.preheader.lr.ph:                                 ; preds = %27
  %28 = getelementptr inbounds i8, ptr %0, i64 72
  %xtraiter = and i64 %1, 3
  %29 = icmp ult i64 %1, 4
  %unroll_iter = and i64 %1, 9223372036854775804
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph
  %.05460.us = phi i64 [ 0, %.preheader.lr.ph ], [ %55, %._crit_edge.us ]
  br i1 %29, label %._crit_edge.us.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %.preheader.us.new
  %.058.us = phi i64 [ %49, %.preheader.us.new ], [ 0, %.preheader.us ]
  %niter = phi i64 [ %niter.next.3, %.preheader.us.new ], [ 0, %.preheader.us ]
  %30 = load ptr, ptr %28, align 8, !tbaa !19
  %31 = getelementptr inbounds ptr, ptr %30, i64 %.05460.us
  %32 = load ptr, ptr %31, align 8, !tbaa !20
  %33 = getelementptr inbounds double, ptr %32, i64 %.058.us
  store double 0.000000e+00, ptr %33, align 8, !tbaa !21
  %34 = or disjoint i64 %.058.us, 1
  %35 = load ptr, ptr %28, align 8, !tbaa !19
  %36 = getelementptr inbounds ptr, ptr %35, i64 %.05460.us
  %37 = load ptr, ptr %36, align 8, !tbaa !20
  %38 = getelementptr inbounds double, ptr %37, i64 %34
  store double 0.000000e+00, ptr %38, align 8, !tbaa !21
  %39 = or disjoint i64 %.058.us, 2
  %40 = load ptr, ptr %28, align 8, !tbaa !19
  %41 = getelementptr inbounds ptr, ptr %40, i64 %.05460.us
  %42 = load ptr, ptr %41, align 8, !tbaa !20
  %43 = getelementptr inbounds double, ptr %42, i64 %39
  store double 0.000000e+00, ptr %43, align 8, !tbaa !21
  %44 = or disjoint i64 %.058.us, 3
  %45 = load ptr, ptr %28, align 8, !tbaa !19
  %46 = getelementptr inbounds ptr, ptr %45, i64 %.05460.us
  %47 = load ptr, ptr %46, align 8, !tbaa !20
  %48 = getelementptr inbounds double, ptr %47, i64 %44
  store double 0.000000e+00, ptr %48, align 8, !tbaa !21
  %49 = add nuw nsw i64 %.058.us, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.us.unr-lcssa, label %.preheader.us.new, !llvm.loop !22

._crit_edge.us.unr-lcssa:                         ; preds = %.preheader.us.new, %.preheader.us
  %.058.us.unr = phi i64 [ 0, %.preheader.us ], [ %49, %.preheader.us.new ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us.unr-lcssa, %.epil.preheader
  %.058.us.epil = phi i64 [ %54, %.epil.preheader ], [ %.058.us.unr, %._crit_edge.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.us.unr-lcssa ]
  %50 = load ptr, ptr %28, align 8, !tbaa !19
  %51 = getelementptr inbounds ptr, ptr %50, i64 %.05460.us
  %52 = load ptr, ptr %51, align 8, !tbaa !20
  %53 = getelementptr inbounds double, ptr %52, i64 %.058.us.epil
  store double 0.000000e+00, ptr %53, align 8, !tbaa !21
  %54 = add nuw nsw i64 %.058.us.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge.us, label %.epil.preheader, !llvm.loop !24

._crit_edge.us:                                   ; preds = %.epil.preheader, %._crit_edge.us.unr-lcssa
  %55 = add nuw nsw i64 %.05460.us, 1
  %exitcond62.not = icmp eq i64 %55, %1
  br i1 %exitcond62.not, label %._crit_edge61, label %.preheader.us, !llvm.loop !26

._crit_edge61:                                    ; preds = %._crit_edge.us, %27
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %17, i8 0, i64 16, i1 false)
  store i64 -3, ptr %4, align 8, !tbaa !14
  br label %57

56:                                               ; preds = %23
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %1, ptr noundef %5)
  call void @_ZN11alglib_implL26matinv_rmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef 0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef nonnull %8, ptr noundef nonnull %4, ptr noundef %5)
  br label %57

57:                                               ; preds = %56, %._crit_edge61
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %5)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  ret void
}

declare noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef, double noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef, i64 noundef, i64 noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN11alglib_impl17isfinitertrmatrixEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL26matinv_rmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { "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 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 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 40, !8, i64 72}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !7, i64 0}
!14 = !{!15, !7, i64 0}
!15 = !{!"_ZTSN11alglib_impl12matinvreportE", !7, i64 0, !16, i64 8, !16, i64 16}
!16 = !{!"double", !8, i64 0}
!17 = !{!15, !16, i64 8}
!18 = !{!15, !16, i64 16}
!19 = !{!8, !8, i64 0}
!20 = !{!12, !12, i64 0}
!21 = !{!16, !16, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.unroll.disable"}
!26 = distinct !{!26, !23}


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