; 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::matinvreport" = type { double, double }
%"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 }

@.str.298 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.299 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.300 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.301 = external hidden unnamed_addr constant [61 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_impl22spdmatrixcholeskyrcondEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl18_matinvreport_initEPvPNS_8ae_stateEb(ptr noundef, ptr noundef, i1 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl24spdmatrixcholeskyinverseEPNS_9ae_matrixElbPlPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %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 ptr, align 8
  %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 %"struct.alglib_impl::matinvreport", align 8
  %18 = alloca i8, align 1
  %19 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  %20 = zext i1 %2 to i8
  store i8 %20, ptr %9, align 1, !tbaa !11
  store ptr %3, ptr %10, align 8, !tbaa !5
  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
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #4
  %21 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %21, ptr noundef %13)
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 16, i1 false)
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 0, ptr %22, align 8, !tbaa !9
  %23 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %23)
  %24 = 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 %24, i1 noundef zeroext true)
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl18_matinvreport_initEPvPNS_8ae_stateEb(ptr noundef %17, ptr noundef %25, i1 noundef zeroext true)
  %26 = load i64, ptr %8, align 8, !tbaa !9
  %27 = icmp sgt i64 %26, 0
  %28 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %27, ptr noundef @.str.298, ptr noundef %28)
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %29, i32 0, i32 1
  %31 = load i64, ptr %30, align 8, !tbaa !13
  %32 = load i64, ptr %8, align 8, !tbaa !9
  %33 = icmp sge i64 %31, %32
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %33, ptr noundef @.str.299, ptr noundef %34)
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %35, i32 0, i32 0
  %37 = load i64, ptr %36, align 8, !tbaa !16
  %38 = load i64, ptr %8, align 8, !tbaa !9
  %39 = icmp sge i64 %37, %38
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %39, ptr noundef @.str.300, ptr noundef %40)
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 1, ptr %41, align 8, !tbaa !9
  store i8 1, ptr %18, align 1, !tbaa !11
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %42

42:                                               ; preds = %65, %6
  %43 = load i64, ptr %14, align 8, !tbaa !9
  %44 = load i64, ptr %8, align 8, !tbaa !9
  %45 = sub nsw i64 %44, 1
  %46 = icmp sle i64 %43, %45
  br i1 %46, label %47, label %68

47:                                               ; preds = %42
  %48 = load i8, ptr %18, align 1, !tbaa !11, !range !17, !noundef !18
  %49 = trunc i8 %48 to i1
  br i1 %49, label %50, label %62

50:                                               ; preds = %47
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %51, i32 0, i32 6
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  %54 = load i64, ptr %14, align 8, !tbaa !9
  %55 = getelementptr inbounds ptr, ptr %53, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = load i64, ptr %14, align 8, !tbaa !9
  %58 = getelementptr inbounds double, ptr %56, i64 %57
  %59 = load double, ptr %58, align 8, !tbaa !20
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %59, ptr noundef %60)
  br label %62

62:                                               ; preds = %50, %47
  %63 = phi i1 [ false, %47 ], [ %61, %50 ]
  %64 = zext i1 %63 to i8
  store i8 %64, ptr %18, align 1, !tbaa !11
  br label %65

65:                                               ; preds = %62
  %66 = load i64, ptr %14, align 8, !tbaa !9
  %67 = add nsw i64 %66, 1
  store i64 %67, ptr %14, align 8, !tbaa !9
  br label %42, !llvm.loop !22

68:                                               ; preds = %42
  %69 = load i8, ptr %18, align 1, !tbaa !11, !range !17, !noundef !18
  %70 = trunc i8 %69 to i1
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %70, ptr noundef @.str.301, ptr noundef %71)
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = load i64, ptr %8, align 8, !tbaa !9
  %74 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %75 = trunc i8 %74 to i1
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = call noundef double @_ZN11alglib_impl22spdmatrixcholeskyrcondEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef %72, i64 noundef %73, i1 noundef zeroext %75, ptr noundef %76)
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %78, i32 0, i32 0
  store double %77, ptr %79, align 8, !tbaa !24
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %80, i32 0, i32 0
  %82 = load double, ptr %81, align 8, !tbaa !24
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %83, i32 0, i32 1
  store double %82, ptr %84, align 8, !tbaa !26
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %85, i32 0, i32 0
  %87 = load double, ptr %86, align 8, !tbaa !24
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %88)
  %90 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %87, double noundef %89)
  br i1 %90, label %98, label %91

91:                                               ; preds = %68
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %92, i32 0, i32 1
  %94 = load double, ptr %93, align 8, !tbaa !26
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %95)
  %97 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %94, double noundef %96)
  br i1 %97, label %98, label %166

98:                                               ; preds = %91, %68
  %99 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %100 = trunc i8 %99 to i1
  br i1 %100, label %101, label %131

101:                                              ; preds = %98
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %102

102:                                              ; preds = %127, %101
  %103 = load i64, ptr %14, align 8, !tbaa !9
  %104 = load i64, ptr %8, align 8, !tbaa !9
  %105 = sub nsw i64 %104, 1
  %106 = icmp sle i64 %103, %105
  br i1 %106, label %107, label %130

107:                                              ; preds = %102
  %108 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %108, ptr %15, align 8, !tbaa !9
  br label %109

109:                                              ; preds = %123, %107
  %110 = load i64, ptr %15, align 8, !tbaa !9
  %111 = load i64, ptr %8, align 8, !tbaa !9
  %112 = sub nsw i64 %111, 1
  %113 = icmp sle i64 %110, %112
  br i1 %113, label %114, label %126

114:                                              ; preds = %109
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %115, i32 0, i32 6
  %117 = load ptr, ptr %116, align 8, !tbaa !19
  %118 = load i64, ptr %14, align 8, !tbaa !9
  %119 = getelementptr inbounds ptr, ptr %117, i64 %118
  %120 = load ptr, ptr %119, align 8, !tbaa !5
  %121 = load i64, ptr %15, align 8, !tbaa !9
  %122 = getelementptr inbounds double, ptr %120, i64 %121
  store double 0.000000e+00, ptr %122, align 8, !tbaa !20
  br label %123

123:                                              ; preds = %114
  %124 = load i64, ptr %15, align 8, !tbaa !9
  %125 = add nsw i64 %124, 1
  store i64 %125, ptr %15, align 8, !tbaa !9
  br label %109, !llvm.loop !27

126:                                              ; preds = %109
  br label %127

127:                                              ; preds = %126
  %128 = load i64, ptr %14, align 8, !tbaa !9
  %129 = add nsw i64 %128, 1
  store i64 %129, ptr %14, align 8, !tbaa !9
  br label %102, !llvm.loop !28

130:                                              ; preds = %102
  br label %159

131:                                              ; preds = %98
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %132

132:                                              ; preds = %155, %131
  %133 = load i64, ptr %14, align 8, !tbaa !9
  %134 = load i64, ptr %8, align 8, !tbaa !9
  %135 = sub nsw i64 %134, 1
  %136 = icmp sle i64 %133, %135
  br i1 %136, label %137, label %158

137:                                              ; preds = %132
  store i64 0, ptr %15, align 8, !tbaa !9
  br label %138

138:                                              ; preds = %151, %137
  %139 = load i64, ptr %15, align 8, !tbaa !9
  %140 = load i64, ptr %14, align 8, !tbaa !9
  %141 = icmp sle i64 %139, %140
  br i1 %141, label %142, label %154

142:                                              ; preds = %138
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %143, i32 0, i32 6
  %145 = load ptr, ptr %144, align 8, !tbaa !19
  %146 = load i64, ptr %14, align 8, !tbaa !9
  %147 = getelementptr inbounds ptr, ptr %145, i64 %146
  %148 = load ptr, ptr %147, align 8, !tbaa !5
  %149 = load i64, ptr %15, align 8, !tbaa !9
  %150 = getelementptr inbounds double, ptr %148, i64 %149
  store double 0.000000e+00, ptr %150, align 8, !tbaa !20
  br label %151

151:                                              ; preds = %142
  %152 = load i64, ptr %15, align 8, !tbaa !9
  %153 = add nsw i64 %152, 1
  store i64 %153, ptr %15, align 8, !tbaa !9
  br label %138, !llvm.loop !29

154:                                              ; preds = %138
  br label %155

155:                                              ; preds = %154
  %156 = load i64, ptr %14, align 8, !tbaa !9
  %157 = add nsw i64 %156, 1
  store i64 %157, ptr %14, align 8, !tbaa !9
  br label %132, !llvm.loop !30

158:                                              ; preds = %132
  br label %159

159:                                              ; preds = %158, %130
  %160 = load ptr, ptr %11, align 8, !tbaa !5
  %161 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %160, i32 0, i32 0
  store double 0.000000e+00, ptr %161, align 8, !tbaa !24
  %162 = load ptr, ptr %11, align 8, !tbaa !5
  %163 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %162, i32 0, i32 1
  store double 0.000000e+00, ptr %163, align 8, !tbaa !26
  %164 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 -3, ptr %164, align 8, !tbaa !9
  %165 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %165)
  store i32 1, ptr %19, align 4
  br label %175

166:                                              ; preds = %91
  %167 = load i64, ptr %8, align 8, !tbaa !9
  %168 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %16, i64 noundef %167, ptr noundef %168)
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = load i64, ptr %8, align 8, !tbaa !9
  %171 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %172 = trunc i8 %171 to i1
  %173 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl27spdmatrixcholeskyinverserecEPNS_9ae_matrixEllbPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %169, i64 noundef 0, i64 noundef %170, i1 noundef zeroext %172, ptr noundef %16, ptr noundef %173)
  %174 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %174)
  store i32 0, ptr %19, align 4
  br label %175

175:                                              ; preds = %166, %159
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #4
  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
  %176 = load i32, ptr %19, align 4
  switch i32 %176, label %178 [
    i32 0, label %177
    i32 1, label %177
  ]

177:                                              ; preds = %175, %175
  ret void

178:                                              ; preds = %175
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl27spdmatrixcholeskyinverserecEPNS_9ae_matrixEllbPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, i1 noundef zeroext, 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 = !{!7, !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"double", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!25, !21, i64 0}
!25 = !{!"_ZTSN11alglib_impl12matinvreportE", !21, i64 0, !21, i64 8}
!26 = !{!25, !21, i64 8}
!27 = distinct !{!27, !23}
!28 = distinct !{!28, !23}
!29 = distinct !{!29, !23}
!30 = distinct !{!30, !23}


; 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::matinvreport" = type { double, double }

@.str.298 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.299 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.300 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.301 = external hidden unnamed_addr constant [61 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_impl22spdmatrixcholeskyrcondEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl18_matinvreport_initEPvPNS_8ae_stateEb(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl24spdmatrixcholeskyinverseEPNS_9ae_matrixElbPlPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, ptr nocapture noundef writeonly %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
  %9 = alloca %"struct.alglib_impl::matinvreport", 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 @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #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 @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %9, i8 0, i64 16, i1 false)
  store i64 0, ptr %3, align 8, !tbaa !5
  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)
  call void @_ZN11alglib_impl18_matinvreport_initEPvPNS_8ae_stateEb(ptr noundef nonnull %9, ptr noundef %5, i1 noundef zeroext true)
  %10 = icmp sgt i64 %1, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %10, ptr noundef nonnull @.str.298, ptr noundef %5)
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load i64, ptr %11, align 8, !tbaa !9
  %13 = icmp sge i64 %12, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %13, ptr noundef nonnull @.str.299, ptr noundef %5)
  %14 = load i64, ptr %0, align 8, !tbaa !14
  %15 = icmp sge i64 %14, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %15, ptr noundef nonnull @.str.300, ptr noundef %5)
  store i64 1, ptr %3, align 8, !tbaa !5
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6
  %16 = getelementptr inbounds i8, ptr %0, i64 72
  br label %17

17:                                               ; preds = %.lr.ph, %25
  %.078 = phi i1 [ true, %.lr.ph ], [ %26, %25 ]
  %.06677 = phi i64 [ 0, %.lr.ph ], [ %27, %25 ]
  br i1 %.078, label %18, label %25

18:                                               ; preds = %17
  %19 = load ptr, ptr %16, align 8, !tbaa !15
  %20 = getelementptr inbounds ptr, ptr %19, i64 %.06677
  %21 = load ptr, ptr %20, align 8, !tbaa !16
  %22 = getelementptr inbounds double, ptr %21, i64 %.06677
  %23 = load double, ptr %22, align 8, !tbaa !17
  %24 = call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %23, ptr noundef %5)
  br label %25

25:                                               ; preds = %18, %17
  %26 = phi i1 [ false, %17 ], [ %24, %18 ]
  %27 = add nuw nsw i64 %.06677, 1
  %exitcond.not = icmp eq i64 %27, %1
  br i1 %exitcond.not, label %._crit_edge, label %17, !llvm.loop !19

._crit_edge:                                      ; preds = %25, %6
  %.0.lcssa = phi i1 [ true, %6 ], [ %26, %25 ]
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %.0.lcssa, ptr noundef nonnull @.str.301, ptr noundef %5)
  %28 = call noundef double @_ZN11alglib_impl22spdmatrixcholeskyrcondEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %5)
  store double %28, ptr %4, align 8, !tbaa !21
  %29 = getelementptr inbounds i8, ptr %4, i64 8
  store double %28, ptr %29, align 8, !tbaa !23
  %30 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %5)
  %31 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %28, double noundef %30)
  br i1 %31, label %36, label %32

32:                                               ; preds = %._crit_edge
  %33 = load double, ptr %29, align 8, !tbaa !23
  %34 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %5)
  %35 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %33, double noundef %34)
  br i1 %35, label %36, label %88

36:                                               ; preds = %32, %._crit_edge
  br i1 %2, label %.preheader72, label %.preheader74

.preheader74:                                     ; preds = %36
  br i1 %10, label %.preheader73.lr.ph, label %.loopexit

.preheader73.lr.ph:                               ; preds = %.preheader74
  %37 = getelementptr inbounds i8, ptr %0, i64 72
  br label %.preheader73

.preheader72:                                     ; preds = %36
  br i1 %10, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %.preheader72
  %38 = getelementptr inbounds i8, ptr %0, i64 72
  %xtraiter93 = and i64 %1, 1
  %39 = icmp eq i64 %1, 1
  br i1 %39, label %.loopexit.loopexit.unr-lcssa, label %.preheader.lr.ph.new

.preheader.lr.ph.new:                             ; preds = %.preheader.lr.ph
  %unroll_iter96 = and i64 %1, 9223372036854775806
  br label %.preheader

.preheader:                                       ; preds = %53, %.preheader.lr.ph.new
  %.16784 = phi i64 [ 0, %.preheader.lr.ph.new ], [ %54, %53 ]
  %niter97 = phi i64 [ 0, %.preheader.lr.ph.new ], [ %niter97.next.1, %53 ]
  br label %40

40:                                               ; preds = %.preheader, %40
  %.06582 = phi i64 [ %.16784, %.preheader ], [ %45, %40 ]
  %41 = load ptr, ptr %38, align 8, !tbaa !15
  %42 = getelementptr inbounds ptr, ptr %41, i64 %.16784
  %43 = load ptr, ptr %42, align 8, !tbaa !16
  %44 = getelementptr inbounds double, ptr %43, i64 %.06582
  store double 0.000000e+00, ptr %44, align 8, !tbaa !17
  %45 = add nuw nsw i64 %.06582, 1
  %.not71.not = icmp slt i64 %45, %1
  br i1 %.not71.not, label %40, label %.preheader.1, !llvm.loop !24

.preheader.1:                                     ; preds = %40
  %46 = or disjoint i64 %.16784, 1
  br label %47

47:                                               ; preds = %47, %.preheader.1
  %.06582.1 = phi i64 [ %46, %.preheader.1 ], [ %52, %47 ]
  %48 = load ptr, ptr %38, align 8, !tbaa !15
  %49 = getelementptr inbounds ptr, ptr %48, i64 %46
  %50 = load ptr, ptr %49, align 8, !tbaa !16
  %51 = getelementptr inbounds double, ptr %50, i64 %.06582.1
  store double 0.000000e+00, ptr %51, align 8, !tbaa !17
  %52 = add nuw nsw i64 %.06582.1, 1
  %.not71.not.1 = icmp slt i64 %52, %1
  br i1 %.not71.not.1, label %47, label %53, !llvm.loop !24

53:                                               ; preds = %47
  %54 = add nuw nsw i64 %.16784, 2
  %niter97.next.1 = add i64 %niter97, 2
  %niter97.ncmp.1 = icmp eq i64 %niter97.next.1, %unroll_iter96
  br i1 %niter97.ncmp.1, label %.loopexit.loopexit.unr-lcssa, label %.preheader, !llvm.loop !25

.preheader73:                                     ; preds = %.preheader73.lr.ph, %.epilog-lcssa
  %indvars.iv = phi i64 [ 1, %.preheader73.lr.ph ], [ %indvars.iv.next, %.epilog-lcssa ]
  %.281 = phi i64 [ 0, %.preheader73.lr.ph ], [ %82, %.epilog-lcssa ]
  %xtraiter = and i64 %indvars.iv, 3
  %55 = icmp ult i64 %.281, 3
  br i1 %55, label %.unr-lcssa, label %.preheader73.new

.preheader73.new:                                 ; preds = %.preheader73
  %unroll_iter = and i64 %indvars.iv, -4
  br label %56

56:                                               ; preds = %56, %.preheader73.new
  %.179 = phi i64 [ 0, %.preheader73.new ], [ %76, %56 ]
  %niter = phi i64 [ 0, %.preheader73.new ], [ %niter.next.3, %56 ]
  %57 = load ptr, ptr %37, align 8, !tbaa !15
  %58 = getelementptr inbounds ptr, ptr %57, i64 %.281
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %60 = getelementptr inbounds double, ptr %59, i64 %.179
  store double 0.000000e+00, ptr %60, align 8, !tbaa !17
  %61 = or disjoint i64 %.179, 1
  %62 = load ptr, ptr %37, align 8, !tbaa !15
  %63 = getelementptr inbounds ptr, ptr %62, i64 %.281
  %64 = load ptr, ptr %63, align 8, !tbaa !16
  %65 = getelementptr inbounds double, ptr %64, i64 %61
  store double 0.000000e+00, ptr %65, align 8, !tbaa !17
  %66 = or disjoint i64 %.179, 2
  %67 = load ptr, ptr %37, align 8, !tbaa !15
  %68 = getelementptr inbounds ptr, ptr %67, i64 %.281
  %69 = load ptr, ptr %68, align 8, !tbaa !16
  %70 = getelementptr inbounds double, ptr %69, i64 %66
  store double 0.000000e+00, ptr %70, align 8, !tbaa !17
  %71 = or disjoint i64 %.179, 3
  %72 = load ptr, ptr %37, align 8, !tbaa !15
  %73 = getelementptr inbounds ptr, ptr %72, i64 %.281
  %74 = load ptr, ptr %73, align 8, !tbaa !16
  %75 = getelementptr inbounds double, ptr %74, i64 %71
  store double 0.000000e+00, ptr %75, align 8, !tbaa !17
  %76 = add nuw nsw i64 %.179, 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 %.unr-lcssa, label %56, !llvm.loop !26

.unr-lcssa:                                       ; preds = %56, %.preheader73
  %.179.unr = phi i64 [ 0, %.preheader73 ], [ %76, %56 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.epilog-lcssa, label %.epil.preheader

.epil.preheader:                                  ; preds = %.unr-lcssa, %.epil.preheader
  %.179.epil = phi i64 [ %81, %.epil.preheader ], [ %.179.unr, %.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.unr-lcssa ]
  %77 = load ptr, ptr %37, align 8, !tbaa !15
  %78 = getelementptr inbounds ptr, ptr %77, i64 %.281
  %79 = load ptr, ptr %78, align 8, !tbaa !16
  %80 = getelementptr inbounds double, ptr %79, i64 %.179.epil
  store double 0.000000e+00, ptr %80, align 8, !tbaa !17
  %81 = add nuw nsw i64 %.179.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 %.epilog-lcssa, label %.epil.preheader, !llvm.loop !27

.epilog-lcssa:                                    ; preds = %.epil.preheader, %.unr-lcssa
  %82 = add nuw nsw i64 %.281, 1
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  %exitcond88.not = icmp eq i64 %82, %1
  br i1 %exitcond88.not, label %.loopexit, label %.preheader73, !llvm.loop !29

.loopexit.loopexit.unr-lcssa:                     ; preds = %53, %.preheader.lr.ph
  %.16784.unr = phi i64 [ 0, %.preheader.lr.ph ], [ %54, %53 ]
  %lcmp.mod95.not = icmp eq i64 %xtraiter93, 0
  br i1 %lcmp.mod95.not, label %.loopexit, label %.preheader.epil

.preheader.epil:                                  ; preds = %.loopexit.loopexit.unr-lcssa, %.preheader.epil
  %.06582.epil = phi i64 [ %87, %.preheader.epil ], [ %.16784.unr, %.loopexit.loopexit.unr-lcssa ]
  %83 = load ptr, ptr %38, align 8, !tbaa !15
  %84 = getelementptr inbounds ptr, ptr %83, i64 %.16784.unr
  %85 = load ptr, ptr %84, align 8, !tbaa !16
  %86 = getelementptr inbounds double, ptr %85, i64 %.06582.epil
  store double 0.000000e+00, ptr %86, align 8, !tbaa !17
  %87 = add nuw nsw i64 %.06582.epil, 1
  %.not71.not.epil = icmp slt i64 %87, %1
  br i1 %.not71.not.epil, label %.preheader.epil, label %.loopexit, !llvm.loop !24

.loopexit:                                        ; preds = %.epilog-lcssa, %.loopexit.loopexit.unr-lcssa, %.preheader.epil, %.preheader74, %.preheader72
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  store i64 -3, ptr %3, align 8, !tbaa !5
  br label %89

88:                                               ; preds = %32
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %1, ptr noundef %5)
  call void @_ZN11alglib_impl27spdmatrixcholeskyinverserecEPNS_9ae_matrixEllbPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef 0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef nonnull %8, ptr noundef %5)
  br label %89

89:                                               ; preds = %88, %.loopexit
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  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_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef, ptr 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_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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl27spdmatrixcholeskyinverserecEPNS_9ae_matrixEllbPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, i1 noundef zeroext, 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 = !{!7, !7, i64 0}
!16 = !{!13, !13, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !18, i64 0}
!22 = !{!"_ZTSN11alglib_impl12matinvreportE", !18, i64 0, !18, i64 8}
!23 = !{!22, !18, i64 8}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !20}
!26 = distinct !{!26, !20}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.unroll.disable"}
!29 = distinct !{!29, !20}


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