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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@.str.108 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.112 = external hidden unnamed_addr constant [58 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl28sparsecreatecrsfromdensevbufEPKNS_9ae_vectorEllPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %15 = load i64, ptr %7, align 8, !tbaa !9
  %16 = icmp sgt i64 %15, 0
  %17 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %16, ptr noundef @.str.108, ptr noundef %17)
  %18 = load i64, ptr %8, align 8, !tbaa !9
  %19 = icmp sgt i64 %18, 0
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %19, ptr noundef @.str.109, ptr noundef %20)
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %21, i32 0, i32 0
  %23 = load i64, ptr %22, align 8, !tbaa !11
  %24 = load i64, ptr %7, align 8, !tbaa !9
  %25 = load i64, ptr %8, align 8, !tbaa !9
  %26 = mul nsw i64 %24, %25
  %27 = icmp sge i64 %23, %26
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %27, ptr noundef @.str.110, ptr noundef %28)
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load i64, ptr %7, align 8, !tbaa !9
  %31 = load i64, ptr %8, align 8, !tbaa !9
  %32 = mul nsw i64 %30, %31
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %29, i64 noundef %32, ptr noundef %33)
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %34, ptr noundef @.str.111, ptr noundef %35)
  store i64 0, ptr %13, align 8, !tbaa !9
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %67, %5
  %37 = load i64, ptr %11, align 8, !tbaa !9
  %38 = load i64, ptr %7, align 8, !tbaa !9
  %39 = sub nsw i64 %38, 1
  %40 = icmp sle i64 %37, %39
  br i1 %40, label %41, label %70

41:                                               ; preds = %36
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %42

42:                                               ; preds = %63, %41
  %43 = load i64, ptr %12, align 8, !tbaa !9
  %44 = load i64, ptr %8, align 8, !tbaa !9
  %45 = sub nsw i64 %44, 1
  %46 = icmp sle i64 %43, %45
  br i1 %46, label %47, label %66

47:                                               ; preds = %42
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %48, i32 0, i32 4
  %50 = load ptr, ptr %49, align 8, !tbaa !15
  %51 = load i64, ptr %11, align 8, !tbaa !9
  %52 = load i64, ptr %8, align 8, !tbaa !9
  %53 = mul nsw i64 %51, %52
  %54 = load i64, ptr %12, align 8, !tbaa !9
  %55 = add nsw i64 %53, %54
  %56 = getelementptr inbounds double, ptr %50, i64 %55
  %57 = load double, ptr %56, align 8, !tbaa !16
  %58 = fcmp une double %57, 0.000000e+00
  br i1 %58, label %59, label %62

59:                                               ; preds = %47
  %60 = load i64, ptr %13, align 8, !tbaa !9
  %61 = add nsw i64 %60, 1
  store i64 %61, ptr %13, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %59, %47
  br label %63

63:                                               ; preds = %62
  %64 = load i64, ptr %12, align 8, !tbaa !9
  %65 = add nsw i64 %64, 1
  store i64 %65, ptr %12, align 8, !tbaa !9
  br label %42, !llvm.loop !18

66:                                               ; preds = %42
  br label %67

67:                                               ; preds = %66
  %68 = load i64, ptr %11, align 8, !tbaa !9
  %69 = add nsw i64 %68, 1
  store i64 %69, ptr %11, align 8, !tbaa !9
  br label %36, !llvm.loop !20

70:                                               ; preds = %36
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %71, i32 0, i32 5
  store i64 1, ptr %72, align 8, !tbaa !21
  %73 = load i64, ptr %13, align 8, !tbaa !9
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %74, i32 0, i32 9
  store i64 %73, ptr %75, align 8, !tbaa !23
  %76 = load i64, ptr %7, align 8, !tbaa !9
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %77, i32 0, i32 6
  store i64 %76, ptr %78, align 8, !tbaa !24
  %79 = load i64, ptr %8, align 8, !tbaa !9
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %80, i32 0, i32 7
  store i64 %79, ptr %81, align 8, !tbaa !25
  %82 = load i64, ptr %7, align 8, !tbaa !9
  %83 = add nsw i64 %82, 1
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %84, i32 0, i32 2
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl7iallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %83, ptr noundef %85, ptr noundef %86)
  %87 = load i64, ptr %13, align 8, !tbaa !9
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %88, i32 0, i32 1
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl7iallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %87, ptr noundef %89, ptr noundef %90)
  %91 = load i64, ptr %13, align 8, !tbaa !9
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl7rallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %91, ptr noundef %93, ptr noundef %94)
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %95, i32 0, i32 2
  %97 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %96, i32 0, i32 4
  %98 = load ptr, ptr %97, align 8, !tbaa !15
  %99 = getelementptr inbounds i64, ptr %98, i64 0
  store i64 0, ptr %99, align 8, !tbaa !9
  store i64 0, ptr %14, align 8, !tbaa !9
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %100

100:                                              ; preds = %162, %70
  %101 = load i64, ptr %11, align 8, !tbaa !9
  %102 = load i64, ptr %7, align 8, !tbaa !9
  %103 = sub nsw i64 %102, 1
  %104 = icmp sle i64 %101, %103
  br i1 %104, label %105, label %165

105:                                              ; preds = %100
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %106

106:                                              ; preds = %150, %105
  %107 = load i64, ptr %12, align 8, !tbaa !9
  %108 = load i64, ptr %8, align 8, !tbaa !9
  %109 = sub nsw i64 %108, 1
  %110 = icmp sle i64 %107, %109
  br i1 %110, label %111, label %153

111:                                              ; preds = %106
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %112, i32 0, i32 4
  %114 = load ptr, ptr %113, align 8, !tbaa !15
  %115 = load i64, ptr %11, align 8, !tbaa !9
  %116 = load i64, ptr %8, align 8, !tbaa !9
  %117 = mul nsw i64 %115, %116
  %118 = load i64, ptr %12, align 8, !tbaa !9
  %119 = add nsw i64 %117, %118
  %120 = getelementptr inbounds double, ptr %114, i64 %119
  %121 = load double, ptr %120, align 8, !tbaa !16
  %122 = fcmp une double %121, 0.000000e+00
  br i1 %122, label %123, label %149

123:                                              ; preds = %111
  %124 = load i64, ptr %12, align 8, !tbaa !9
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  %126 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %125, i32 0, i32 1
  %127 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %126, i32 0, i32 4
  %128 = load ptr, ptr %127, align 8, !tbaa !15
  %129 = load i64, ptr %14, align 8, !tbaa !9
  %130 = getelementptr inbounds i64, ptr %128, i64 %129
  store i64 %124, ptr %130, align 8, !tbaa !9
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %131, i32 0, i32 4
  %133 = load ptr, ptr %132, align 8, !tbaa !15
  %134 = load i64, ptr %11, align 8, !tbaa !9
  %135 = load i64, ptr %8, align 8, !tbaa !9
  %136 = mul nsw i64 %134, %135
  %137 = load i64, ptr %12, align 8, !tbaa !9
  %138 = add nsw i64 %136, %137
  %139 = getelementptr inbounds double, ptr %133, i64 %138
  %140 = load double, ptr %139, align 8, !tbaa !16
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %141, i32 0, i32 0
  %143 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %142, i32 0, i32 4
  %144 = load ptr, ptr %143, align 8, !tbaa !15
  %145 = load i64, ptr %14, align 8, !tbaa !9
  %146 = getelementptr inbounds double, ptr %144, i64 %145
  store double %140, ptr %146, align 8, !tbaa !16
  %147 = load i64, ptr %14, align 8, !tbaa !9
  %148 = add nsw i64 %147, 1
  store i64 %148, ptr %14, align 8, !tbaa !9
  br label %149

149:                                              ; preds = %123, %111
  br label %150

150:                                              ; preds = %149
  %151 = load i64, ptr %12, align 8, !tbaa !9
  %152 = add nsw i64 %151, 1
  store i64 %152, ptr %12, align 8, !tbaa !9
  br label %106, !llvm.loop !26

153:                                              ; preds = %106
  %154 = load i64, ptr %14, align 8, !tbaa !9
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %155, i32 0, i32 2
  %157 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %156, i32 0, i32 4
  %158 = load ptr, ptr %157, align 8, !tbaa !15
  %159 = load i64, ptr %11, align 8, !tbaa !9
  %160 = add nsw i64 %159, 1
  %161 = getelementptr inbounds i64, ptr %158, i64 %160
  store i64 %154, ptr %161, align 8, !tbaa !9
  br label %162

162:                                              ; preds = %153
  %163 = load i64, ptr %11, align 8, !tbaa !9
  %164 = add nsw i64 %163, 1
  store i64 %164, ptr %11, align 8, !tbaa !9
  br label %100, !llvm.loop !27

165:                                              ; preds = %100
  %166 = load i64, ptr %14, align 8, !tbaa !9
  %167 = load i64, ptr %13, align 8, !tbaa !9
  %168 = icmp eq i64 %166, %167
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %168, ptr noundef @.str.112, ptr noundef %169)
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl15sparseinitduidxEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %170, ptr noundef %171)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  ret void
}

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

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

declare void @_ZN11alglib_impl15sparseinitduidxEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

declare noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr 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 = { 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, !10, i64 0}
!12 = !{!"_ZTSN11alglib_impl9ae_vectorE", !10, i64 0, !10, i64 8, !13, i64 16, !14, i64 24, !7, i64 56}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!22, !10, i64 320}
!22 = !{!"_ZTSN11alglib_impl12sparsematrixE", !12, i64 0, !12, i64 64, !12, i64 128, !12, i64 192, !12, i64 256, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360}
!23 = !{!22, !10, i64 352}
!24 = !{!22, !10, i64 328}
!25 = !{!22, !10, i64 336}
!26 = distinct !{!26, !19}
!27 = distinct !{!27, !19}


; 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.108 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.112 = external hidden unnamed_addr constant [58 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_impl28sparsecreatecrsfromdensevbufEPKNS_9ae_vectorEllPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = icmp sgt i64 %1, 0
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %6, ptr noundef nonnull @.str.108, ptr noundef %4)
  %7 = icmp sgt i64 %2, 0
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %7, ptr noundef nonnull @.str.109, ptr noundef %4)
  %8 = load i64, ptr %0, align 8, !tbaa !5
  %9 = mul nsw i64 %2, %1
  %10 = icmp sge i64 %8, %9
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %10, ptr noundef nonnull @.str.110, ptr noundef %4)
  %11 = tail call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %9, ptr noundef %4)
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %11, ptr noundef nonnull @.str.111, ptr noundef %4)
  %brmerge.demorgan = and i1 %6, %7
  br i1 %brmerge.demorgan, label %.preheader79.lr.ph.split.us, label %._crit_edge86

.preheader79.lr.ph.split.us:                      ; preds = %5
  %12 = getelementptr inbounds i8, ptr %0, i64 56
  %13 = load ptr, ptr %12, align 8, !tbaa !13
  %min.iters.check = icmp ult i64 %2, 4
  %n.vec = and i64 %2, 9223372036854775804
  %cmp.n = icmp eq i64 %n.vec, %2
  br label %.preheader79.us

.preheader79.us:                                  ; preds = %._crit_edge.us, %.preheader79.lr.ph.split.us
  %.06885.us = phi i64 [ 0, %.preheader79.lr.ph.split.us ], [ %.270.us.lcssa, %._crit_edge.us ]
  %.07384.us = phi i64 [ 0, %.preheader79.lr.ph.split.us ], [ %32, %._crit_edge.us ]
  %14 = mul nuw nsw i64 %.07384.us, %2
  %15 = getelementptr double, ptr %13, i64 %14
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.preheader79.us
  %16 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %.06885.us, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ %16, %vector.ph ], [ %23, %vector.body ]
  %vec.phi108 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ]
  %17 = getelementptr double, ptr %15, i64 %index
  %18 = getelementptr i8, ptr %17, i64 16
  %wide.load = load <2 x double>, ptr %17, align 8, !tbaa !14
  %wide.load109 = load <2 x double>, ptr %18, align 8, !tbaa !14
  %19 = fcmp une <2 x double> %wide.load, zeroinitializer
  %20 = fcmp une <2 x double> %wide.load109, zeroinitializer
  %21 = zext <2 x i1> %19 to <2 x i64>
  %22 = zext <2 x i1> %20 to <2 x i64>
  %23 = add <2 x i64> %vec.phi, %21
  %24 = add <2 x i64> %vec.phi108, %22
  %index.next = add nuw i64 %index, 4
  %25 = icmp eq i64 %index.next, %n.vec
  br i1 %25, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %24, %23
  %26 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  br i1 %cmp.n, label %._crit_edge.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader79.us
  %.16982.us.ph = phi i64 [ %.06885.us, %.preheader79.us ], [ %26, %middle.block ]
  %.07181.us.ph = phi i64 [ 0, %.preheader79.us ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %.16982.us = phi i64 [ %.270.us, %scalar.ph ], [ %.16982.us.ph, %scalar.ph.preheader ]
  %.07181.us = phi i64 [ %31, %scalar.ph ], [ %.07181.us.ph, %scalar.ph.preheader ]
  %27 = getelementptr double, ptr %15, i64 %.07181.us
  %28 = load double, ptr %27, align 8, !tbaa !14
  %29 = fcmp une double %28, 0.000000e+00
  %30 = zext i1 %29 to i64
  %.270.us = add nsw i64 %.16982.us, %30
  %31 = add nuw nsw i64 %.07181.us, 1
  %exitcond.not = icmp eq i64 %31, %2
  br i1 %exitcond.not, label %._crit_edge.us, label %scalar.ph, !llvm.loop !20

._crit_edge.us:                                   ; preds = %scalar.ph, %middle.block
  %.270.us.lcssa = phi i64 [ %26, %middle.block ], [ %.270.us, %scalar.ph ]
  %32 = add nuw nsw i64 %.07384.us, 1
  %exitcond101.not = icmp eq i64 %32, %1
  br i1 %exitcond101.not, label %._crit_edge86, label %.preheader79.us, !llvm.loop !21

._crit_edge86:                                    ; preds = %._crit_edge.us, %5
  %.068.lcssa = phi i64 [ 0, %5 ], [ %.270.us.lcssa, %._crit_edge.us ]
  %33 = getelementptr inbounds i8, ptr %3, i64 320
  store i64 1, ptr %33, align 8, !tbaa !22
  %34 = getelementptr inbounds i8, ptr %3, i64 352
  store i64 %.068.lcssa, ptr %34, align 8, !tbaa !24
  %35 = getelementptr inbounds i8, ptr %3, i64 328
  store i64 %1, ptr %35, align 8, !tbaa !25
  %36 = getelementptr inbounds i8, ptr %3, i64 336
  store i64 %2, ptr %36, align 8, !tbaa !26
  %37 = add nsw i64 %1, 1
  %38 = getelementptr inbounds i8, ptr %3, i64 128
  tail call void @_ZN11alglib_impl7iallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %37, ptr noundef nonnull %38, ptr noundef %4)
  %39 = getelementptr inbounds i8, ptr %3, i64 64
  tail call void @_ZN11alglib_impl7iallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %.068.lcssa, ptr noundef nonnull %39, ptr noundef %4)
  tail call void @_ZN11alglib_impl7rallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %.068.lcssa, ptr noundef %3, ptr noundef %4)
  %40 = getelementptr inbounds i8, ptr %3, i64 184
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  store i64 0, ptr %41, align 8, !tbaa !27
  br i1 %6, label %.preheader.lr.ph, label %._crit_edge94

.preheader.lr.ph:                                 ; preds = %._crit_edge86
  %42 = getelementptr inbounds i8, ptr %0, i64 56
  %43 = getelementptr inbounds i8, ptr %3, i64 120
  %44 = getelementptr inbounds i8, ptr %3, i64 56
  br i1 %7, label %.preheader.us, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %xtraiter = and i64 %1, 3
  %45 = icmp ult i64 %1, 4
  br i1 %45, label %._crit_edge94.loopexit110.unr-lcssa, label %.preheader.preheader.new

.preheader.preheader.new:                         ; preds = %.preheader.preheader
  %unroll_iter = and i64 %1, 9223372036854775804
  br label %.preheader

.preheader.us:                                    ; preds = %.preheader.lr.ph, %._crit_edge.us96
  %.093.us = phi i64 [ %.2.us, %._crit_edge.us96 ], [ 0, %.preheader.lr.ph ]
  %.17492.us = phi i64 [ %65, %._crit_edge.us96 ], [ 0, %.preheader.lr.ph ]
  %46 = mul nuw nsw i64 %.17492.us, %2
  br label %47

47:                                               ; preds = %.preheader.us, %62
  %.190.us = phi i64 [ %.093.us, %.preheader.us ], [ %.2.us, %62 ]
  %.17289.us = phi i64 [ 0, %.preheader.us ], [ %63, %62 ]
  %48 = load ptr, ptr %42, align 8, !tbaa !13
  %49 = add nuw nsw i64 %.17289.us, %46
  %50 = getelementptr inbounds double, ptr %48, i64 %49
  %51 = load double, ptr %50, align 8, !tbaa !14
  %52 = fcmp une double %51, 0.000000e+00
  br i1 %52, label %53, label %62

53:                                               ; preds = %47
  %54 = load ptr, ptr %43, align 8, !tbaa !13
  %55 = getelementptr inbounds i64, ptr %54, i64 %.190.us
  store i64 %.17289.us, ptr %55, align 8, !tbaa !27
  %56 = load ptr, ptr %42, align 8, !tbaa !13
  %57 = getelementptr inbounds double, ptr %56, i64 %49
  %58 = load double, ptr %57, align 8, !tbaa !14
  %59 = load ptr, ptr %44, align 8, !tbaa !13
  %60 = getelementptr inbounds double, ptr %59, i64 %.190.us
  store double %58, ptr %60, align 8, !tbaa !14
  %61 = add nsw i64 %.190.us, 1
  br label %62

62:                                               ; preds = %53, %47
  %.2.us = phi i64 [ %61, %53 ], [ %.190.us, %47 ]
  %63 = add nuw nsw i64 %.17289.us, 1
  %exitcond103.not = icmp eq i64 %63, %2
  br i1 %exitcond103.not, label %._crit_edge.us96, label %47, !llvm.loop !28

._crit_edge.us96:                                 ; preds = %62
  %64 = load ptr, ptr %40, align 8, !tbaa !13
  %65 = add nuw nsw i64 %.17492.us, 1
  %66 = getelementptr inbounds i64, ptr %64, i64 %65
  store i64 %.2.us, ptr %66, align 8, !tbaa !27
  %exitcond104.not = icmp eq i64 %65, %1
  br i1 %exitcond104.not, label %._crit_edge94, label %.preheader.us, !llvm.loop !29

.preheader:                                       ; preds = %.preheader, %.preheader.preheader.new
  %.17492 = phi i64 [ 0, %.preheader.preheader.new ], [ %77, %.preheader ]
  %niter = phi i64 [ 0, %.preheader.preheader.new ], [ %niter.next.3, %.preheader ]
  %67 = load ptr, ptr %40, align 8, !tbaa !13
  %68 = or disjoint i64 %.17492, 1
  %69 = getelementptr inbounds i64, ptr %67, i64 %68
  store i64 0, ptr %69, align 8, !tbaa !27
  %70 = load ptr, ptr %40, align 8, !tbaa !13
  %71 = or disjoint i64 %.17492, 2
  %72 = getelementptr inbounds i64, ptr %70, i64 %71
  store i64 0, ptr %72, align 8, !tbaa !27
  %73 = load ptr, ptr %40, align 8, !tbaa !13
  %74 = or disjoint i64 %.17492, 3
  %75 = getelementptr inbounds i64, ptr %73, i64 %74
  store i64 0, ptr %75, align 8, !tbaa !27
  %76 = load ptr, ptr %40, align 8, !tbaa !13
  %77 = add nuw nsw i64 %.17492, 4
  %78 = getelementptr inbounds i64, ptr %76, i64 %77
  store i64 0, ptr %78, align 8, !tbaa !27
  %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_edge94.loopexit110.unr-lcssa, label %.preheader, !llvm.loop !29

._crit_edge94.loopexit110.unr-lcssa:              ; preds = %.preheader, %.preheader.preheader
  %.17492.unr = phi i64 [ 0, %.preheader.preheader ], [ %77, %.preheader ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge94, label %.preheader.epil

.preheader.epil:                                  ; preds = %._crit_edge94.loopexit110.unr-lcssa, %.preheader.epil
  %.17492.epil = phi i64 [ %80, %.preheader.epil ], [ %.17492.unr, %._crit_edge94.loopexit110.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader.epil ], [ 0, %._crit_edge94.loopexit110.unr-lcssa ]
  %79 = load ptr, ptr %40, align 8, !tbaa !13
  %80 = add nuw nsw i64 %.17492.epil, 1
  %81 = getelementptr inbounds i64, ptr %79, i64 %80
  store i64 0, ptr %81, align 8, !tbaa !27
  %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_edge94, label %.preheader.epil, !llvm.loop !30

._crit_edge94:                                    ; preds = %._crit_edge94.loopexit110.unr-lcssa, %.preheader.epil, %._crit_edge.us96, %._crit_edge86
  %.0.lcssa = phi i64 [ 0, %._crit_edge86 ], [ %.2.us, %._crit_edge.us96 ], [ 0, %.preheader.epil ], [ 0, %._crit_edge94.loopexit110.unr-lcssa ]
  %82 = icmp eq i64 %.0.lcssa, %.068.lcssa
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %82, ptr noundef nonnull @.str.112, ptr noundef %4)
  tail call void @_ZN11alglib_impl15sparseinitduidxEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef nonnull %3, ptr noundef %4)
  ret void
}

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

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

declare void @_ZN11alglib_impl15sparseinitduidxEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, 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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #2

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!8, !8, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !8, i64 0}
!16 = distinct !{!16, !17, !18, !19}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !17, !19, !18}
!21 = distinct !{!21, !17}
!22 = !{!23, !7, i64 320}
!23 = !{!"_ZTSN11alglib_impl12sparsematrixE", !6, i64 0, !6, i64 64, !6, i64 128, !6, i64 192, !6, i64 256, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360}
!24 = !{!23, !7, i64 352}
!25 = !{!23, !7, i64 328}
!26 = !{!23, !7, i64 336}
!27 = !{!7, !7, i64 0}
!28 = distinct !{!28, !17}
!29 = distinct !{!29, !17}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.unroll.disable"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass