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

@.str.452 = external hidden unnamed_addr constant [22 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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl13rmatrixrcond2EPKNS_9ae_matrixElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN11alglib_impl15rmatrixtrrcond2EPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %4) #3 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca %"struct.alglib_impl::ae_frame", align 8
  %12 = alloca %"struct.alglib_impl::ae_matrix", align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, 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
  %18 = zext i1 %2 to i8
  store i8 %18, ptr %8, align 1, !tbaa !11
  %19 = zext i1 %3 to i8
  store i8 %19, ptr %9, align 1, !tbaa !11
  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 80, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, 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
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %20, ptr noundef %11)
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 80, i1 false)
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl19ae_matrix_init_copyEPNS_9ae_matrixEPKS0_PNS_8ae_stateEb(ptr noundef %12, ptr noundef %21, ptr noundef %22, i1 noundef zeroext true)
  %23 = load i64, ptr %7, align 8, !tbaa !9
  %24 = icmp sge i64 %23, 1
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %24, ptr noundef @.str.452, ptr noundef %25)
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %26

26:                                               ; preds = %71, %5
  %27 = load i64, ptr %13, align 8, !tbaa !9
  %28 = load i64, ptr %7, align 8, !tbaa !9
  %29 = sub nsw i64 %28, 1
  %30 = icmp sle i64 %27, %29
  br i1 %30, label %31, label %74

31:                                               ; preds = %26
  %32 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %33 = trunc i8 %32 to i1
  br i1 %33, label %34, label %37

34:                                               ; preds = %31
  store i64 0, ptr %15, align 8, !tbaa !9
  %35 = load i64, ptr %13, align 8, !tbaa !9
  %36 = sub nsw i64 %35, 1
  store i64 %36, ptr %16, align 8, !tbaa !9
  br label %42

37:                                               ; preds = %31
  %38 = load i64, ptr %13, align 8, !tbaa !9
  %39 = add nsw i64 %38, 1
  store i64 %39, ptr %15, align 8, !tbaa !9
  %40 = load i64, ptr %7, align 8, !tbaa !9
  %41 = sub nsw i64 %40, 1
  store i64 %41, ptr %16, align 8, !tbaa !9
  br label %42

42:                                               ; preds = %37, %34
  %43 = load i64, ptr %15, align 8, !tbaa !9
  store i64 %43, ptr %14, align 8, !tbaa !9
  br label %44

44:                                               ; preds = %56, %42
  %45 = load i64, ptr %14, align 8, !tbaa !9
  %46 = load i64, ptr %16, align 8, !tbaa !9
  %47 = icmp sle i64 %45, %46
  br i1 %47, label %48, label %59

48:                                               ; preds = %44
  %49 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %12, i32 0, i32 6
  %50 = load ptr, ptr %49, align 8, !tbaa !15
  %51 = load i64, ptr %13, align 8, !tbaa !9
  %52 = getelementptr inbounds ptr, ptr %50, i64 %51
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = load i64, ptr %14, align 8, !tbaa !9
  %55 = getelementptr inbounds double, ptr %53, i64 %54
  store double 0.000000e+00, ptr %55, align 8, !tbaa !16
  br label %56

56:                                               ; preds = %48
  %57 = load i64, ptr %14, align 8, !tbaa !9
  %58 = add nsw i64 %57, 1
  store i64 %58, ptr %14, align 8, !tbaa !9
  br label %44, !llvm.loop !18

59:                                               ; preds = %44
  %60 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %61 = trunc i8 %60 to i1
  br i1 %61, label %62, label %70

62:                                               ; preds = %59
  %63 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %12, i32 0, i32 6
  %64 = load ptr, ptr %63, align 8, !tbaa !15
  %65 = load i64, ptr %13, align 8, !tbaa !9
  %66 = getelementptr inbounds ptr, ptr %64, i64 %65
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = load i64, ptr %13, align 8, !tbaa !9
  %69 = getelementptr inbounds double, ptr %67, i64 %68
  store double 1.000000e+00, ptr %69, align 8, !tbaa !16
  br label %70

70:                                               ; preds = %62, %59
  br label %71

71:                                               ; preds = %70
  %72 = load i64, ptr %13, align 8, !tbaa !9
  %73 = add nsw i64 %72, 1
  store i64 %73, ptr %13, align 8, !tbaa !9
  br label %26, !llvm.loop !20

74:                                               ; preds = %26
  %75 = load i64, ptr %7, align 8, !tbaa !9
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = call noundef double @_ZN11alglib_impl13rmatrixrcond2EPKNS_9ae_matrixElPNS_8ae_stateE(ptr noundef %12, i64 noundef %75, ptr noundef %76)
  store double %77, ptr %17, align 8, !tbaa !16
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %78)
  %79 = load double, ptr %17, align 8, !tbaa !16
  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 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #4
  ret double %79
}

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #2

declare void @_ZN11alglib_impl19ae_matrix_init_copyEPNS_9ae_matrixEPKS0_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!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}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.alglib_impl::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }

@.str.452 = external hidden unnamed_addr constant [22 x i8], align 1

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl13rmatrixrcond2EPKNS_9ae_matrixElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN11alglib_impl15rmatrixtrrcond2EPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %4) local_unnamed_addr #3 {
  %6 = alloca %"struct.alglib_impl::ae_frame", align 8
  %7 = alloca %"struct.alglib_impl::ae_matrix", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %7) #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(80) %7, i8 0, i64 80, i1 false)
  call void @_ZN11alglib_impl19ae_matrix_init_copyEPNS_9ae_matrixEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %7, ptr noundef %0, ptr noundef %4, i1 noundef zeroext true)
  %8 = icmp sgt i64 %1, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %8, ptr noundef nonnull @.str.452, ptr noundef %4)
  br i1 %8, label %.lr.ph34, label %._crit_edge35

.lr.ph34:                                         ; preds = %5
  %9 = getelementptr inbounds i8, ptr %7, i64 72
  br i1 %3, label %.lr.ph34.split.us, label %.lr.ph34.split

.lr.ph34.split.us:                                ; preds = %.lr.ph34
  br i1 %2, label %.lr.ph34.split.us.split.us, label %.lr.ph34.split.us.split

.lr.ph34.split.us.split.us:                       ; preds = %.lr.ph34.split.us, %._crit_edge.us.us
  %.032.us.us = phi i64 [ %10, %._crit_edge.us.us ], [ 0, %.lr.ph34.split.us ]
  %10 = add nuw nsw i64 %.032.us.us, 1
  %.not.not2829.us.us.not = icmp eq i64 %.032.us.us, 0
  br i1 %.not.not2829.us.us.not, label %._crit_edge.us.us, label %.lr.ph.us.us.preheader

.lr.ph.us.us.preheader:                           ; preds = %.lr.ph34.split.us.split.us
  %xtraiter65 = and i64 %.032.us.us, 3
  %11 = icmp ult i64 %.032.us.us, 4
  br i1 %11, label %._crit_edge.us.us.loopexit.unr-lcssa, label %.lr.ph.us.us.preheader.new

.lr.ph.us.us.preheader.new:                       ; preds = %.lr.ph.us.us.preheader
  %unroll_iter68 = and i64 %.032.us.us, 9223372036854775804
  br label %.lr.ph.us.us

._crit_edge.us.us.loopexit.unr-lcssa:             ; preds = %.lr.ph.us.us, %.lr.ph.us.us.preheader
  %.02630.us.us.unr = phi i64 [ 0, %.lr.ph.us.us.preheader ], [ %40, %.lr.ph.us.us ]
  %lcmp.mod67.not = icmp eq i64 %xtraiter65, 0
  br i1 %lcmp.mod67.not, label %._crit_edge.us.us, label %.lr.ph.us.us.epil

.lr.ph.us.us.epil:                                ; preds = %._crit_edge.us.us.loopexit.unr-lcssa, %.lr.ph.us.us.epil
  %.02630.us.us.epil = phi i64 [ %16, %.lr.ph.us.us.epil ], [ %.02630.us.us.unr, %._crit_edge.us.us.loopexit.unr-lcssa ]
  %epil.iter66 = phi i64 [ %epil.iter66.next, %.lr.ph.us.us.epil ], [ 0, %._crit_edge.us.us.loopexit.unr-lcssa ]
  %12 = load ptr, ptr %9, align 8, !tbaa !5
  %13 = getelementptr inbounds ptr, ptr %12, i64 %.032.us.us
  %14 = load ptr, ptr %13, align 8, !tbaa !8
  %15 = getelementptr inbounds double, ptr %14, i64 %.02630.us.us.epil
  store double 0.000000e+00, ptr %15, align 8, !tbaa !10
  %16 = add nuw nsw i64 %.02630.us.us.epil, 1
  %epil.iter66.next = add i64 %epil.iter66, 1
  %epil.iter66.cmp.not = icmp eq i64 %epil.iter66.next, %xtraiter65
  br i1 %epil.iter66.cmp.not, label %._crit_edge.us.us, label %.lr.ph.us.us.epil, !llvm.loop !12

._crit_edge.us.us:                                ; preds = %._crit_edge.us.us.loopexit.unr-lcssa, %.lr.ph.us.us.epil, %.lr.ph34.split.us.split.us
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = getelementptr inbounds ptr, ptr %17, i64 %.032.us.us
  %19 = load ptr, ptr %18, align 8, !tbaa !8
  %20 = getelementptr inbounds double, ptr %19, i64 %.032.us.us
  store double 1.000000e+00, ptr %20, align 8, !tbaa !10
  %exitcond51.not = icmp eq i64 %10, %1
  br i1 %exitcond51.not, label %._crit_edge35, label %.lr.ph34.split.us.split.us, !llvm.loop !14

.lr.ph.us.us:                                     ; preds = %.lr.ph.us.us, %.lr.ph.us.us.preheader.new
  %.02630.us.us = phi i64 [ 0, %.lr.ph.us.us.preheader.new ], [ %40, %.lr.ph.us.us ]
  %niter69 = phi i64 [ 0, %.lr.ph.us.us.preheader.new ], [ %niter69.next.3, %.lr.ph.us.us ]
  %21 = load ptr, ptr %9, align 8, !tbaa !5
  %22 = getelementptr inbounds ptr, ptr %21, i64 %.032.us.us
  %23 = load ptr, ptr %22, align 8, !tbaa !8
  %24 = getelementptr inbounds double, ptr %23, i64 %.02630.us.us
  store double 0.000000e+00, ptr %24, align 8, !tbaa !10
  %25 = or disjoint i64 %.02630.us.us, 1
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds ptr, ptr %26, i64 %.032.us.us
  %28 = load ptr, ptr %27, align 8, !tbaa !8
  %29 = getelementptr inbounds double, ptr %28, i64 %25
  store double 0.000000e+00, ptr %29, align 8, !tbaa !10
  %30 = or disjoint i64 %.02630.us.us, 2
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = getelementptr inbounds ptr, ptr %31, i64 %.032.us.us
  %33 = load ptr, ptr %32, align 8, !tbaa !8
  %34 = getelementptr inbounds double, ptr %33, i64 %30
  store double 0.000000e+00, ptr %34, align 8, !tbaa !10
  %35 = or disjoint i64 %.02630.us.us, 3
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds ptr, ptr %36, i64 %.032.us.us
  %38 = load ptr, ptr %37, align 8, !tbaa !8
  %39 = getelementptr inbounds double, ptr %38, i64 %35
  store double 0.000000e+00, ptr %39, align 8, !tbaa !10
  %40 = add nuw nsw i64 %.02630.us.us, 4
  %niter69.next.3 = add i64 %niter69, 4
  %niter69.ncmp.3 = icmp eq i64 %niter69.next.3, %unroll_iter68
  br i1 %niter69.ncmp.3, label %._crit_edge.us.us.loopexit.unr-lcssa, label %.lr.ph.us.us, !llvm.loop !16

.lr.ph34.split.us.split:                          ; preds = %.lr.ph34.split.us, %._crit_edge.us
  %.032.us = phi i64 [ %41, %._crit_edge.us ], [ 0, %.lr.ph34.split.us ]
  %41 = add nuw nsw i64 %.032.us, 1
  %.not.not2829.us = icmp slt i64 %41, %1
  br i1 %.not.not2829.us, label %.lr.ph.us, label %._crit_edge.us

._crit_edge.us:                                   ; preds = %.lr.ph.us, %.lr.ph34.split.us.split
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = getelementptr inbounds ptr, ptr %42, i64 %.032.us
  %44 = load ptr, ptr %43, align 8, !tbaa !8
  %45 = getelementptr inbounds double, ptr %44, i64 %.032.us
  store double 1.000000e+00, ptr %45, align 8, !tbaa !10
  %exitcond49.not = icmp eq i64 %41, %1
  br i1 %exitcond49.not, label %._crit_edge35, label %.lr.ph34.split.us.split, !llvm.loop !14

.lr.ph.us:                                        ; preds = %.lr.ph34.split.us.split, %.lr.ph.us
  %.02630.us = phi i64 [ %50, %.lr.ph.us ], [ %41, %.lr.ph34.split.us.split ]
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds ptr, ptr %46, i64 %.032.us
  %48 = load ptr, ptr %47, align 8, !tbaa !8
  %49 = getelementptr inbounds double, ptr %48, i64 %.02630.us
  store double 0.000000e+00, ptr %49, align 8, !tbaa !10
  %50 = add nuw nsw i64 %.02630.us, 1
  %.not.not28.us = icmp slt i64 %50, %1
  br i1 %.not.not28.us, label %.lr.ph.us, label %._crit_edge.us, !llvm.loop !16

.lr.ph34.split:                                   ; preds = %.lr.ph34
  br i1 %2, label %.lr.ph34.split.split.us, label %.lr.ph34.split.split.preheader

.lr.ph34.split.split.preheader:                   ; preds = %.lr.ph34.split
  %xtraiter = and i64 %1, 1
  %51 = icmp eq i64 %1, 1
  br i1 %51, label %._crit_edge35.loopexit60.unr-lcssa, label %.lr.ph34.split.split.preheader.new

.lr.ph34.split.split.preheader.new:               ; preds = %.lr.ph34.split.split.preheader
  %unroll_iter = and i64 %1, 9223372036854775806
  br label %.lr.ph34.split.split

.lr.ph34.split.split.us:                          ; preds = %.lr.ph34.split, %._crit_edge.us41
  %.032.us36 = phi i64 [ %52, %._crit_edge.us41 ], [ 0, %.lr.ph34.split ]
  %52 = add nuw nsw i64 %.032.us36, 1
  %.not.not2829.us43.not = icmp eq i64 %.032.us36, 0
  br i1 %.not.not2829.us43.not, label %._crit_edge.us41, label %.lr.ph.us40.preheader

.lr.ph.us40.preheader:                            ; preds = %.lr.ph34.split.split.us
  %xtraiter61 = and i64 %.032.us36, 3
  %53 = icmp ult i64 %.032.us36, 4
  br i1 %53, label %._crit_edge.us41.loopexit.unr-lcssa, label %.lr.ph.us40.preheader.new

.lr.ph.us40.preheader.new:                        ; preds = %.lr.ph.us40.preheader
  %unroll_iter63 = and i64 %.032.us36, 9223372036854775804
  br label %.lr.ph.us40

._crit_edge.us41.loopexit.unr-lcssa:              ; preds = %.lr.ph.us40, %.lr.ph.us40.preheader
  %.02630.us38.unr = phi i64 [ 0, %.lr.ph.us40.preheader ], [ %78, %.lr.ph.us40 ]
  %lcmp.mod62.not = icmp eq i64 %xtraiter61, 0
  br i1 %lcmp.mod62.not, label %._crit_edge.us41, label %.lr.ph.us40.epil

.lr.ph.us40.epil:                                 ; preds = %._crit_edge.us41.loopexit.unr-lcssa, %.lr.ph.us40.epil
  %.02630.us38.epil = phi i64 [ %58, %.lr.ph.us40.epil ], [ %.02630.us38.unr, %._crit_edge.us41.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.us40.epil ], [ 0, %._crit_edge.us41.loopexit.unr-lcssa ]
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds ptr, ptr %54, i64 %.032.us36
  %56 = load ptr, ptr %55, align 8, !tbaa !8
  %57 = getelementptr inbounds double, ptr %56, i64 %.02630.us38.epil
  store double 0.000000e+00, ptr %57, align 8, !tbaa !10
  %58 = add nuw nsw i64 %.02630.us38.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter61
  br i1 %epil.iter.cmp.not, label %._crit_edge.us41, label %.lr.ph.us40.epil, !llvm.loop !17

._crit_edge.us41:                                 ; preds = %._crit_edge.us41.loopexit.unr-lcssa, %.lr.ph.us40.epil, %.lr.ph34.split.split.us
  %exitcond48.not = icmp eq i64 %52, %1
  br i1 %exitcond48.not, label %._crit_edge35, label %.lr.ph34.split.split.us, !llvm.loop !14

.lr.ph.us40:                                      ; preds = %.lr.ph.us40, %.lr.ph.us40.preheader.new
  %.02630.us38 = phi i64 [ 0, %.lr.ph.us40.preheader.new ], [ %78, %.lr.ph.us40 ]
  %niter64 = phi i64 [ 0, %.lr.ph.us40.preheader.new ], [ %niter64.next.3, %.lr.ph.us40 ]
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds ptr, ptr %59, i64 %.032.us36
  %61 = load ptr, ptr %60, align 8, !tbaa !8
  %62 = getelementptr inbounds double, ptr %61, i64 %.02630.us38
  store double 0.000000e+00, ptr %62, align 8, !tbaa !10
  %63 = or disjoint i64 %.02630.us38, 1
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds ptr, ptr %64, i64 %.032.us36
  %66 = load ptr, ptr %65, align 8, !tbaa !8
  %67 = getelementptr inbounds double, ptr %66, i64 %63
  store double 0.000000e+00, ptr %67, align 8, !tbaa !10
  %68 = or disjoint i64 %.02630.us38, 2
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds ptr, ptr %69, i64 %.032.us36
  %71 = load ptr, ptr %70, align 8, !tbaa !8
  %72 = getelementptr inbounds double, ptr %71, i64 %68
  store double 0.000000e+00, ptr %72, align 8, !tbaa !10
  %73 = or disjoint i64 %.02630.us38, 3
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = getelementptr inbounds ptr, ptr %74, i64 %.032.us36
  %76 = load ptr, ptr %75, align 8, !tbaa !8
  %77 = getelementptr inbounds double, ptr %76, i64 %73
  store double 0.000000e+00, ptr %77, align 8, !tbaa !10
  %78 = add nuw nsw i64 %.02630.us38, 4
  %niter64.next.3 = add i64 %niter64, 4
  %niter64.ncmp.3 = icmp eq i64 %niter64.next.3, %unroll_iter63
  br i1 %niter64.ncmp.3, label %._crit_edge.us41.loopexit.unr-lcssa, label %.lr.ph.us40, !llvm.loop !16

.lr.ph34.split.split:                             ; preds = %._crit_edge.1, %.lr.ph34.split.split.preheader.new
  %.032 = phi i64 [ 0, %.lr.ph34.split.split.preheader.new ], [ %85, %._crit_edge.1 ]
  %niter = phi i64 [ 0, %.lr.ph34.split.split.preheader.new ], [ %niter.next.1, %._crit_edge.1 ]
  %79 = or disjoint i64 %.032, 1
  %.not.not2829 = icmp slt i64 %79, %1
  br i1 %.not.not2829, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph34.split.split, %.lr.ph
  %.02630 = phi i64 [ %84, %.lr.ph ], [ %79, %.lr.ph34.split.split ]
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = getelementptr inbounds ptr, ptr %80, i64 %.032
  %82 = load ptr, ptr %81, align 8, !tbaa !8
  %83 = getelementptr inbounds double, ptr %82, i64 %.02630
  store double 0.000000e+00, ptr %83, align 8, !tbaa !10
  %84 = add nuw nsw i64 %.02630, 1
  %.not.not28 = icmp slt i64 %84, %1
  br i1 %.not.not28, label %.lr.ph, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph34.split.split
  %85 = add nuw nsw i64 %.032, 2
  %.not.not2829.1 = icmp slt i64 %85, %1
  br i1 %.not.not2829.1, label %.lr.ph.1, label %._crit_edge.1

.lr.ph.1:                                         ; preds = %._crit_edge, %.lr.ph.1
  %.02630.1 = phi i64 [ %90, %.lr.ph.1 ], [ %85, %._crit_edge ]
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = getelementptr inbounds ptr, ptr %86, i64 %79
  %88 = load ptr, ptr %87, align 8, !tbaa !8
  %89 = getelementptr inbounds double, ptr %88, i64 %.02630.1
  store double 0.000000e+00, ptr %89, align 8, !tbaa !10
  %90 = add nuw nsw i64 %.02630.1, 1
  %.not.not28.1 = icmp slt i64 %90, %1
  br i1 %.not.not28.1, label %.lr.ph.1, label %._crit_edge.1, !llvm.loop !16

._crit_edge.1:                                    ; preds = %.lr.ph.1, %._crit_edge
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge35.loopexit60.unr-lcssa, label %.lr.ph34.split.split, !llvm.loop !14

._crit_edge35.loopexit60.unr-lcssa:               ; preds = %._crit_edge.1, %.lr.ph34.split.split.preheader
  %.032.unr = phi i64 [ 0, %.lr.ph34.split.split.preheader ], [ %85, %._crit_edge.1 ]
  %lcmp.mod.not = icmp ne i64 %xtraiter, 0
  %91 = add nuw nsw i64 %.032.unr, 1
  %.not.not2829.epil = icmp slt i64 %91, %1
  %or.cond = select i1 %lcmp.mod.not, i1 %.not.not2829.epil, i1 false
  br i1 %or.cond, label %.lr.ph.epil, label %._crit_edge35

.lr.ph.epil:                                      ; preds = %._crit_edge35.loopexit60.unr-lcssa, %.lr.ph.epil
  %.02630.epil = phi i64 [ %96, %.lr.ph.epil ], [ %91, %._crit_edge35.loopexit60.unr-lcssa ]
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds ptr, ptr %92, i64 %.032.unr
  %94 = load ptr, ptr %93, align 8, !tbaa !8
  %95 = getelementptr inbounds double, ptr %94, i64 %.02630.epil
  store double 0.000000e+00, ptr %95, align 8, !tbaa !10
  %96 = add nuw nsw i64 %.02630.epil, 1
  %.not.not28.epil = icmp slt i64 %96, %1
  br i1 %.not.not28.epil, label %.lr.ph.epil, label %._crit_edge35, !llvm.loop !16

._crit_edge35:                                    ; preds = %._crit_edge35.loopexit60.unr-lcssa, %.lr.ph.epil, %._crit_edge.us41, %._crit_edge.us, %._crit_edge.us.us, %5
  %97 = call noundef double @_ZN11alglib_impl13rmatrixrcond2EPKNS_9ae_matrixElPNS_8ae_stateE(ptr noundef nonnull %7, i64 noundef %1, ptr noundef %4)
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  ret double %97
}

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl19ae_matrix_init_copyEPNS_9ae_matrixEPKS0_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { "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 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 = !{!"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.unroll.disable"}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !13}


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