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

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

29:                                               ; preds = %55, %5
  %30 = load i64, ptr %14, align 8, !tbaa !9
  %31 = load i64, ptr %7, align 8, !tbaa !9
  %32 = sub nsw i64 %31, 1
  %33 = icmp sle i64 %30, %32
  br i1 %33, label %34, label %58

34:                                               ; preds = %29
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %35, i32 0, i32 6
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = load i64, ptr %14, align 8, !tbaa !9
  %39 = getelementptr inbounds ptr, ptr %37, i64 %38
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  %41 = getelementptr inbounds double, ptr %40, i64 0
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %42, i32 0, i32 4
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = getelementptr inbounds double, ptr %44, i64 0
  %46 = load i64, ptr %7, align 8, !tbaa !9
  %47 = sub nsw i64 %46, 1
  %48 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %47)
  %49 = call noundef double @_ZN11alglib_impl15ae_v_dotproductEPKdlS1_ll(ptr noundef %41, i64 noundef 1, ptr noundef %45, i64 noundef 1, i64 noundef %48)
  store double %49, ptr %17, align 8, !tbaa !12
  %50 = load double, ptr %17, align 8, !tbaa !12
  %51 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = load i64, ptr %14, align 8, !tbaa !9
  %54 = getelementptr inbounds double, ptr %52, i64 %53
  store double %50, ptr %54, align 8, !tbaa !12
  br label %55

55:                                               ; preds = %34
  %56 = load i64, ptr %14, align 8, !tbaa !9
  %57 = add nsw i64 %56, 1
  store i64 %57, ptr %14, align 8, !tbaa !9
  br label %29, !llvm.loop !14

58:                                               ; preds = %29
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %59, i32 0, i32 4
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  %62 = getelementptr inbounds double, ptr %61, i64 0
  %63 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %64 = load ptr, ptr %63, align 8, !tbaa !11
  %65 = getelementptr inbounds double, ptr %64, i64 0
  %66 = load i64, ptr %7, align 8, !tbaa !9
  %67 = sub nsw i64 %66, 1
  %68 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %67)
  %69 = call noundef double @_ZN11alglib_impl15ae_v_dotproductEPKdlS1_ll(ptr noundef %62, i64 noundef 1, ptr noundef %65, i64 noundef 1, i64 noundef %68)
  store double %69, ptr %16, align 8, !tbaa !12
  store i64 0, ptr %15, align 8, !tbaa !9
  br label %70

70:                                               ; preds = %99, %58
  %71 = load i64, ptr %15, align 8, !tbaa !9
  %72 = load i64, ptr %7, align 8, !tbaa !9
  %73 = sub nsw i64 %72, 1
  %74 = icmp sle i64 %71, %73
  br i1 %74, label %75, label %102

75:                                               ; preds = %70
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %76, i32 0, i32 4
  %78 = load ptr, ptr %77, align 8, !tbaa !11
  %79 = getelementptr inbounds double, ptr %78, i64 0
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %80, i32 0, i32 6
  %82 = load ptr, ptr %81, align 8, !tbaa !11
  %83 = getelementptr inbounds ptr, ptr %82, i64 0
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  %85 = load i64, ptr %15, align 8, !tbaa !9
  %86 = getelementptr inbounds double, ptr %84, i64 %85
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %87, i32 0, i32 2
  %89 = load i64, ptr %88, align 8, !tbaa !16
  %90 = load i64, ptr %7, align 8, !tbaa !9
  %91 = sub nsw i64 %90, 1
  %92 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %91)
  %93 = call noundef double @_ZN11alglib_impl15ae_v_dotproductEPKdlS1_ll(ptr noundef %79, i64 noundef 1, ptr noundef %86, i64 noundef %89, i64 noundef %92)
  store double %93, ptr %17, align 8, !tbaa !12
  %94 = load double, ptr %17, align 8, !tbaa !12
  %95 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %96 = load ptr, ptr %95, align 8, !tbaa !11
  %97 = load i64, ptr %15, align 8, !tbaa !9
  %98 = getelementptr inbounds double, ptr %96, i64 %97
  store double %94, ptr %98, align 8, !tbaa !12
  br label %99

99:                                               ; preds = %75
  %100 = load i64, ptr %15, align 8, !tbaa !9
  %101 = add nsw i64 %100, 1
  store i64 %101, ptr %15, align 8, !tbaa !9
  br label %70, !llvm.loop !20

102:                                              ; preds = %70
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %103

103:                                              ; preds = %131, %102
  %104 = load i64, ptr %14, align 8, !tbaa !9
  %105 = load i64, ptr %7, align 8, !tbaa !9
  %106 = sub nsw i64 %105, 1
  %107 = icmp sle i64 %104, %106
  br i1 %107, label %108, label %134

108:                                              ; preds = %103
  %109 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %110 = load ptr, ptr %109, align 8, !tbaa !11
  %111 = load i64, ptr %14, align 8, !tbaa !9
  %112 = getelementptr inbounds double, ptr %110, i64 %111
  %113 = load double, ptr %112, align 8, !tbaa !12
  %114 = load double, ptr %16, align 8, !tbaa !12
  %115 = fadd double 1.000000e+00, %114
  %116 = fdiv double %113, %115
  store double %116, ptr %17, align 8, !tbaa !12
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %117, i32 0, i32 6
  %119 = load ptr, ptr %118, align 8, !tbaa !11
  %120 = load i64, ptr %14, align 8, !tbaa !9
  %121 = getelementptr inbounds ptr, ptr %119, i64 %120
  %122 = load ptr, ptr %121, align 8, !tbaa !5
  %123 = getelementptr inbounds double, ptr %122, i64 0
  %124 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %125 = load ptr, ptr %124, align 8, !tbaa !11
  %126 = getelementptr inbounds double, ptr %125, i64 0
  %127 = load i64, ptr %7, align 8, !tbaa !9
  %128 = sub nsw i64 %127, 1
  %129 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %128)
  %130 = load double, ptr %17, align 8, !tbaa !12
  call void @_ZN11alglib_impl9ae_v_subdEPdlPKdlld(ptr noundef %123, i64 noundef 1, ptr noundef %126, i64 noundef 1, i64 noundef %129, double noundef %130)
  br label %131

131:                                              ; preds = %108
  %132 = load i64, ptr %14, align 8, !tbaa !9
  %133 = add nsw i64 %132, 1
  store i64 %133, ptr %14, align 8, !tbaa !9
  br label %103, !llvm.loop !21

134:                                              ; preds = %103
  %135 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %135)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #4
  ret void
}

declare noundef double @_ZN11alglib_impl15ae_v_dotproductEPKdlS1_ll(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef) #3

declare noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef, i64 noundef) #3

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

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #3

declare void @_ZN11alglib_impl9ae_v_subdEPdlPKdlld(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, double noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = !{!"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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !10, i64 16}
!17 = !{!"_ZTSN11alglib_impl9ae_matrixE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !18, i64 32, !19, i64 40, !7, i64 72}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}


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

; 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
define dso_local void @_ZN11alglib_impl18rmatrixinvupdateuvEPNS_9ae_matrixElPNS_9ae_vectorES3_PNS_8ae_stateE(ptr nocapture noundef readonly %0, i64 noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr noundef %4) local_unnamed_addr #2 {
  %6 = alloca %"struct.alglib_impl::ae_frame", align 8
  %7 = alloca %"struct.alglib_impl::ae_vector", align 8
  %8 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 64, 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 %4, ptr noundef nonnull %6)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %7, i8 0, i64 64, 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_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %7, i64 noundef 0, i64 noundef 3, ptr noundef %4, 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 %4, i1 noundef zeroext true)
  %9 = add nsw i64 %1, -1
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %7, i64 noundef %1, ptr noundef %4)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %1, ptr noundef %4)
  %.not.not42 = icmp sgt i64 %1, 0
  br i1 %.not.not42, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 72
  %11 = getelementptr inbounds i8, ptr %2, i64 56
  %12 = getelementptr inbounds i8, ptr %7, i64 56
  br label %13

13:                                               ; preds = %.lr.ph, %13
  %.043 = phi i64 [ 0, %.lr.ph ], [ %22, %13 ]
  %14 = load ptr, ptr %10, align 8, !tbaa !5
  %15 = getelementptr inbounds ptr, ptr %14, i64 %.043
  %16 = load ptr, ptr %15, align 8, !tbaa !8
  %17 = load ptr, ptr %11, align 8, !tbaa !5
  %18 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %9)
  %19 = call noundef double @_ZN11alglib_impl15ae_v_dotproductEPKdlS1_ll(ptr noundef %16, i64 noundef 1, ptr noundef %17, i64 noundef 1, i64 noundef %18)
  %20 = load ptr, ptr %12, align 8, !tbaa !5
  %21 = getelementptr inbounds double, ptr %20, i64 %.043
  store double %19, ptr %21, align 8, !tbaa !10
  %22 = add nuw nsw i64 %.043, 1
  %exitcond.not = icmp eq i64 %22, %1
  br i1 %exitcond.not, label %._crit_edge, label %13, !llvm.loop !12

._crit_edge:                                      ; preds = %13, %5
  %23 = getelementptr inbounds i8, ptr %3, i64 56
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %7, i64 56
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %9)
  %28 = call noundef double @_ZN11alglib_impl15ae_v_dotproductEPKdlS1_ll(ptr noundef %24, i64 noundef 1, ptr noundef %26, i64 noundef 1, i64 noundef %27)
  br i1 %.not.not42, label %.lr.ph47, label %._crit_edge51

.lr.ph47:                                         ; preds = %._crit_edge
  %29 = getelementptr inbounds i8, ptr %0, i64 72
  %30 = getelementptr inbounds i8, ptr %0, i64 16
  %31 = getelementptr inbounds i8, ptr %8, i64 56
  br label %35

.preheader:                                       ; preds = %35
  br i1 %.not.not42, label %.lr.ph50, label %._crit_edge51

.lr.ph50:                                         ; preds = %.preheader
  %32 = fadd double %28, 1.000000e+00
  %33 = getelementptr inbounds i8, ptr %0, i64 72
  %34 = getelementptr inbounds i8, ptr %8, i64 56
  br label %46

35:                                               ; preds = %.lr.ph47, %35
  %.03745 = phi i64 [ 0, %.lr.ph47 ], [ %45, %35 ]
  %36 = load ptr, ptr %23, align 8, !tbaa !5
  %37 = load ptr, ptr %29, align 8, !tbaa !5
  %38 = load ptr, ptr %37, align 8, !tbaa !8
  %39 = getelementptr inbounds double, ptr %38, i64 %.03745
  %40 = load i64, ptr %30, align 8, !tbaa !14
  %41 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %9)
  %42 = call noundef double @_ZN11alglib_impl15ae_v_dotproductEPKdlS1_ll(ptr noundef %36, i64 noundef 1, ptr noundef %39, i64 noundef %40, i64 noundef %41)
  %43 = load ptr, ptr %31, align 8, !tbaa !5
  %44 = getelementptr inbounds double, ptr %43, i64 %.03745
  store double %42, ptr %44, align 8, !tbaa !10
  %45 = add nuw nsw i64 %.03745, 1
  %exitcond52.not = icmp eq i64 %45, %1
  br i1 %exitcond52.not, label %.preheader, label %35, !llvm.loop !19

46:                                               ; preds = %.lr.ph50, %46
  %.149 = phi i64 [ 0, %.lr.ph50 ], [ %56, %46 ]
  %47 = load ptr, ptr %25, align 8, !tbaa !5
  %48 = getelementptr inbounds double, ptr %47, i64 %.149
  %49 = load double, ptr %48, align 8, !tbaa !10
  %50 = fdiv double %49, %32
  %51 = load ptr, ptr %33, align 8, !tbaa !5
  %52 = getelementptr inbounds ptr, ptr %51, i64 %.149
  %53 = load ptr, ptr %52, align 8, !tbaa !8
  %54 = load ptr, ptr %34, align 8, !tbaa !5
  %55 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %9)
  call void @_ZN11alglib_impl9ae_v_subdEPdlPKdlld(ptr noundef %53, i64 noundef 1, ptr noundef %54, i64 noundef 1, i64 noundef %55, double noundef %50)
  %56 = add nuw nsw i64 %.149, 1
  %exitcond53.not = icmp eq i64 %56, %1
  br i1 %exitcond53.not, label %._crit_edge51, label %46, !llvm.loop !20

._crit_edge51:                                    ; preds = %46, %._crit_edge, %.preheader
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  ret void
}

declare noundef double @_ZN11alglib_impl15ae_v_dotproductEPKdlS1_ll(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

declare noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef, i64 noundef) local_unnamed_addr #3

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

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

declare void @_ZN11alglib_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 void @_ZN11alglib_impl9ae_v_subdEPdlPKdlld(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, double noundef) local_unnamed_addr #3

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 = !{!"any pointer", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !16, i64 16}
!15 = !{!"_ZTSN11alglib_impl9ae_matrixE", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !17, i64 32, !18, i64 40, !6, i64 72}
!16 = !{!"long", !6, i64 0}
!17 = !{!"bool", !6, i64 0}
!18 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}


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