; LLVM IR from venumb/ZSPACE :: cpp/depends/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.0 }
%union.anon.0 = type { ptr }
%"struct.alglib_impl::sinteger" = type { i64 }
%"struct.alglib_impl::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%union.anon.1 = type { ptr }
%"struct.alglib_impl::matinvreport" = type { double, double }

@.str.314 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.315 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.316 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.317 = 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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_impl15rmatrixtrrcond1EPNS_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_impl17rmatrixtrrcondinfEPNS_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_matrixElbbPlPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #3 {
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"struct.alglib_impl::ae_frame", align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca %"struct.alglib_impl::ae_vector", align 8
  %19 = alloca %"struct.alglib_impl::sinteger", align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i64 %1, ptr %9, align 8, !tbaa !9
  %21 = zext i1 %2 to i8
  store i8 %21, ptr %10, align 1, !tbaa !11
  %22 = zext i1 %3 to i8
  store i8 %22, ptr %11, align 1, !tbaa !11
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %23 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %23, ptr noundef %15)
  call void @llvm.memset.p0.i64(ptr align 8 %18, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %19, i8 0, i64 8, i1 false)
  %24 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 0, ptr %24, align 8, !tbaa !9
  %25 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %25)
  %26 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %18, i64 noundef 0, i64 noundef 3, ptr noundef %26, i1 noundef zeroext true)
  %27 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl14_sinteger_initEPvPNS_8ae_stateEb(ptr noundef %19, ptr noundef %27, i1 noundef zeroext true)
  %28 = load i64, ptr %9, align 8, !tbaa !9
  %29 = icmp sgt i64 %28, 0
  %30 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %29, ptr noundef @.str.314, ptr noundef %30)
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %31, i32 0, i32 1
  %33 = load i64, ptr %32, align 8, !tbaa !13
  %34 = load i64, ptr %9, align 8, !tbaa !9
  %35 = icmp sge i64 %33, %34
  %36 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %35, ptr noundef @.str.315, ptr noundef %36)
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %37, i32 0, i32 0
  %39 = load i64, ptr %38, align 8, !tbaa !16
  %40 = load i64, ptr %9, align 8, !tbaa !9
  %41 = icmp sge i64 %39, %40
  %42 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %41, ptr noundef @.str.316, ptr noundef %42)
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load i64, ptr %9, align 8, !tbaa !9
  %45 = load i8, ptr %10, align 1, !tbaa !11, !range !17, !noundef !18
  %46 = trunc i8 %45 to i1
  %47 = load ptr, ptr %14, align 8, !tbaa !5
  %48 = call noundef zeroext i1 @_ZN11alglib_impl17isfinitertrmatrixEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef %43, i64 noundef %44, i1 noundef zeroext %46, ptr noundef %47)
  %49 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %48, ptr noundef @.str.317, ptr noundef %49)
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = load i64, ptr %9, align 8, !tbaa !9
  %52 = load i8, ptr %10, align 1, !tbaa !11, !range !17, !noundef !18
  %53 = trunc i8 %52 to i1
  %54 = load i8, ptr %11, align 1, !tbaa !11, !range !17, !noundef !18
  %55 = trunc i8 %54 to i1
  %56 = load ptr, ptr %14, align 8, !tbaa !5
  %57 = call noundef double @_ZN11alglib_impl15rmatrixtrrcond1EPNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef %50, i64 noundef %51, i1 noundef zeroext %53, i1 noundef zeroext %55, ptr noundef %56)
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %58, i32 0, i32 0
  store double %57, ptr %59, align 8, !tbaa !19
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = load i64, ptr %9, align 8, !tbaa !9
  %62 = load i8, ptr %10, align 1, !tbaa !11, !range !17, !noundef !18
  %63 = trunc i8 %62 to i1
  %64 = load i8, ptr %11, align 1, !tbaa !11, !range !17, !noundef !18
  %65 = trunc i8 %64 to i1
  %66 = load ptr, ptr %14, align 8, !tbaa !5
  %67 = call noundef double @_ZN11alglib_impl17rmatrixtrrcondinfEPNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef %60, i64 noundef %61, i1 noundef zeroext %63, i1 noundef zeroext %65, ptr noundef %66)
  %68 = load ptr, ptr %13, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %68, i32 0, i32 1
  store double %67, ptr %69, align 8, !tbaa !22
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %70, i32 0, i32 0
  %72 = load double, ptr %71, align 8, !tbaa !19
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  %74 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %73)
  %75 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %72, double noundef %74)
  br i1 %75, label %83, label %76

76:                                               ; preds = %7
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %77, i32 0, i32 1
  %79 = load double, ptr %78, align 8, !tbaa !22
  %80 = load ptr, ptr %14, align 8, !tbaa !5
  %81 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %80)
  %82 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %79, double noundef %81)
  br i1 %82, label %83, label %118

83:                                               ; preds = %76, %7
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %84

84:                                               ; preds = %108, %83
  %85 = load i64, ptr %16, align 8, !tbaa !9
  %86 = load i64, ptr %9, align 8, !tbaa !9
  %87 = sub nsw i64 %86, 1
  %88 = icmp sle i64 %85, %87
  br i1 %88, label %89, label %111

89:                                               ; preds = %84
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %90

90:                                               ; preds = %104, %89
  %91 = load i64, ptr %17, align 8, !tbaa !9
  %92 = load i64, ptr %9, align 8, !tbaa !9
  %93 = sub nsw i64 %92, 1
  %94 = icmp sle i64 %91, %93
  br i1 %94, label %95, label %107

95:                                               ; preds = %90
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %96, i32 0, i32 6
  %98 = load ptr, ptr %97, align 8, !tbaa !23
  %99 = load i64, ptr %16, align 8, !tbaa !9
  %100 = getelementptr inbounds ptr, ptr %98, i64 %99
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = load i64, ptr %17, align 8, !tbaa !9
  %103 = getelementptr inbounds double, ptr %101, i64 %102
  store double 0.000000e+00, ptr %103, align 8, !tbaa !24
  br label %104

104:                                              ; preds = %95
  %105 = load i64, ptr %17, align 8, !tbaa !9
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %17, align 8, !tbaa !9
  br label %90, !llvm.loop !25

107:                                              ; preds = %90
  br label %108

108:                                              ; preds = %107
  %109 = load i64, ptr %16, align 8, !tbaa !9
  %110 = add nsw i64 %109, 1
  store i64 %110, ptr %16, align 8, !tbaa !9
  br label %84, !llvm.loop !27

111:                                              ; preds = %84
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %112, i32 0, i32 0
  store double 0.000000e+00, ptr %113, align 8, !tbaa !19
  %114 = load ptr, ptr %13, align 8, !tbaa !5
  %115 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %114, i32 0, i32 1
  store double 0.000000e+00, ptr %115, align 8, !tbaa !22
  %116 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 -3, ptr %116, align 8, !tbaa !9
  %117 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %117)
  store i32 1, ptr %20, align 4
  br label %133

118:                                              ; preds = %76
  %119 = load i64, ptr %9, align 8, !tbaa !9
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %18, i64 noundef %119, ptr noundef %120)
  %121 = getelementptr inbounds %"struct.alglib_impl::sinteger", ptr %19, i32 0, i32 0
  store i64 1, ptr %121, align 8, !tbaa !28
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = load i64, ptr %9, align 8, !tbaa !9
  %124 = load i8, ptr %10, align 1, !tbaa !11, !range !17, !noundef !18
  %125 = trunc i8 %124 to i1
  %126 = load i8, ptr %11, align 1, !tbaa !11, !range !17, !noundef !18
  %127 = trunc i8 %126 to i1
  %128 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_implL26matinv_rmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_8sintegerEPNS_8ae_stateE(ptr noundef %122, i64 noundef 0, i64 noundef %123, i1 noundef zeroext %125, i1 noundef zeroext %127, ptr noundef %18, ptr noundef %19, ptr noundef %128)
  %129 = getelementptr inbounds %"struct.alglib_impl::sinteger", ptr %19, i32 0, i32 0
  %130 = load i64, ptr %129, align 8, !tbaa !28
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 %130, ptr %131, align 8, !tbaa !9
  %132 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %132)
  store i32 0, ptr %20, align 4
  br label %133

133:                                              ; preds = %118, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  %134 = load i32, ptr %20, align 4
  switch i32 %134, label %136 [
    i32 0, label %135
    i32 1, label %135
  ]

135:                                              ; preds = %133, %133
  ret void

136:                                              ; preds = %133
  unreachable
}

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_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #2

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #2

declare noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef, double 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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL26matinv_rmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_8sintegerEPNS_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, !21, i64 0}
!20 = !{!"_ZTSN11alglib_impl12matinvreportE", !21, i64 0, !21, i64 8}
!21 = !{!"double", !7, i64 0}
!22 = !{!20, !21, i64 8}
!23 = !{!7, !7, i64 0}
!24 = !{!21, !21, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}
!28 = !{!29, !10, i64 0}
!29 = !{!"_ZTSN11alglib_impl8sintegerE", !10, 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"

%"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.0 }
%union.anon.0 = type { ptr }
%"struct.alglib_impl::sinteger" = type { i64 }

@.str.314 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.315 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.316 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.317 = 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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_impl15rmatrixtrrcond1EPNS_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_impl17rmatrixtrrcondinfEPNS_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_matrixElbbPlPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr nocapture noundef writeonly %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #3 {
  %8 = alloca %"struct.alglib_impl::ae_frame", align 8
  %9 = alloca %"struct.alglib_impl::ae_vector", align 8
  %10 = alloca %"struct.alglib_impl::sinteger", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %6, ptr noundef nonnull %8)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %9, i8 0, i64 64, i1 false)
  store i64 0, ptr %10, align 8
  store i64 0, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %5)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %9, i64 noundef 0, i64 noundef 3, ptr noundef %6, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14_sinteger_initEPvPNS_8ae_stateEb(ptr noundef nonnull %10, ptr noundef %6, i1 noundef zeroext true)
  %11 = icmp sgt i64 %1, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %11, ptr noundef nonnull @.str.314, ptr noundef %6)
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load i64, ptr %12, align 8, !tbaa !9
  %14 = icmp sge i64 %13, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.315, ptr noundef %6)
  %15 = load i64, ptr %0, align 8, !tbaa !14
  %16 = icmp sge i64 %15, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %16, ptr noundef nonnull @.str.316, ptr noundef %6)
  %17 = call noundef zeroext i1 @_ZN11alglib_impl17isfinitertrmatrixEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %6)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %17, ptr noundef nonnull @.str.317, ptr noundef %6)
  %18 = call noundef double @_ZN11alglib_impl15rmatrixtrrcond1EPNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %6)
  store double %18, ptr %5, align 8, !tbaa !15
  %19 = call noundef double @_ZN11alglib_impl17rmatrixtrrcondinfEPNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %6)
  %20 = getelementptr inbounds i8, ptr %5, i64 8
  store double %19, ptr %20, align 8, !tbaa !18
  %21 = load double, ptr %5, align 8, !tbaa !15
  %22 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %6)
  %23 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %21, double noundef %22)
  br i1 %23, label %28, label %24

24:                                               ; preds = %7
  %25 = load double, ptr %20, align 8, !tbaa !18
  %26 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %6)
  %27 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %25, double noundef %26)
  br i1 %27, label %28, label %57

28:                                               ; preds = %24, %7
  br i1 %11, label %.preheader.lr.ph, label %._crit_edge62

.preheader.lr.ph:                                 ; preds = %28
  %29 = getelementptr inbounds i8, ptr %0, i64 72
  %xtraiter = and i64 %1, 3
  %30 = 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
  %.05561.us = phi i64 [ 0, %.preheader.lr.ph ], [ %56, %._crit_edge.us ]
  br i1 %30, label %._crit_edge.us.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %.preheader.us.new
  %.059.us = phi i64 [ %50, %.preheader.us.new ], [ 0, %.preheader.us ]
  %niter = phi i64 [ %niter.next.3, %.preheader.us.new ], [ 0, %.preheader.us ]
  %31 = load ptr, ptr %29, align 8, !tbaa !19
  %32 = getelementptr inbounds ptr, ptr %31, i64 %.05561.us
  %33 = load ptr, ptr %32, align 8, !tbaa !20
  %34 = getelementptr inbounds double, ptr %33, i64 %.059.us
  store double 0.000000e+00, ptr %34, align 8, !tbaa !21
  %35 = or disjoint i64 %.059.us, 1
  %36 = load ptr, ptr %29, align 8, !tbaa !19
  %37 = getelementptr inbounds ptr, ptr %36, i64 %.05561.us
  %38 = load ptr, ptr %37, align 8, !tbaa !20
  %39 = getelementptr inbounds double, ptr %38, i64 %35
  store double 0.000000e+00, ptr %39, align 8, !tbaa !21
  %40 = or disjoint i64 %.059.us, 2
  %41 = load ptr, ptr %29, align 8, !tbaa !19
  %42 = getelementptr inbounds ptr, ptr %41, i64 %.05561.us
  %43 = load ptr, ptr %42, align 8, !tbaa !20
  %44 = getelementptr inbounds double, ptr %43, i64 %40
  store double 0.000000e+00, ptr %44, align 8, !tbaa !21
  %45 = or disjoint i64 %.059.us, 3
  %46 = load ptr, ptr %29, align 8, !tbaa !19
  %47 = getelementptr inbounds ptr, ptr %46, i64 %.05561.us
  %48 = load ptr, ptr %47, align 8, !tbaa !20
  %49 = getelementptr inbounds double, ptr %48, i64 %45
  store double 0.000000e+00, ptr %49, align 8, !tbaa !21
  %50 = add nuw nsw i64 %.059.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
  %.059.us.unr = phi i64 [ 0, %.preheader.us ], [ %50, %.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
  %.059.us.epil = phi i64 [ %55, %.epil.preheader ], [ %.059.us.unr, %._crit_edge.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.us.unr-lcssa ]
  %51 = load ptr, ptr %29, align 8, !tbaa !19
  %52 = getelementptr inbounds ptr, ptr %51, i64 %.05561.us
  %53 = load ptr, ptr %52, align 8, !tbaa !20
  %54 = getelementptr inbounds double, ptr %53, i64 %.059.us.epil
  store double 0.000000e+00, ptr %54, align 8, !tbaa !21
  %55 = add nuw nsw i64 %.059.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
  %56 = add nuw nsw i64 %.05561.us, 1
  %exitcond63.not = icmp eq i64 %56, %1
  br i1 %exitcond63.not, label %._crit_edge62, label %.preheader.us, !llvm.loop !26

._crit_edge62:                                    ; preds = %._crit_edge.us, %28
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, i8 0, i64 16, i1 false)
  br label %59

57:                                               ; preds = %24
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %9, i64 noundef %1, ptr noundef %6)
  store i64 1, ptr %10, align 8, !tbaa !27
  call void @_ZN11alglib_implL26matinv_rmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_8sintegerEPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef 0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef %6)
  %58 = load i64, ptr %10, align 8, !tbaa !27
  br label %59

59:                                               ; preds = %57, %._crit_edge62
  %.sink = phi i64 [ %58, %57 ], [ -3, %._crit_edge62 ]
  store i64 %.sink, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #4
  ret void
}

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_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef, double 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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL26matinv_rmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_8sintegerEPNS_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, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTSN11alglib_impl9ae_matrixE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !12, i64 40, !7, i64 72}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!10, !6, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"_ZTSN11alglib_impl12matinvreportE", !17, i64 0, !17, i64 8}
!17 = !{!"double", !7, i64 0}
!18 = !{!16, !17, i64 8}
!19 = !{!7, !7, i64 0}
!20 = !{!13, !13, i64 0}
!21 = !{!17, !17, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.unroll.disable"}
!26 = distinct !{!26, !23}
!27 = !{!28, !6, i64 0}
!28 = !{!"_ZTSN11alglib_impl8sintegerE", !6, i64 0}


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