; 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::sparsedecompositionanalysis" = type { i64, i64, i64, %"struct.alglib_impl::spcholanalysis", %"struct.alglib_impl::sparsematrix", %"struct.alglib_impl::sparsematrix", %"struct.alglib_impl::sparsematrix", %"struct.alglib_impl::sparsematrix" }
%"struct.alglib_impl::spcholanalysis" = type { i64, i64, i64, i8, i64, double, double, double, double, %"struct.alglib_impl::ae_vector", i8, i8, i8, i8, i8, %"struct.alglib_impl::ae_vector", i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i8, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i8, i8, %"struct.alglib_impl::spcholadj", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_nxpool", %"struct.alglib_impl::ae_nxpool", %"struct.alglib_impl::ae_nxpool", %"struct.alglib_impl::ae_nxpool", %"struct.alglib_impl::ae_nxpool", %"struct.alglib_impl::ae_nxpool", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::amdbuffer", %"struct.alglib_impl::priorityamdbuffers", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::sparsematrix", %"struct.alglib_impl::sparsematrix", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector" }
%"struct.alglib_impl::spcholadj" = type { %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector" }
%"struct.alglib_impl::ae_nxpool" = type { i64, i64, i64, i64, %"struct.alglib_impl::ae_dyn_block", %"struct.alglib_impl::ae_lock", %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_lock" = type { ptr, %"struct.alglib_impl::ae_dyn_block", i8 }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::amdbuffer" = type { i64, i8, i8, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::amdknset", %"struct.alglib_impl::amdknset", %"struct.alglib_impl::amdknset", %"struct.alglib_impl::amdllmatrix", %"struct.alglib_impl::amdvertexset", %"struct.alglib_impl::niset", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::niset", %"struct.alglib_impl::niset", %"struct.alglib_impl::niset", %"struct.alglib_impl::niset", %"struct.alglib_impl::niset", %"struct.alglib_impl::niset", %"struct.alglib_impl::ae_vector", i64, %"struct.alglib_impl::niset", %"struct.alglib_impl::niset", %"struct.alglib_impl::amdknset", %"struct.alglib_impl::niset", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_matrix" }
%"struct.alglib_impl::amdllmatrix" = type { i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64 }
%"struct.alglib_impl::amdvertexset" = type { i64, i8, i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector" }
%"struct.alglib_impl::amdknset" = type { i64, i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64, i64, i64 }
%"struct.alglib_impl::niset" = type { i64, i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64 }
%"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::priorityamdbuffers" = type { %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::amdbuffer", %"struct.alglib_impl::sparsematrix", %"struct.alglib_impl::sparsematrix", %"struct.alglib_impl::sparsematrix", %"struct.alglib_impl::sparsematrix", %"struct.alglib_impl::sparsematrix" }
%"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::sparsematrix" = type { %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64, i64, i64, i64, i64, i64 }

; 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: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl25sparsecopytransposecrsbufEPKNS_12sparsematrixEPS0_PNS_8ae_stateE(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN11alglib_impl23sparsecholeskyfactorizeEPNS_27sparsedecompositionanalysisEbPNS_12sparsematrixEPNS_9ae_vectorES5_PNS_8ae_stateE(ptr noundef %0, i1 noundef zeroext %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #1 {
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  %16 = zext i1 %1 to i8
  store i8 %16, ptr %9, align 1, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #3
  %17 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl19_sparsematrix_clearEPv(ptr noundef %17)
  %18 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %18)
  %19 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %19)
  %20 = load i8, ptr %9, align 1, !tbaa !9, !range !11, !noundef !12
  %21 = trunc i8 %20 to i1
  br i1 %21, label %22, label %45

22:                                               ; preds = %6
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.alglib_impl::sparsedecompositionanalysis", ptr %23, i32 0, i32 3
  %25 = load ptr, ptr %13, align 8, !tbaa !5
  %26 = call noundef zeroext i1 @_ZN11alglib_impl15spsymmfactorizeEPNS_14spcholanalysisEPNS_8ae_stateE(ptr noundef %24, ptr noundef %25)
  %27 = zext i1 %26 to i8
  store i8 %27, ptr %14, align 1, !tbaa !9
  %28 = load i8, ptr %14, align 1, !tbaa !9, !range !11, !noundef !12
  %29 = trunc i8 %28 to i1
  br i1 %29, label %33, label %30

30:                                               ; preds = %22
  %31 = load i8, ptr %14, align 1, !tbaa !9, !range !11, !noundef !12
  %32 = trunc i8 %31 to i1
  store i1 %32, ptr %7, align 1
  store i32 1, ptr %15, align 4
  br label %66

33:                                               ; preds = %22
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.alglib_impl::sparsedecompositionanalysis", ptr %34, i32 0, i32 3
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.alglib_impl::sparsedecompositionanalysis", ptr %36, i32 0, i32 4
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN11alglib_impl13spsymmextractEPNS_14spcholanalysisEPNS_12sparsematrixEPNS_9ae_vectorES5_PNS_8ae_stateE(ptr noundef %35, ptr noundef %37, ptr noundef %38, ptr noundef %39, ptr noundef %40)
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.alglib_impl::sparsedecompositionanalysis", ptr %41, i32 0, i32 4
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN11alglib_impl25sparsecopytransposecrsbufEPKNS_12sparsematrixEPS0_PNS_8ae_stateE(ptr noundef %42, ptr noundef %43, ptr noundef %44)
  br label %63

45:                                               ; preds = %6
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.alglib_impl::sparsedecompositionanalysis", ptr %46, i32 0, i32 3
  %48 = load ptr, ptr %13, align 8, !tbaa !5
  %49 = call noundef zeroext i1 @_ZN11alglib_impl15spsymmfactorizeEPNS_14spcholanalysisEPNS_8ae_stateE(ptr noundef %47, ptr noundef %48)
  %50 = zext i1 %49 to i8
  store i8 %50, ptr %14, align 1, !tbaa !9
  %51 = load i8, ptr %14, align 1, !tbaa !9, !range !11, !noundef !12
  %52 = trunc i8 %51 to i1
  br i1 %52, label %56, label %53

53:                                               ; preds = %45
  %54 = load i8, ptr %14, align 1, !tbaa !9, !range !11, !noundef !12
  %55 = trunc i8 %54 to i1
  store i1 %55, ptr %7, align 1
  store i32 1, ptr %15, align 4
  br label %66

56:                                               ; preds = %45
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.alglib_impl::sparsedecompositionanalysis", ptr %57, i32 0, i32 3
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN11alglib_impl13spsymmextractEPNS_14spcholanalysisEPNS_12sparsematrixEPNS_9ae_vectorES5_PNS_8ae_stateE(ptr noundef %58, ptr noundef %59, ptr noundef %60, ptr noundef %61, ptr noundef %62)
  br label %63

63:                                               ; preds = %56, %33
  %64 = load i8, ptr %14, align 1, !tbaa !9, !range !11, !noundef !12
  %65 = trunc i8 %64 to i1
  store i1 %65, ptr %7, align 1
  store i32 1, ptr %15, align 4
  br label %66

66:                                               ; preds = %63, %53, %30
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #3
  %67 = load i1, ptr %7, align 1
  ret i1 %67
}

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) #2

declare void @_ZN11alglib_impl19_sparsematrix_clearEPv(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11alglib_impl15spsymmfactorizeEPNS_14spcholanalysisEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl13spsymmextractEPNS_14spcholanalysisEPNS_12sparsematrixEPNS_9ae_vectorES5_PNS_8ae_stateE(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}


; 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"

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl25sparsecopytransposecrsbufEPKNS_12sparsematrixEPS0_PNS_8ae_stateE(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN11alglib_impl23sparsecholeskyfactorizeEPNS_27sparsedecompositionanalysisEbPNS_12sparsematrixEPNS_9ae_vectorES5_PNS_8ae_stateE(ptr noundef %0, i1 noundef zeroext %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #0 {
  tail call void @_ZN11alglib_impl19_sparsematrix_clearEPv(ptr noundef %2)
  tail call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %3)
  tail call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %4)
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  %8 = tail call noundef zeroext i1 @_ZN11alglib_impl15spsymmfactorizeEPNS_14spcholanalysisEPNS_8ae_stateE(ptr noundef nonnull %7, ptr noundef %5)
  br i1 %1, label %9, label %12

9:                                                ; preds = %6
  br i1 %8, label %10, label %14

10:                                               ; preds = %9
  %11 = getelementptr inbounds i8, ptr %0, i64 15088
  tail call void @_ZN11alglib_impl13spsymmextractEPNS_14spcholanalysisEPNS_12sparsematrixEPNS_9ae_vectorES5_PNS_8ae_stateE(ptr noundef nonnull %7, ptr noundef nonnull %11, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  tail call void @_ZN11alglib_impl25sparsecopytransposecrsbufEPKNS_12sparsematrixEPS0_PNS_8ae_stateE(ptr noundef nonnull %11, ptr noundef %2, ptr noundef %5)
  br label %14

12:                                               ; preds = %6
  br i1 %8, label %13, label %14

13:                                               ; preds = %12
  tail call void @_ZN11alglib_impl13spsymmextractEPNS_14spcholanalysisEPNS_12sparsematrixEPNS_9ae_vectorES5_PNS_8ae_stateE(ptr noundef nonnull %7, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  br label %14

14:                                               ; preds = %10, %13, %12, %9
  %.026 = phi i1 [ false, %9 ], [ false, %12 ], [ true, %10 ], [ true, %13 ]
  ret i1 %.026
}

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) local_unnamed_addr #1

declare void @_ZN11alglib_impl19_sparsematrix_clearEPv(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11alglib_impl15spsymmfactorizeEPNS_14spcholanalysisEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl13spsymmextractEPNS_14spcholanalysisEPNS_12sparsematrixEPNS_9ae_vectorES5_PNS_8ae_stateE(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #0 = { 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 #1 = { "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" }

!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)"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass