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

; 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) #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_impl14hpdmatrixrcondEPNS_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_matrixES1_PNS_8ae_stateEb(ptr noundef %10, ptr noundef %24, ptr noundef %25, i1 noundef zeroext true)
  store ptr %10, ptr %5, align 8, !tbaa !5
  %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 = %146, %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 %149

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 = %142, %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 %145

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 %92

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 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %73, i32 0, i32 6
  %75 = load ptr, ptr %74, align 8, !tbaa !13
  %76 = load i64, ptr %11, align 8, !tbaa !9
  %77 = getelementptr inbounds ptr, ptr %75, i64 %76
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  %79 = load i64, ptr %11, align 8, !tbaa !9
  %80 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %78, i64 %79
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %80, i64 16, i1 false), !tbaa.struct !20
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %83 = load double, ptr %82, align 8
  %84 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %85 = load double, ptr %84, align 8
  %86 = call noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double %83, double %85, ptr noundef %81)
  %87 = fadd double %72, %86
  %88 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %89 = load ptr, ptr %88, align 8, !tbaa !13
  %90 = load i64, ptr %11, align 8, !tbaa !9
  %91 = getelementptr inbounds double, ptr %89, i64 %90
  store double %87, ptr %91, align 8, !tbaa !14
  br label %141

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

141:                                              ; preds = %92, %67
  br label %142

142:                                              ; preds = %141
  %143 = load i64, ptr %12, align 8, !tbaa !9
  %144 = add nsw i64 %143, 1
  store i64 %144, ptr %12, align 8, !tbaa !9
  br label %59, !llvm.loop !21

145:                                              ; preds = %59
  br label %146

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

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

150:                                              ; preds = %164, %149
  %151 = load i64, ptr %11, align 8, !tbaa !9
  %152 = load i64, ptr %6, align 8, !tbaa !9
  %153 = sub nsw i64 %152, 1
  %154 = icmp sle i64 %151, %153
  br i1 %154, label %155, label %167

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

164:                                              ; preds = %155
  %165 = load i64, ptr %11, align 8, !tbaa !9
  %166 = add nsw i64 %165, 1
  store i64 %166, ptr %11, align 8, !tbaa !9
  br label %150, !llvm.loop !23

167:                                              ; preds = %150
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = load i64, ptr %6, align 8, !tbaa !9
  %170 = load i8, ptr %7, align 1, !tbaa !11, !range !18, !noundef !19
  %171 = trunc i8 %170 to i1
  %172 = load ptr, ptr %8, align 8, !tbaa !5
  %173 = call noundef zeroext i1 @_ZN11alglib_impl17hpdmatrixcholeskyEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef %168, i64 noundef %169, i1 noundef zeroext %171, ptr noundef %172)
  br i1 %173, label %174, label %182

174:                                              ; preds = %167
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = load i64, ptr %6, align 8, !tbaa !9
  %177 = load i8, ptr %7, align 1, !tbaa !11, !range !18, !noundef !19
  %178 = trunc i8 %177 to i1
  %179 = load double, ptr %16, align 8, !tbaa !14
  %180 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_implL36rcond_hpdmatrixrcondcholeskyinternalEPNS_9ae_matrixElbbdPdPNS_8ae_stateE(ptr noundef %175, i64 noundef %176, i1 noundef zeroext %178, i1 noundef zeroext true, double noundef %179, ptr noundef %15, ptr noundef %180)
  %181 = load double, ptr %15, align 8, !tbaa !14
  store double %181, ptr %18, align 8, !tbaa !14
  br label %183

182:                                              ; preds = %167
  store double -1.000000e+00, ptr %18, align 8, !tbaa !14
  br label %183

183:                                              ; preds = %182, %174
  %184 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %184)
  %185 = 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 %185
}

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #4

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

declare void @_ZN11alglib_impl19ae_matrix_init_copyEPNS_9ae_matrixES1_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_hpdmatrixrcondcholeskyinternalEPNS_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: write) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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.1 }
%union.anon.1 = type { 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::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 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

; 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_impl14hpdmatrixrcondEPNS_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_matrixES1_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.not70 = icmp sgt i64 %1, 0
  br i1 %.not.not70, label %.lr.ph, label %._crit_edge82

.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 %.preheader69.unr-lcssa, label %.lr.ph.new

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

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

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

.preheader69:                                     ; preds = %.epil.preheader, %.preheader69.unr-lcssa
  %14 = add nsw i64 %1, -1
  br i1 %.not.not70, label %.lr.ph77, label %._crit_edge82

.lr.ph77:                                         ; preds = %.preheader69
  %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
  %.071 = 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 %.071
  store double 0.000000e+00, ptr %19, align 8, !tbaa !8
  %20 = or disjoint i64 %.071, 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 %.071, 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 %.071, 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 %.071, 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 %.preheader69.unr-lcssa, label %17, !llvm.loop !12

.preheader:                                       ; preds = %._crit_edge
  br i1 %.not.not70, label %.lr.ph81, label %._crit_edge82

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

31:                                               ; preds = %.lr.ph77, %._crit_edge
  %.176 = phi i64 [ 0, %.lr.ph77 ], [ %60, %._crit_edge ]
  %..1 = select i1 %2, i64 %14, i64 %.176
  %.1. = select i1 %2, i64 %.176, i64 0
  %.not72 = icmp sgt i64 %.1., %..1
  br i1 %.not72, label %._crit_edge, label %.lr.ph74

.lr.ph74:                                         ; preds = %31, %54
  %.06173 = phi i64 [ %59, %54 ], [ %.1., %31 ]
  %32 = icmp eq i64 %.176, %.06173
  %33 = load ptr, ptr %15, align 8, !tbaa !5
  %34 = getelementptr inbounds double, ptr %33, i64 %.176
  %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 %.176
  %38 = load ptr, ptr %37, align 8, !tbaa !14
  br i1 %32, label %39, label %41

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

41:                                               ; preds = %.lr.ph74
  %42 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %38, i64 %.06173
  %.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 %.176
  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 %.06173
  %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 %.176
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  %53 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %52, i64 %.06173
  br label %54

54:                                               ; preds = %39, %41
  %.sink91 = phi ptr [ %40, %39 ], [ %53, %41 ]
  %.sink89 = phi double [ %35, %39 ], [ %49, %41 ]
  %.176.sink = phi i64 [ %.176, %39 ], [ %.06173, %41 ]
  %.sroa.03.0.copyload = load double, ptr %.sink91, align 8, !tbaa !8
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %.sink91, 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 %.sink89, %55
  %57 = load ptr, ptr %15, align 8, !tbaa !5
  %58 = getelementptr inbounds double, ptr %57, i64 %.176.sink
  store double %56, ptr %58, align 8, !tbaa !8
  %59 = add nuw i64 %.06173, 1
  %exitcond84.not = icmp eq i64 %.06173, %..1
  br i1 %exitcond84.not, label %._crit_edge, label %.lr.ph74, !llvm.loop !16

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

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

._crit_edge82:                                    ; preds = %61, %4, %.preheader69, %.preheader
  %.064.lcssa = phi double [ 0.000000e+00, %.preheader ], [ 0.000000e+00, %.preheader69 ], [ 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_edge82
  call void @_ZN11alglib_implL36rcond_hpdmatrixrcondcholeskyinternalEPNS_9ae_matrixElbbdPdPNS_8ae_stateE(ptr noundef nonnull %6, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext true, double noundef %.064.lcssa, ptr noundef nonnull %7, ptr noundef %3)
  %69 = load double, ptr %7, align 8, !tbaa !8
  br label %70

70:                                               ; preds = %._crit_edge82, %68
  %.065 = phi double [ %69, %68 ], [ -1.000000e+00, %._crit_edge82 ]
  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 %.065
}

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #3

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

declare void @_ZN11alglib_impl19ae_matrix_init_copyEPNS_9ae_matrixES1_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_hpdmatrixrcondcholeskyinternalEPNS_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