; LLVM IR from Dimandragon/non-parametric-dsp :: alglib-cpp/src (solvers)

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

@.str.445 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.446 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.447 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.448 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.449 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.450 = external hidden unnamed_addr constant [54 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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl22sparsespdcholeskysolveEPKNS_12sparsematrixEbPKNS_9ae_vectorEPS3_PNS_18sparsesolverreportEPNS_8ae_stateE(ptr noundef %0, i1 noundef zeroext %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  %16 = zext i1 %1 to i8
  store i8 %16, ptr %8, align 1, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %17 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %17)
  %18 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl25_sparsesolverreport_clearEPv(ptr noundef %18)
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = load ptr, ptr %12, align 8, !tbaa !5
  %21 = call noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %19, ptr noundef %20)
  store i64 %21, ptr %14, align 8, !tbaa !11
  %22 = load i64, ptr %14, align 8, !tbaa !11
  %23 = icmp sgt i64 %22, 0
  %24 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %23, ptr noundef @.str.445, ptr noundef %24)
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = load ptr, ptr %12, align 8, !tbaa !5
  %27 = call noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %25, ptr noundef %26)
  %28 = load i64, ptr %14, align 8, !tbaa !11
  %29 = icmp eq i64 %27, %28
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %29, ptr noundef @.str.446, ptr noundef %30)
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = call noundef i64 @_ZN11alglib_impl14sparsegetncolsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %31, ptr noundef %32)
  %34 = load i64, ptr %14, align 8, !tbaa !11
  %35 = icmp eq i64 %33, %34
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %35, ptr noundef @.str.447, ptr noundef %36)
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = call noundef zeroext i1 @_ZN11alglib_impl11sparseissksEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %37, ptr noundef %38)
  br i1 %39, label %44, label %40

40:                                               ; preds = %6
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = call noundef zeroext i1 @_ZN11alglib_impl11sparseiscrsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %41, ptr noundef %42)
  br label %44

44:                                               ; preds = %40, %6
  %45 = phi i1 [ true, %6 ], [ %43, %40 ]
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %45, ptr noundef @.str.448, ptr noundef %46)
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %47, i32 0, i32 0
  %49 = load i64, ptr %48, align 8, !tbaa !13
  %50 = load i64, ptr %14, align 8, !tbaa !11
  %51 = icmp sge i64 %49, %50
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %51, ptr noundef @.str.449, ptr noundef %52)
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load i64, ptr %14, align 8, !tbaa !11
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %53, i64 noundef %54, ptr noundef %55)
  %57 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %56, ptr noundef @.str.450, ptr noundef %57)
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl22initsparsesolverreportEPNS_18sparsesolverreportEPNS_8ae_stateE(ptr noundef %58, ptr noundef %59)
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = load i64, ptr %14, align 8, !tbaa !11
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %60, i64 noundef %61, ptr noundef %62)
  store i64 0, ptr %13, align 8, !tbaa !11
  br label %63

63:                                               ; preds = %94, %44
  %64 = load i64, ptr %13, align 8, !tbaa !11
  %65 = load i64, ptr %14, align 8, !tbaa !11
  %66 = sub nsw i64 %65, 1
  %67 = icmp sle i64 %64, %66
  br i1 %67, label %68, label %97

68:                                               ; preds = %63
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = load i64, ptr %13, align 8, !tbaa !11
  %71 = load i64, ptr %13, align 8, !tbaa !11
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = call noundef double @_ZN11alglib_impl9sparsegetEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef %69, i64 noundef %70, i64 noundef %71, ptr noundef %72)
  %74 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %73, double noundef 0.000000e+00)
  br i1 %74, label %75, label %93

75:                                               ; preds = %68
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.alglib_impl::sparsesolverreport", ptr %76, i32 0, i32 0
  store i64 -3, ptr %77, align 8, !tbaa !16
  store i64 0, ptr %13, align 8, !tbaa !11
  br label %78

78:                                               ; preds = %89, %75
  %79 = load i64, ptr %13, align 8, !tbaa !11
  %80 = load i64, ptr %14, align 8, !tbaa !11
  %81 = sub nsw i64 %80, 1
  %82 = icmp sle i64 %79, %81
  br i1 %82, label %83, label %92

83:                                               ; preds = %78
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %84, i32 0, i32 4
  %86 = load ptr, ptr %85, align 8, !tbaa !19
  %87 = load i64, ptr %13, align 8, !tbaa !11
  %88 = getelementptr inbounds double, ptr %86, i64 %87
  store double 0.000000e+00, ptr %88, align 8, !tbaa !20
  br label %89

89:                                               ; preds = %83
  %90 = load i64, ptr %13, align 8, !tbaa !11
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr %13, align 8, !tbaa !11
  br label %78, !llvm.loop !21

92:                                               ; preds = %78
  store i32 1, ptr %15, align 4
  br label %146

93:                                               ; preds = %68
  br label %94

94:                                               ; preds = %93
  %95 = load i64, ptr %13, align 8, !tbaa !11
  %96 = add nsw i64 %95, 1
  store i64 %96, ptr %13, align 8, !tbaa !11
  br label %63, !llvm.loop !23

97:                                               ; preds = %63
  store i64 0, ptr %13, align 8, !tbaa !11
  br label %98

98:                                               ; preds = %115, %97
  %99 = load i64, ptr %13, align 8, !tbaa !11
  %100 = load i64, ptr %14, align 8, !tbaa !11
  %101 = sub nsw i64 %100, 1
  %102 = icmp sle i64 %99, %101
  br i1 %102, label %103, label %118

103:                                              ; preds = %98
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %104, i32 0, i32 4
  %106 = load ptr, ptr %105, align 8, !tbaa !19
  %107 = load i64, ptr %13, align 8, !tbaa !11
  %108 = getelementptr inbounds double, ptr %106, i64 %107
  %109 = load double, ptr %108, align 8, !tbaa !20
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %110, i32 0, i32 4
  %112 = load ptr, ptr %111, align 8, !tbaa !19
  %113 = load i64, ptr %13, align 8, !tbaa !11
  %114 = getelementptr inbounds double, ptr %112, i64 %113
  store double %109, ptr %114, align 8, !tbaa !20
  br label %115

115:                                              ; preds = %103
  %116 = load i64, ptr %13, align 8, !tbaa !11
  %117 = add nsw i64 %116, 1
  store i64 %117, ptr %13, align 8, !tbaa !11
  br label %98, !llvm.loop !24

118:                                              ; preds = %98
  %119 = load i8, ptr %8, align 1, !tbaa !9, !range !25, !noundef !26
  %120 = trunc i8 %119 to i1
  br i1 %120, label %121, label %132

121:                                              ; preds = %118
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = load i8, ptr %8, align 1, !tbaa !9, !range !25, !noundef !26
  %124 = trunc i8 %123 to i1
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl10sparsetrsvEPKNS_12sparsematrixEbblPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %122, i1 noundef zeroext %124, i1 noundef zeroext false, i64 noundef 1, ptr noundef %125, ptr noundef %126)
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = load i8, ptr %8, align 1, !tbaa !9, !range !25, !noundef !26
  %129 = trunc i8 %128 to i1
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl10sparsetrsvEPKNS_12sparsematrixEbblPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %127, i1 noundef zeroext %129, i1 noundef zeroext false, i64 noundef 0, ptr noundef %130, ptr noundef %131)
  br label %143

132:                                              ; preds = %118
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = load i8, ptr %8, align 1, !tbaa !9, !range !25, !noundef !26
  %135 = trunc i8 %134 to i1
  %136 = load ptr, ptr %10, align 8, !tbaa !5
  %137 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl10sparsetrsvEPKNS_12sparsematrixEbblPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %133, i1 noundef zeroext %135, i1 noundef zeroext false, i64 noundef 0, ptr noundef %136, ptr noundef %137)
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = load i8, ptr %8, align 1, !tbaa !9, !range !25, !noundef !26
  %140 = trunc i8 %139 to i1
  %141 = load ptr, ptr %10, align 8, !tbaa !5
  %142 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl10sparsetrsvEPKNS_12sparsematrixEbblPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %138, i1 noundef zeroext %140, i1 noundef zeroext false, i64 noundef 1, ptr noundef %141, ptr noundef %142)
  br label %143

143:                                              ; preds = %132, %121
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = getelementptr inbounds %"struct.alglib_impl::sparsesolverreport", ptr %144, i32 0, i32 0
  store i64 1, ptr %145, align 8, !tbaa !16
  store i32 0, ptr %15, align 4
  br label %146

146:                                              ; preds = %143, %92
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  %147 = load i32, ptr %15, align 4
  switch i32 %147, label %149 [
    i32 0, label %148
    i32 1, label %148
  ]

148:                                              ; preds = %146, %146
  ret void

149:                                              ; preds = %146
  unreachable
}

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) #1

declare noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #1

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

declare noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef, double noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl25_sparsesolverreport_clearEPv(ptr noundef) #2

declare noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

declare noundef i64 @_ZN11alglib_impl14sparsegetncolsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

declare noundef zeroext i1 @_ZN11alglib_impl11sparseiscrsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11alglib_impl22initsparsesolverreportEPNS_18sparsesolverreportEPNS_8ae_stateE(ptr noundef, ptr noundef) #3

declare void @_ZN11alglib_impl10sparsetrsvEPKNS_12sparsematrixEbblPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef, i1 noundef zeroext, i1 noundef zeroext, i64 noundef, ptr noundef, ptr noundef) #1

declare noundef zeroext i1 @_ZN11alglib_impl11sparseissksEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

declare noundef double @_ZN11alglib_impl9sparsegetEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTSN11alglib_impl9ae_vectorE", !12, i64 0, !12, i64 8, !10, i64 16, !15, i64 24, !7, i64 56}
!15 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!16 = !{!17, !12, i64 0}
!17 = !{!"_ZTSN11alglib_impl18sparsesolverreportE", !12, i64 0, !12, i64 8, !12, i64 16, !18, i64 24}
!18 = !{!"double", !7, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!18, !18, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}
!25 = !{i8 0, i8 2}
!26 = !{}


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

@.str.445 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.446 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.447 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.448 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.449 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.450 = external hidden unnamed_addr constant [54 x i8], align 1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl22sparsespdcholeskysolveEPKNS_12sparsematrixEbPKNS_9ae_vectorEPS3_PNS_18sparsesolverreportEPNS_8ae_stateE(ptr noundef %0, i1 noundef zeroext %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #1 {
  tail call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %3)
  tail call void @_ZN11alglib_impl25_sparsesolverreport_clearEPv(ptr noundef %4)
  %7 = tail call noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %0, ptr noundef %5)
  %8 = icmp sgt i64 %7, 0
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %8, ptr noundef nonnull @.str.445, ptr noundef %5)
  %9 = tail call noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %0, ptr noundef %5)
  %10 = icmp eq i64 %9, %7
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %10, ptr noundef nonnull @.str.446, ptr noundef %5)
  %11 = tail call noundef i64 @_ZN11alglib_impl14sparsegetncolsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %0, ptr noundef %5)
  %12 = icmp eq i64 %11, %7
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %12, ptr noundef nonnull @.str.447, ptr noundef %5)
  %13 = tail call noundef zeroext i1 @_ZN11alglib_impl11sparseissksEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %0, ptr noundef %5)
  br i1 %13, label %16, label %14

14:                                               ; preds = %6
  %15 = tail call noundef zeroext i1 @_ZN11alglib_impl11sparseiscrsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %0, ptr noundef %5)
  br label %16

16:                                               ; preds = %14, %6
  %17 = phi i1 [ true, %6 ], [ %15, %14 ]
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %17, ptr noundef nonnull @.str.448, ptr noundef %5)
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %19 = icmp sge i64 %18, %7
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %19, ptr noundef nonnull @.str.449, ptr noundef %5)
  %20 = tail call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %2, i64 noundef %7, ptr noundef %5)
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %20, ptr noundef nonnull @.str.450, ptr noundef %5)
  tail call void @_ZN11alglib_impl22initsparsesolverreportEPNS_18sparsesolverreportEPNS_8ae_stateE(ptr noundef %4, ptr noundef %5)
  tail call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %3, i64 noundef %7, ptr noundef %5)
  br i1 %8, label %.lr.ph, label %._crit_edge

21:                                               ; preds = %.lr.ph
  %22 = add nuw nsw i64 %.075, 1
  %exitcond.not = icmp eq i64 %22, %7
  br i1 %exitcond.not, label %.preheader, label %.lr.ph, !llvm.loop !13

.preheader:                                       ; preds = %21
  br i1 %8, label %.lr.ph78, label %._crit_edge

.lr.ph78:                                         ; preds = %.preheader
  %23 = getelementptr inbounds i8, ptr %2, i64 56
  %24 = getelementptr inbounds i8, ptr %3, i64 56
  %xtraiter = and i64 %7, 3
  %25 = icmp ult i64 %7, 4
  br i1 %25, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph78.new

.lr.ph78.new:                                     ; preds = %.lr.ph78
  %unroll_iter = and i64 %7, 9223372036854775804
  br label %43

.lr.ph:                                           ; preds = %16, %21
  %.075 = phi i64 [ %22, %21 ], [ 0, %16 ]
  %26 = tail call noundef double @_ZN11alglib_impl9sparsegetEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef %0, i64 noundef %.075, i64 noundef %.075, ptr noundef %5)
  %27 = tail call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %26, double noundef 0.000000e+00)
  br i1 %27, label %.lr.ph82, label %21

.lr.ph82:                                         ; preds = %.lr.ph
  store i64 -3, ptr %4, align 8, !tbaa !15
  %28 = getelementptr inbounds i8, ptr %3, i64 56
  %xtraiter86 = and i64 %7, 3
  %29 = icmp ult i64 %7, 4
  br i1 %29, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph82.new

.lr.ph82.new:                                     ; preds = %.lr.ph82
  %unroll_iter89 = and i64 %7, 9223372036854775804
  br label %30

30:                                               ; preds = %30, %.lr.ph82.new
  %.180 = phi i64 [ 0, %.lr.ph82.new ], [ %42, %30 ]
  %niter90 = phi i64 [ 0, %.lr.ph82.new ], [ %niter90.next.3, %30 ]
  %31 = load ptr, ptr %28, align 8, !tbaa !18
  %32 = getelementptr inbounds double, ptr %31, i64 %.180
  store double 0.000000e+00, ptr %32, align 8, !tbaa !19
  %33 = or disjoint i64 %.180, 1
  %34 = load ptr, ptr %28, align 8, !tbaa !18
  %35 = getelementptr inbounds double, ptr %34, i64 %33
  store double 0.000000e+00, ptr %35, align 8, !tbaa !19
  %36 = or disjoint i64 %.180, 2
  %37 = load ptr, ptr %28, align 8, !tbaa !18
  %38 = getelementptr inbounds double, ptr %37, i64 %36
  store double 0.000000e+00, ptr %38, align 8, !tbaa !19
  %39 = or disjoint i64 %.180, 3
  %40 = load ptr, ptr %28, align 8, !tbaa !18
  %41 = getelementptr inbounds double, ptr %40, i64 %39
  store double 0.000000e+00, ptr %41, align 8, !tbaa !19
  %42 = add nuw nsw i64 %.180, 4
  %niter90.next.3 = add i64 %niter90, 4
  %niter90.ncmp.3 = icmp eq i64 %niter90.next.3, %unroll_iter89
  br i1 %niter90.ncmp.3, label %.loopexit.loopexit.unr-lcssa, label %30, !llvm.loop !20

43:                                               ; preds = %43, %.lr.ph78.new
  %.277 = phi i64 [ 0, %.lr.ph78.new ], [ %67, %43 ]
  %niter = phi i64 [ 0, %.lr.ph78.new ], [ %niter.next.3, %43 ]
  %44 = load ptr, ptr %23, align 8, !tbaa !18
  %45 = getelementptr inbounds double, ptr %44, i64 %.277
  %46 = load double, ptr %45, align 8, !tbaa !19
  %47 = load ptr, ptr %24, align 8, !tbaa !18
  %48 = getelementptr inbounds double, ptr %47, i64 %.277
  store double %46, ptr %48, align 8, !tbaa !19
  %49 = or disjoint i64 %.277, 1
  %50 = load ptr, ptr %23, align 8, !tbaa !18
  %51 = getelementptr inbounds double, ptr %50, i64 %49
  %52 = load double, ptr %51, align 8, !tbaa !19
  %53 = load ptr, ptr %24, align 8, !tbaa !18
  %54 = getelementptr inbounds double, ptr %53, i64 %49
  store double %52, ptr %54, align 8, !tbaa !19
  %55 = or disjoint i64 %.277, 2
  %56 = load ptr, ptr %23, align 8, !tbaa !18
  %57 = getelementptr inbounds double, ptr %56, i64 %55
  %58 = load double, ptr %57, align 8, !tbaa !19
  %59 = load ptr, ptr %24, align 8, !tbaa !18
  %60 = getelementptr inbounds double, ptr %59, i64 %55
  store double %58, ptr %60, align 8, !tbaa !19
  %61 = or disjoint i64 %.277, 3
  %62 = load ptr, ptr %23, align 8, !tbaa !18
  %63 = getelementptr inbounds double, ptr %62, i64 %61
  %64 = load double, ptr %63, align 8, !tbaa !19
  %65 = load ptr, ptr %24, align 8, !tbaa !18
  %66 = getelementptr inbounds double, ptr %65, i64 %61
  store double %64, ptr %66, align 8, !tbaa !19
  %67 = add nuw nsw i64 %.277, 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 %._crit_edge.loopexit.unr-lcssa, label %43, !llvm.loop !21

._crit_edge.loopexit.unr-lcssa:                   ; preds = %43, %.lr.ph78
  %.277.unr = phi i64 [ 0, %.lr.ph78 ], [ %67, %43 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %.277.epil = phi i64 [ %73, %.epil.preheader ], [ %.277.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %68 = load ptr, ptr %23, align 8, !tbaa !18
  %69 = getelementptr inbounds double, ptr %68, i64 %.277.epil
  %70 = load double, ptr %69, align 8, !tbaa !19
  %71 = load ptr, ptr %24, align 8, !tbaa !18
  %72 = getelementptr inbounds double, ptr %71, i64 %.277.epil
  store double %70, ptr %72, align 8, !tbaa !19
  %73 = add nuw nsw i64 %.277.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 %._crit_edge, label %.epil.preheader, !llvm.loop !22

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %16, %.preheader
  br i1 %1, label %74, label %75

74:                                               ; preds = %._crit_edge
  tail call void @_ZN11alglib_impl10sparsetrsvEPKNS_12sparsematrixEbblPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %0, i1 noundef zeroext true, i1 noundef zeroext false, i64 noundef 1, ptr noundef %3, ptr noundef %5)
  tail call void @_ZN11alglib_impl10sparsetrsvEPKNS_12sparsematrixEbblPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %0, i1 noundef zeroext true, i1 noundef zeroext false, i64 noundef 0, ptr noundef %3, ptr noundef %5)
  br label %76

75:                                               ; preds = %._crit_edge
  tail call void @_ZN11alglib_impl10sparsetrsvEPKNS_12sparsematrixEbblPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %0, i1 noundef zeroext false, i1 noundef zeroext false, i64 noundef 0, ptr noundef %3, ptr noundef %5)
  tail call void @_ZN11alglib_impl10sparsetrsvEPKNS_12sparsematrixEbblPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %0, i1 noundef zeroext false, i1 noundef zeroext false, i64 noundef 1, ptr noundef %3, ptr noundef %5)
  br label %76

76:                                               ; preds = %75, %74
  store i64 1, ptr %4, align 8, !tbaa !15
  br label %.loopexit

.loopexit.loopexit.unr-lcssa:                     ; preds = %30, %.lr.ph82
  %.180.unr = phi i64 [ 0, %.lr.ph82 ], [ %42, %30 ]
  %lcmp.mod88.not = icmp eq i64 %xtraiter86, 0
  br i1 %lcmp.mod88.not, label %.loopexit, label %.epil.preheader85

.epil.preheader85:                                ; preds = %.loopexit.loopexit.unr-lcssa, %.epil.preheader85
  %.180.epil = phi i64 [ %79, %.epil.preheader85 ], [ %.180.unr, %.loopexit.loopexit.unr-lcssa ]
  %epil.iter87 = phi i64 [ %epil.iter87.next, %.epil.preheader85 ], [ 0, %.loopexit.loopexit.unr-lcssa ]
  %77 = load ptr, ptr %28, align 8, !tbaa !18
  %78 = getelementptr inbounds double, ptr %77, i64 %.180.epil
  store double 0.000000e+00, ptr %78, align 8, !tbaa !19
  %79 = add nuw nsw i64 %.180.epil, 1
  %epil.iter87.next = add i64 %epil.iter87, 1
  %epil.iter87.cmp.not = icmp eq i64 %epil.iter87.next, %xtraiter86
  br i1 %epil.iter87.cmp.not, label %.loopexit, label %.epil.preheader85, !llvm.loop !24

.loopexit:                                        ; preds = %.loopexit.loopexit.unr-lcssa, %.epil.preheader85, %76
  ret void
}

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) local_unnamed_addr #0

declare noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

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

declare noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef, double noundef) local_unnamed_addr #0

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

declare noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #0

declare noundef i64 @_ZN11alglib_impl14sparsegetncolsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #0

declare noundef zeroext i1 @_ZN11alglib_impl11sparseiscrsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11alglib_impl22initsparsesolverreportEPNS_18sparsesolverreportEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl10sparsetrsvEPKNS_12sparsematrixEbblPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef, i1 noundef zeroext, i1 noundef zeroext, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare noundef zeroext i1 @_ZN11alglib_impl11sparseissksEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #0

declare noundef double @_ZN11alglib_impl9sparsegetEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

attributes #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 = { 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 = { mustprogress nounwind 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" }

!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 0}
!6 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !8, i64 56}
!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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !7, i64 0}
!16 = !{!"_ZTSN11alglib_impl18sparsesolverreportE", !7, i64 0, !7, i64 8, !7, i64 16, !17, i64 24}
!17 = !{!"double", !8, i64 0}
!18 = !{!8, !8, i64 0}
!19 = !{!17, !17, i64 0}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.unroll.disable"}
!24 = distinct !{!24, !23}


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