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

; 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_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { 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 }

; 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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN11alglib_impl14hpdmatrixrcondEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.alglib_impl::ae_frame", align 8
  %10 = alloca %"struct.alglib_impl::ae_matrix", align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca %"struct.alglib_impl::ae_vector", align 8
  %18 = alloca double, align 8
  %19 = alloca %"struct.alglib_impl::ae_complex", align 8
  %20 = alloca %"struct.alglib_impl::ae_complex", align 8
  %21 = alloca %"struct.alglib_impl::ae_complex", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  %22 = zext i1 %2 to i8
  store i8 %22, ptr %7, align 1, !tbaa !11
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, 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 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %23, ptr noundef %9)
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 80, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 64, i1 false)
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl19ae_matrix_init_copyEPNS_9ae_matrixEPKS0_PNS_8ae_stateEb(ptr noundef %10, ptr noundef %24, ptr noundef %25, i1 noundef zeroext true)
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %17, i64 noundef 0, i64 noundef 3, ptr noundef %26, i1 noundef zeroext true)
  %27 = load i64, ptr %6, align 8, !tbaa !9
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %17, i64 noundef %27, ptr noundef %28)
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %29

29:                                               ; preds = %39, %4
  %30 = load i64, ptr %11, align 8, !tbaa !9
  %31 = load i64, ptr %6, align 8, !tbaa !9
  %32 = sub nsw i64 %31, 1
  %33 = icmp sle i64 %30, %32
  br i1 %33, label %34, label %42

34:                                               ; preds = %29
  %35 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %36 = load ptr, ptr %35, align 8, !tbaa !13
  %37 = load i64, ptr %11, align 8, !tbaa !9
  %38 = getelementptr inbounds double, ptr %36, i64 %37
  store double 0.000000e+00, ptr %38, align 8, !tbaa !14
  br label %39

39:                                               ; preds = %34
  %40 = load i64, ptr %11, align 8, !tbaa !9
  %41 = add nsw i64 %40, 1
  store i64 %41, ptr %11, align 8, !tbaa !9
  br label %29, !llvm.loop !16

42:                                               ; preds = %29
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %43

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

48:                                               ; preds = %43
  %49 = load i8, ptr %7, align 1, !tbaa !11, !range !18, !noundef !19
  %50 = trunc i8 %49 to i1
  br i1 %50, label %51, label %55

51:                                               ; preds = %48
  %52 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %52, ptr %13, align 8, !tbaa !9
  %53 = load i64, ptr %6, align 8, !tbaa !9
  %54 = sub nsw i64 %53, 1
  store i64 %54, ptr %14, align 8, !tbaa !9
  br label %57

55:                                               ; preds = %48
  store i64 0, ptr %13, align 8, !tbaa !9
  %56 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %56, ptr %14, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %55, %51
  %58 = load i64, ptr %13, align 8, !tbaa !9
  store i64 %58, ptr %12, align 8, !tbaa !9
  br label %59

59:                                               ; preds = %139, %57
  %60 = load i64, ptr %12, align 8, !tbaa !9
  %61 = load i64, ptr %14, align 8, !tbaa !9
  %62 = icmp sle i64 %60, %61
  br i1 %62, label %63, label %142

63:                                               ; preds = %59
  %64 = load i64, ptr %11, align 8, !tbaa !9
  %65 = load i64, ptr %12, align 8, !tbaa !9
  %66 = icmp eq i64 %64, %65
  br i1 %66, label %67, label %91

67:                                               ; preds = %63
  %68 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %69 = load ptr, ptr %68, align 8, !tbaa !13
  %70 = load i64, ptr %11, align 8, !tbaa !9
  %71 = getelementptr inbounds double, ptr %69, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !14
  %73 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %10, i32 0, i32 6
  %74 = load ptr, ptr %73, align 8, !tbaa !13
  %75 = load i64, ptr %11, align 8, !tbaa !9
  %76 = getelementptr inbounds ptr, ptr %74, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = load i64, ptr %11, align 8, !tbaa !9
  %79 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %77, i64 %78
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %79, i64 16, i1 false), !tbaa.struct !20
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %82 = load double, ptr %81, align 8
  %83 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %84 = load double, ptr %83, align 8
  %85 = call noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double %82, double %84, ptr noundef %80)
  %86 = fadd double %72, %85
  %87 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %88 = load ptr, ptr %87, align 8, !tbaa !13
  %89 = load i64, ptr %11, align 8, !tbaa !9
  %90 = getelementptr inbounds double, ptr %88, i64 %89
  store double %86, ptr %90, align 8, !tbaa !14
  br label %138

91:                                               ; preds = %63
  %92 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %93 = load ptr, ptr %92, align 8, !tbaa !13
  %94 = load i64, ptr %11, align 8, !tbaa !9
  %95 = getelementptr inbounds double, ptr %93, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !14
  %97 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %10, i32 0, i32 6
  %98 = load ptr, ptr %97, align 8, !tbaa !13
  %99 = load i64, ptr %11, 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 %12, align 8, !tbaa !9
  %103 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %101, i64 %102
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %103, i64 16, i1 false), !tbaa.struct !20
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %106 = load double, ptr %105, align 8
  %107 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %108 = load double, ptr %107, align 8
  %109 = call noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double %106, double %108, ptr noundef %104)
  %110 = fadd double %96, %109
  %111 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %112 = load ptr, ptr %111, align 8, !tbaa !13
  %113 = load i64, ptr %11, align 8, !tbaa !9
  %114 = getelementptr inbounds double, ptr %112, i64 %113
  store double %110, ptr %114, align 8, !tbaa !14
  %115 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %116 = load ptr, ptr %115, align 8, !tbaa !13
  %117 = load i64, ptr %12, align 8, !tbaa !9
  %118 = getelementptr inbounds double, ptr %116, i64 %117
  %119 = load double, ptr %118, align 8, !tbaa !14
  %120 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %10, i32 0, i32 6
  %121 = load ptr, ptr %120, align 8, !tbaa !13
  %122 = load i64, ptr %11, align 8, !tbaa !9
  %123 = getelementptr inbounds ptr, ptr %121, i64 %122
  %124 = load ptr, ptr %123, align 8, !tbaa !5
  %125 = load i64, ptr %12, align 8, !tbaa !9
  %126 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %124, i64 %125
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %126, i64 16, i1 false), !tbaa.struct !20
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %129 = load double, ptr %128, align 8
  %130 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %131 = load double, ptr %130, align 8
  %132 = call noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double %129, double %131, ptr noundef %127)
  %133 = fadd double %119, %132
  %134 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %135 = load ptr, ptr %134, align 8, !tbaa !13
  %136 = load i64, ptr %12, align 8, !tbaa !9
  %137 = getelementptr inbounds double, ptr %135, i64 %136
  store double %133, ptr %137, align 8, !tbaa !14
  br label %138

138:                                              ; preds = %91, %67
  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 %59, !llvm.loop !21

142:                                              ; preds = %59
  br label %143

143:                                              ; preds = %142
  %144 = load i64, ptr %11, align 8, !tbaa !9
  %145 = add nsw i64 %144, 1
  store i64 %145, ptr %11, align 8, !tbaa !9
  br label %43, !llvm.loop !22

146:                                              ; preds = %43
  store double 0.000000e+00, ptr %16, align 8, !tbaa !14
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %147

147:                                              ; preds = %161, %146
  %148 = load i64, ptr %11, align 8, !tbaa !9
  %149 = load i64, ptr %6, align 8, !tbaa !9
  %150 = sub nsw i64 %149, 1
  %151 = icmp sle i64 %148, %150
  br i1 %151, label %152, label %164

152:                                              ; preds = %147
  %153 = load double, ptr %16, align 8, !tbaa !14
  %154 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %155 = load ptr, ptr %154, align 8, !tbaa !13
  %156 = load i64, ptr %11, align 8, !tbaa !9
  %157 = getelementptr inbounds double, ptr %155, i64 %156
  %158 = load double, ptr %157, align 8, !tbaa !14
  %159 = load ptr, ptr %8, align 8, !tbaa !5
  %160 = call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %153, double noundef %158, ptr noundef %159)
  store double %160, ptr %16, align 8, !tbaa !14
  br label %161

161:                                              ; preds = %152
  %162 = load i64, ptr %11, align 8, !tbaa !9
  %163 = add nsw i64 %162, 1
  store i64 %163, ptr %11, align 8, !tbaa !9
  br label %147, !llvm.loop !23

164:                                              ; preds = %147
  %165 = load i64, ptr %6, align 8, !tbaa !9
  %166 = load i8, ptr %7, align 1, !tbaa !11, !range !18, !noundef !19
  %167 = trunc i8 %166 to i1
  %168 = load ptr, ptr %8, align 8, !tbaa !5
  %169 = call noundef zeroext i1 @_ZN11alglib_impl17hpdmatrixcholeskyEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef %10, i64 noundef %165, i1 noundef zeroext %167, ptr noundef %168)
  br i1 %169, label %170, label %177

170:                                              ; preds = %164
  %171 = load i64, ptr %6, align 8, !tbaa !9
  %172 = load i8, ptr %7, align 1, !tbaa !11, !range !18, !noundef !19
  %173 = trunc i8 %172 to i1
  %174 = load double, ptr %16, align 8, !tbaa !14
  %175 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_implL36rcond_hpdmatrixrcondcholeskyinternalEPKNS_9ae_matrixElbbdPdPNS_8ae_stateE(ptr noundef %10, i64 noundef %171, i1 noundef zeroext %173, i1 noundef zeroext true, double noundef %174, ptr noundef %15, ptr noundef %175)
  %176 = load double, ptr %15, align 8, !tbaa !14
  store double %176, ptr %18, align 8, !tbaa !14
  br label %178

177:                                              ; preds = %164
  store double -1.000000e+00, ptr %18, align 8, !tbaa !14
  br label %178

178:                                              ; preds = %177, %170
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %179)
  %180 = load double, ptr %18, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #5
  ret double %180
}

declare noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) #4

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #4

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

declare void @_ZN11alglib_impl19ae_matrix_init_copyEPNS_9ae_matrixEPKS0_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #4

declare noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double, double, ptr noundef) #4

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

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 = { 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 = { "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 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{i64 0, i64 8, !14, i64 8, i64 8, !14}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !17}


; 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_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { 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 }

; 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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11alglib_impl17hpdmatrixcholeskyEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN11alglib_impl14hpdmatrixrcondEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %3) local_unnamed_addr #2 {
  %5 = alloca %"struct.alglib_impl::ae_frame", align 8
  %6 = alloca %"struct.alglib_impl::ae_matrix", align 8
  %7 = alloca double, align 8
  %8 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %3, ptr noundef nonnull %5)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %6, i8 0, i64 80, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %8, i8 0, i64 64, i1 false)
  call void @_ZN11alglib_impl19ae_matrix_init_copyEPNS_9ae_matrixEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %6, ptr noundef %0, ptr noundef %3, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %8, i64 noundef 0, i64 noundef 3, ptr noundef %3, i1 noundef zeroext true)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %1, ptr noundef %3)
  %.not.not65 = icmp sgt i64 %1, 0
  br i1 %.not.not65, label %.lr.ph, label %._crit_edge77

.lr.ph:                                           ; preds = %4
  %9 = getelementptr inbounds i8, ptr %8, i64 56
  %xtraiter = and i64 %1, 3
  %10 = icmp ult i64 %1, 4
  br i1 %10, label %.preheader64.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %1, 9223372036854775804
  br label %17

.preheader64.unr-lcssa:                           ; preds = %17, %.lr.ph
  %.066.unr = phi i64 [ 0, %.lr.ph ], [ %29, %17 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader64, label %.epil.preheader

.epil.preheader:                                  ; preds = %.preheader64.unr-lcssa, %.epil.preheader
  %.066.epil = phi i64 [ %13, %.epil.preheader ], [ %.066.unr, %.preheader64.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.preheader64.unr-lcssa ]
  %11 = load ptr, ptr %9, align 8, !tbaa !5
  %12 = getelementptr inbounds double, ptr %11, i64 %.066.epil
  store double 0.000000e+00, ptr %12, align 8, !tbaa !8
  %13 = add nuw nsw i64 %.066.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 %.preheader64, label %.epil.preheader, !llvm.loop !10

.preheader64:                                     ; preds = %.epil.preheader, %.preheader64.unr-lcssa
  %14 = add nsw i64 %1, -1
  br i1 %.not.not65, label %.lr.ph72, label %._crit_edge77

.lr.ph72:                                         ; preds = %.preheader64
  %15 = getelementptr inbounds i8, ptr %8, i64 56
  %16 = getelementptr inbounds i8, ptr %6, i64 72
  br label %31

17:                                               ; preds = %17, %.lr.ph.new
  %.066 = phi i64 [ 0, %.lr.ph.new ], [ %29, %17 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %17 ]
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = getelementptr inbounds double, ptr %18, i64 %.066
  store double 0.000000e+00, ptr %19, align 8, !tbaa !8
  %20 = or disjoint i64 %.066, 1
  %21 = load ptr, ptr %9, align 8, !tbaa !5
  %22 = getelementptr inbounds double, ptr %21, i64 %20
  store double 0.000000e+00, ptr %22, align 8, !tbaa !8
  %23 = or disjoint i64 %.066, 2
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = getelementptr inbounds double, ptr %24, i64 %23
  store double 0.000000e+00, ptr %25, align 8, !tbaa !8
  %26 = or disjoint i64 %.066, 3
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = getelementptr inbounds double, ptr %27, i64 %26
  store double 0.000000e+00, ptr %28, align 8, !tbaa !8
  %29 = add nuw nsw i64 %.066, 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 %.preheader64.unr-lcssa, label %17, !llvm.loop !12

.preheader:                                       ; preds = %._crit_edge
  br i1 %.not.not65, label %.lr.ph76, label %._crit_edge77

.lr.ph76:                                         ; preds = %.preheader
  %30 = getelementptr inbounds i8, ptr %8, i64 56
  br label %61

31:                                               ; preds = %.lr.ph72, %._crit_edge
  %.171 = phi i64 [ 0, %.lr.ph72 ], [ %60, %._crit_edge ]
  %..1 = select i1 %2, i64 %14, i64 %.171
  %.1. = select i1 %2, i64 %.171, i64 0
  %.not67 = icmp sgt i64 %.1., %..1
  br i1 %.not67, label %._crit_edge, label %.lr.ph69

.lr.ph69:                                         ; preds = %31, %54
  %.05668 = phi i64 [ %59, %54 ], [ %.1., %31 ]
  %32 = icmp eq i64 %.171, %.05668
  %33 = load ptr, ptr %15, align 8, !tbaa !5
  %34 = getelementptr inbounds double, ptr %33, i64 %.171
  %35 = load double, ptr %34, align 8, !tbaa !8
  %36 = load ptr, ptr %16, align 8, !tbaa !5
  %37 = getelementptr inbounds ptr, ptr %36, i64 %.171
  %38 = load ptr, ptr %37, align 8, !tbaa !14
  br i1 %32, label %39, label %41

39:                                               ; preds = %.lr.ph69
  %40 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %38, i64 %.171
  br label %54

41:                                               ; preds = %.lr.ph69
  %42 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %38, i64 %.05668
  %.sroa.01.0.copyload = load double, ptr %42, align 8, !tbaa !8
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %42, i64 8
  %.sroa.22.0.copyload = load double, ptr %.sroa.22.0..sroa_idx, align 8, !tbaa !8
  %43 = call noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double %.sroa.01.0.copyload, double %.sroa.22.0.copyload, ptr noundef %3)
  %44 = fadd double %35, %43
  %45 = load ptr, ptr %15, align 8, !tbaa !5
  %46 = getelementptr inbounds double, ptr %45, i64 %.171
  store double %44, ptr %46, align 8, !tbaa !8
  %47 = load ptr, ptr %15, align 8, !tbaa !5
  %48 = getelementptr inbounds double, ptr %47, i64 %.05668
  %49 = load double, ptr %48, align 8, !tbaa !8
  %50 = load ptr, ptr %16, align 8, !tbaa !5
  %51 = getelementptr inbounds ptr, ptr %50, i64 %.171
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  %53 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %52, i64 %.05668
  br label %54

54:                                               ; preds = %39, %41
  %.sink86 = phi ptr [ %40, %39 ], [ %53, %41 ]
  %.sink84 = phi double [ %35, %39 ], [ %49, %41 ]
  %.171.sink = phi i64 [ %.171, %39 ], [ %.05668, %41 ]
  %.sroa.03.0.copyload = load double, ptr %.sink86, align 8, !tbaa !8
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %.sink86, i64 8
  %.sroa.24.0.copyload = load double, ptr %.sroa.24.0..sroa_idx, align 8, !tbaa !8
  %55 = call noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double %.sroa.03.0.copyload, double %.sroa.24.0.copyload, ptr noundef %3)
  %56 = fadd double %.sink84, %55
  %57 = load ptr, ptr %15, align 8, !tbaa !5
  %58 = getelementptr inbounds double, ptr %57, i64 %.171.sink
  store double %56, ptr %58, align 8, !tbaa !8
  %59 = add nuw i64 %.05668, 1
  %exitcond79.not = icmp eq i64 %.05668, %..1
  br i1 %exitcond79.not, label %._crit_edge, label %.lr.ph69, !llvm.loop !16

._crit_edge:                                      ; preds = %54, %31
  %60 = add nuw nsw i64 %.171, 1
  %exitcond80.not = icmp eq i64 %60, %1
  br i1 %exitcond80.not, label %.preheader, label %31, !llvm.loop !17

61:                                               ; preds = %.lr.ph76, %61
  %.275 = phi i64 [ 0, %.lr.ph76 ], [ %66, %61 ]
  %.05974 = phi double [ 0.000000e+00, %.lr.ph76 ], [ %65, %61 ]
  %62 = load ptr, ptr %30, align 8, !tbaa !5
  %63 = getelementptr inbounds double, ptr %62, i64 %.275
  %64 = load double, ptr %63, align 8, !tbaa !8
  %65 = call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %.05974, double noundef %64, ptr noundef %3)
  %66 = add nuw nsw i64 %.275, 1
  %exitcond81.not = icmp eq i64 %66, %1
  br i1 %exitcond81.not, label %._crit_edge77, label %61, !llvm.loop !18

._crit_edge77:                                    ; preds = %61, %4, %.preheader64, %.preheader
  %.059.lcssa = phi double [ 0.000000e+00, %.preheader ], [ 0.000000e+00, %.preheader64 ], [ 0.000000e+00, %4 ], [ %65, %61 ]
  %67 = call noundef zeroext i1 @_ZN11alglib_impl17hpdmatrixcholeskyEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef nonnull %6, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %3)
  br i1 %67, label %68, label %70

68:                                               ; preds = %._crit_edge77
  call void @_ZN11alglib_implL36rcond_hpdmatrixrcondcholeskyinternalEPKNS_9ae_matrixElbbdPdPNS_8ae_stateE(ptr noundef nonnull %6, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext true, double noundef %.059.lcssa, ptr noundef nonnull %7, ptr noundef %3)
  %69 = load double, ptr %7, align 8, !tbaa !8
  br label %70

70:                                               ; preds = %._crit_edge77, %68
  %.060 = phi double [ %69, %68 ], [ -1.000000e+00, %._crit_edge77 ]
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  ret double %.060
}

declare noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) local_unnamed_addr #3

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #3

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

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

declare noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double, double, ptr noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"double", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.unroll.disable"}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !6, i64 0}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}


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