; 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_complex" = type { double, double }
%"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.497 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.498 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.499 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.500 = external hidden unnamed_addr constant [58 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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

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

65:                                               ; preds = %5
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %66, i32 0, i32 2
  %68 = load double, ptr %67, align 8, !tbaa !23
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %69)
  %71 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %68, double noundef %70)
  br i1 %71, label %72, label %151

72:                                               ; preds = %65, %5
  %73 = load i8, ptr %8, align 1, !tbaa !11, !range !17, !noundef !18
  %74 = trunc i8 %73 to i1
  br i1 %74, label %75, label %110

75:                                               ; preds = %72
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %76

76:                                               ; preds = %106, %75
  %77 = load i64, ptr %12, align 8, !tbaa !9
  %78 = load i64, ptr %7, align 8, !tbaa !9
  %79 = sub nsw i64 %78, 1
  %80 = icmp sle i64 %77, %79
  br i1 %80, label %81, label %109

81:                                               ; preds = %76
  %82 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %82, ptr %13, align 8, !tbaa !9
  br label %83

83:                                               ; preds = %102, %81
  %84 = load i64, ptr %13, align 8, !tbaa !9
  %85 = load i64, ptr %7, align 8, !tbaa !9
  %86 = sub nsw i64 %85, 1
  %87 = icmp sle i64 %84, %86
  br i1 %87, label %88, label %105

88:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  %89 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %90 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %91 = extractvalue { double, double } %89, 0
  store double %91, ptr %90, align 8
  %92 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %93 = extractvalue { double, double } %89, 1
  store double %93, ptr %92, align 8
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %94, i32 0, i32 6
  %96 = load ptr, ptr %95, align 8, !tbaa !24
  %97 = load i64, ptr %12, align 8, !tbaa !9
  %98 = getelementptr inbounds ptr, ptr %96, i64 %97
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  %100 = load i64, ptr %13, align 8, !tbaa !9
  %101 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %99, i64 %100
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %101, ptr align 8 %15, i64 16, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  br label %102

102:                                              ; preds = %88
  %103 = load i64, ptr %13, align 8, !tbaa !9
  %104 = add nsw i64 %103, 1
  store i64 %104, ptr %13, align 8, !tbaa !9
  br label %83, !llvm.loop !27

105:                                              ; preds = %83
  br label %106

106:                                              ; preds = %105
  %107 = load i64, ptr %12, align 8, !tbaa !9
  %108 = add nsw i64 %107, 1
  store i64 %108, ptr %12, align 8, !tbaa !9
  br label %76, !llvm.loop !29

109:                                              ; preds = %76
  br label %143

110:                                              ; preds = %72
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %111

111:                                              ; preds = %139, %110
  %112 = load i64, ptr %12, align 8, !tbaa !9
  %113 = load i64, ptr %7, align 8, !tbaa !9
  %114 = sub nsw i64 %113, 1
  %115 = icmp sle i64 %112, %114
  br i1 %115, label %116, label %142

116:                                              ; preds = %111
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %117

117:                                              ; preds = %135, %116
  %118 = load i64, ptr %13, align 8, !tbaa !9
  %119 = load i64, ptr %12, align 8, !tbaa !9
  %120 = icmp sle i64 %118, %119
  br i1 %120, label %121, label %138

121:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  %122 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %123 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %124 = extractvalue { double, double } %122, 0
  store double %124, ptr %123, align 8
  %125 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %126 = extractvalue { double, double } %122, 1
  store double %126, ptr %125, align 8
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %127, i32 0, i32 6
  %129 = load ptr, ptr %128, align 8, !tbaa !24
  %130 = load i64, ptr %12, align 8, !tbaa !9
  %131 = getelementptr inbounds ptr, ptr %129, i64 %130
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = load i64, ptr %13, align 8, !tbaa !9
  %134 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %132, i64 %133
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %134, ptr align 8 %16, i64 16, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  br label %135

135:                                              ; preds = %121
  %136 = load i64, ptr %13, align 8, !tbaa !9
  %137 = add nsw i64 %136, 1
  store i64 %137, ptr %13, align 8, !tbaa !9
  br label %117, !llvm.loop !30

138:                                              ; preds = %117
  br label %139

139:                                              ; preds = %138
  %140 = load i64, ptr %12, align 8, !tbaa !9
  %141 = add nsw i64 %140, 1
  store i64 %141, ptr %12, align 8, !tbaa !9
  br label %111, !llvm.loop !31

142:                                              ; preds = %111
  br label %143

143:                                              ; preds = %142, %109
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %144, i32 0, i32 1
  store double 0.000000e+00, ptr %145, align 8, !tbaa !22
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %146, i32 0, i32 2
  store double 0.000000e+00, ptr %147, align 8, !tbaa !23
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %148, i32 0, i32 0
  store i64 -3, ptr %149, align 8, !tbaa !19
  %150 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %150)
  store i32 1, ptr %17, align 4
  br label %161

151:                                              ; preds = %65
  %152 = load i64, ptr %7, align 8, !tbaa !9
  %153 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %14, i64 noundef %152, ptr noundef %153)
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = load i64, ptr %7, align 8, !tbaa !9
  %156 = load i8, ptr %8, align 1, !tbaa !11, !range !17, !noundef !18
  %157 = trunc i8 %156 to i1
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_implL34matinv_hpdmatrixcholeskyinverserecEPNS_9ae_matrixEllbPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %154, i64 noundef 0, i64 noundef %155, i1 noundef zeroext %157, ptr noundef %14, ptr noundef %158, ptr noundef %159)
  %160 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %160)
  store i32 0, ptr %17, align 4
  br label %161

161:                                              ; preds = %151, %143
  call void @llvm.lifetime.end.p0(i64 64, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  %162 = load i32, ptr %17, align 4
  switch i32 %162, label %164 [
    i32 0, label %163
    i32 1, label %163
  ]

163:                                              ; preds = %161, %161
  ret void

164:                                              ; preds = %161
  unreachable
}

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

declare { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef) #3

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #3

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

declare noundef zeroext i1 @_ZN11alglib_impl17isfinitectrmatrixEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr noundef) #3

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = { 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 #5 = { 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 = !{i64 0, i64 8, !26, i64 8, i64 8, !26}
!26 = !{!21, !21, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = distinct !{!30, !28}
!31 = distinct !{!31, !28}


; 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 }
%"struct.alglib_impl::ae_complex" = type { double, double }

@.str.497 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.498 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.499 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.500 = external hidden unnamed_addr constant [58 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_impl22hpdmatrixcholeskyrcondEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl24hpdmatrixcholeskyinverseEPNS_9ae_matrixElbPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #3 {
  %6 = alloca %"struct.alglib_impl::ae_frame", align 8
  %7 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %4, ptr noundef nonnull %6)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %7, i8 0, i64 64, i1 false)
  call void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %3)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %7, i64 noundef 0, i64 noundef 4, ptr noundef %4, i1 noundef zeroext true)
  %8 = icmp sgt i64 %1, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %8, ptr noundef nonnull @.str.497, ptr noundef %4)
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = load i64, ptr %9, align 8, !tbaa !5
  %11 = icmp sge i64 %10, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %11, ptr noundef nonnull @.str.498, ptr noundef %4)
  %12 = load i64, ptr %0, align 8, !tbaa !13
  %13 = icmp sge i64 %12, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %13, ptr noundef nonnull @.str.499, ptr noundef %4)
  %14 = call noundef zeroext i1 @_ZN11alglib_impl17isfinitectrmatrixEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %4)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.500, ptr noundef %4)
  store i64 1, ptr %3, align 8, !tbaa !14
  %15 = call noundef double @_ZN11alglib_impl22hpdmatrixcholeskyrcondEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %4)
  %16 = getelementptr inbounds i8, ptr %3, i64 8
  store double %15, ptr %16, align 8, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %3, i64 16
  store double %15, ptr %17, align 8, !tbaa !18
  %18 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %4)
  %19 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %15, double noundef %18)
  br i1 %19, label %24, label %20

20:                                               ; preds = %5
  %21 = load double, ptr %17, align 8, !tbaa !18
  %22 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %4)
  %23 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %21, double noundef %22)
  br i1 %23, label %24, label %49

24:                                               ; preds = %20, %5
  br i1 %2, label %.preheader66, label %.preheader68

.preheader68:                                     ; preds = %24
  br i1 %8, label %.preheader67.lr.ph, label %.loopexit

.preheader67.lr.ph:                               ; preds = %.preheader68
  %25 = getelementptr inbounds i8, ptr %0, i64 72
  br label %.preheader67

.preheader66:                                     ; preds = %24
  br i1 %8, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %.preheader66
  %26 = getelementptr inbounds i8, ptr %0, i64 72
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %36
  %.075 = phi i64 [ 0, %.preheader.lr.ph ], [ %37, %36 ]
  br label %27

27:                                               ; preds = %.preheader, %27
  %.06173 = phi i64 [ %.075, %.preheader ], [ %35, %27 ]
  %28 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %29 = extractvalue { double, double } %28, 0
  %30 = extractvalue { double, double } %28, 1
  %31 = load ptr, ptr %26, align 8, !tbaa !19
  %32 = getelementptr inbounds ptr, ptr %31, i64 %.075
  %33 = load ptr, ptr %32, align 8, !tbaa !20
  %34 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %33, i64 %.06173
  store double %29, ptr %34, align 8, !tbaa !21
  %.sroa.42.0..sroa_idx = getelementptr inbounds i8, ptr %34, i64 8
  store double %30, ptr %.sroa.42.0..sroa_idx, align 8, !tbaa !21
  %35 = add nuw nsw i64 %.06173, 1
  %.not65.not = icmp slt i64 %35, %1
  br i1 %.not65.not, label %27, label %36, !llvm.loop !22

36:                                               ; preds = %27
  %37 = add nuw nsw i64 %.075, 1
  %exitcond79.not = icmp eq i64 %37, %1
  br i1 %exitcond79.not, label %.loopexit, label %.preheader, !llvm.loop !24

.preheader67:                                     ; preds = %.preheader67.lr.ph, %47
  %indvars.iv = phi i64 [ 1, %.preheader67.lr.ph ], [ %indvars.iv.next, %47 ]
  %.172 = phi i64 [ 0, %.preheader67.lr.ph ], [ %48, %47 ]
  br label %38

38:                                               ; preds = %.preheader67, %38
  %.16270 = phi i64 [ 0, %.preheader67 ], [ %46, %38 ]
  %39 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %40 = extractvalue { double, double } %39, 0
  %41 = extractvalue { double, double } %39, 1
  %42 = load ptr, ptr %25, align 8, !tbaa !19
  %43 = getelementptr inbounds ptr, ptr %42, i64 %.172
  %44 = load ptr, ptr %43, align 8, !tbaa !20
  %45 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %44, i64 %.16270
  store double %40, ptr %45, align 8, !tbaa !21
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %45, i64 8
  store double %41, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !21
  %46 = add nuw nsw i64 %.16270, 1
  %exitcond.not = icmp eq i64 %46, %indvars.iv
  br i1 %exitcond.not, label %47, label %38, !llvm.loop !25

47:                                               ; preds = %38
  %48 = add nuw nsw i64 %.172, 1
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  %exitcond78.not = icmp eq i64 %48, %1
  br i1 %exitcond78.not, label %.loopexit, label %.preheader67, !llvm.loop !26

.loopexit:                                        ; preds = %47, %36, %.preheader68, %.preheader66
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %16, i8 0, i64 16, i1 false)
  store i64 -3, ptr %3, align 8, !tbaa !14
  br label %50

49:                                               ; preds = %20
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %7, i64 noundef %1, ptr noundef %4)
  call void @_ZN11alglib_implL34matinv_hpdmatrixcholeskyinverserecEPNS_9ae_matrixEllbPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef 0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef nonnull %7, ptr noundef nonnull %3, ptr noundef %4)
  br label %50

50:                                               ; preds = %49, %.loopexit
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  ret void
}

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

declare { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 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_impl17isfinitectrmatrixEPKNS_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_implL34matinv_hpdmatrixcholeskyinverserecEPNS_9ae_matrixEllbPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, 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, !23}
!25 = distinct !{!25, !23}
!26 = distinct !{!26, !23}


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