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

@.str.509 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.510 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.511 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.512 = external hidden unnamed_addr constant [53 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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl15cmatrixtrrcond1EPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl17cmatrixtrrcondinfEPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, ptr noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16cmatrixtrinverseEPNS_9ae_matrixElbbPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %4, ptr noundef %5) #4 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"struct.alglib_impl::ae_frame", align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca %"struct.alglib_impl::ae_vector", align 8
  %17 = alloca %"struct.alglib_impl::ae_complex", align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  %19 = zext i1 %2 to i8
  store i8 %19, ptr %9, align 1, !tbaa !11
  %20 = zext i1 %3 to i8
  store i8 %20, ptr %10, align 1, !tbaa !11
  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 32, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #5
  %21 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %21, ptr noundef %13)
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 64, i1 false)
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %22)
  %23 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %16, i64 noundef 0, i64 noundef 4, ptr noundef %23, i1 noundef zeroext true)
  %24 = load i64, ptr %8, align 8, !tbaa !9
  %25 = icmp sgt i64 %24, 0
  %26 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %25, ptr noundef @.str.509, ptr noundef %26)
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %27, i32 0, i32 1
  %29 = load i64, ptr %28, align 8, !tbaa !13
  %30 = load i64, ptr %8, align 8, !tbaa !9
  %31 = icmp sge i64 %29, %30
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %31, ptr noundef @.str.510, ptr noundef %32)
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %33, i32 0, i32 0
  %35 = load i64, ptr %34, align 8, !tbaa !16
  %36 = load i64, ptr %8, align 8, !tbaa !9
  %37 = icmp sge i64 %35, %36
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %37, ptr noundef @.str.511, ptr noundef %38)
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = load i64, ptr %8, align 8, !tbaa !9
  %41 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %42 = trunc i8 %41 to i1
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = call noundef zeroext i1 @_ZN11alglib_impl23apservisfinitectrmatrixEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef %39, i64 noundef %40, i1 noundef zeroext %42, ptr noundef %43)
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %44, ptr noundef @.str.512, ptr noundef %45)
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %46, i32 0, i32 0
  store i64 1, ptr %47, align 8, !tbaa !19
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = load i64, ptr %8, align 8, !tbaa !9
  %50 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %51 = trunc i8 %50 to i1
  %52 = load i8, ptr %10, align 1, !tbaa !11, !range !17, !noundef !18
  %53 = trunc i8 %52 to i1
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = call noundef double @_ZN11alglib_impl15cmatrixtrrcond1EPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef %48, i64 noundef %49, i1 noundef zeroext %51, i1 noundef zeroext %53, ptr noundef %54)
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %56, i32 0, i32 1
  store double %55, ptr %57, align 8, !tbaa !22
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = load i64, ptr %8, align 8, !tbaa !9
  %60 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %61 = trunc i8 %60 to i1
  %62 = load i8, ptr %10, align 1, !tbaa !11, !range !17, !noundef !18
  %63 = trunc i8 %62 to i1
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = call noundef double @_ZN11alglib_impl17cmatrixtrrcondinfEPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef %58, i64 noundef %59, i1 noundef zeroext %61, i1 noundef zeroext %63, ptr noundef %64)
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %66, i32 0, i32 2
  store double %65, ptr %67, align 8, !tbaa !23
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %68, i32 0, i32 1
  %70 = load double, ptr %69, align 8, !tbaa !22
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %71)
  %73 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %70, double noundef %72)
  br i1 %73, label %81, label %74

74:                                               ; preds = %6
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %75, i32 0, i32 2
  %77 = load double, ptr %76, align 8, !tbaa !23
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %78)
  %80 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %77, double noundef %79)
  br i1 %80, label %81, label %122

81:                                               ; preds = %74, %6
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %82

82:                                               ; preds = %111, %81
  %83 = load i64, ptr %14, align 8, !tbaa !9
  %84 = load i64, ptr %8, align 8, !tbaa !9
  %85 = sub nsw i64 %84, 1
  %86 = icmp sle i64 %83, %85
  br i1 %86, label %87, label %114

87:                                               ; preds = %82
  store i64 0, ptr %15, align 8, !tbaa !9
  br label %88

88:                                               ; preds = %107, %87
  %89 = load i64, ptr %15, align 8, !tbaa !9
  %90 = load i64, ptr %8, align 8, !tbaa !9
  %91 = sub nsw i64 %90, 1
  %92 = icmp sle i64 %89, %91
  br i1 %92, label %93, label %110

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #5
  %94 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %95 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %96 = extractvalue { double, double } %94, 0
  store double %96, ptr %95, align 8
  %97 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %98 = extractvalue { double, double } %94, 1
  store double %98, ptr %97, align 8
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %99, i32 0, i32 6
  %101 = load ptr, ptr %100, align 8, !tbaa !24
  %102 = load i64, ptr %14, align 8, !tbaa !9
  %103 = getelementptr inbounds ptr, ptr %101, i64 %102
  %104 = load ptr, ptr %103, align 8, !tbaa !5
  %105 = load i64, ptr %15, align 8, !tbaa !9
  %106 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %104, i64 %105
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %106, ptr align 8 %17, i64 16, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  br label %107

107:                                              ; preds = %93
  %108 = load i64, ptr %15, align 8, !tbaa !9
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %15, align 8, !tbaa !9
  br label %88, !llvm.loop !27

110:                                              ; preds = %88
  br label %111

111:                                              ; preds = %110
  %112 = load i64, ptr %14, align 8, !tbaa !9
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %14, align 8, !tbaa !9
  br label %82, !llvm.loop !29

114:                                              ; preds = %82
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %115, i32 0, i32 1
  store double 0.000000e+00, ptr %116, align 8, !tbaa !22
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %117, i32 0, i32 2
  store double 0.000000e+00, ptr %118, align 8, !tbaa !23
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %119, i32 0, i32 0
  store i64 -3, ptr %120, align 8, !tbaa !19
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %121)
  store i32 1, ptr %18, align 4
  br label %134

122:                                              ; preds = %74
  %123 = load i64, ptr %8, align 8, !tbaa !9
  %124 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %16, i64 noundef %123, ptr noundef %124)
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = load i64, ptr %8, align 8, !tbaa !9
  %127 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %128 = trunc i8 %127 to i1
  %129 = load i8, ptr %10, align 1, !tbaa !11, !range !17, !noundef !18
  %130 = trunc i8 %129 to i1
  %131 = load ptr, ptr %11, align 8, !tbaa !5
  %132 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_implL26matinv_cmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %125, i64 noundef 0, i64 noundef %126, i1 noundef zeroext %128, i1 noundef zeroext %130, ptr noundef %16, ptr noundef %131, ptr noundef %132)
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %133)
  store i32 0, ptr %18, align 4
  br label %134

134:                                              ; preds = %122, %114
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  %135 = load i32, ptr %18, align 4
  switch i32 %135, label %137 [
    i32 0, label %136
    i32 1, label %136
  ]

136:                                              ; preds = %134, %134
  ret void

137:                                              ; preds = %134
  unreachable
}

declare noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef, double noundef) #3

declare { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(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_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL26matinv_cmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #5 = { 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 = !{!14, !10, i64 8}
!14 = !{!"_ZTSN11alglib_impl9ae_matrixE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !15, i64 40, !7, i64 72}
!15 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!16 = !{!14, !10, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !10, i64 0}
!20 = !{!"_ZTSN11alglib_impl12matinvreportE", !10, i64 0, !21, i64 8, !21, i64 16}
!21 = !{!"double", !7, i64 0}
!22 = !{!20, !21, i64 8}
!23 = !{!20, !21, i64 16}
!24 = !{!7, !7, i64 0}
!25 = !{i64 0, i64 8, !26, i64 8, i64 8, !26}
!26 = !{!21, !21, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}


; 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.1 }
%union.anon.1 = type { ptr }
%"struct.alglib_impl::ae_complex" = type { double, double }

@.str.509 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.510 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.511 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.512 = external hidden unnamed_addr constant [53 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_impl15cmatrixtrrcond1EPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16cmatrixtrinverseEPNS_9ae_matrixElbbPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #3 {
  %7 = alloca %"struct.alglib_impl::ae_frame", align 8
  %8 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, 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 %5, ptr noundef nonnull %7)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %8, i8 0, i64 64, i1 false)
  call void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %4)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %8, i64 noundef 0, i64 noundef 4, ptr noundef %5, i1 noundef zeroext true)
  %9 = icmp sgt i64 %1, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef nonnull @.str.509, ptr noundef %5)
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load i64, ptr %10, align 8, !tbaa !5
  %12 = icmp sge i64 %11, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %12, ptr noundef nonnull @.str.510, ptr noundef %5)
  %13 = load i64, ptr %0, align 8, !tbaa !13
  %14 = icmp sge i64 %13, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.511, ptr noundef %5)
  %15 = call noundef zeroext i1 @_ZN11alglib_impl23apservisfinitectrmatrixEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %5)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %15, ptr noundef nonnull @.str.512, ptr noundef %5)
  store i64 1, ptr %4, align 8, !tbaa !14
  %16 = call noundef double @_ZN11alglib_impl15cmatrixtrrcond1EPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %5)
  %17 = getelementptr inbounds i8, ptr %4, i64 8
  store double %16, ptr %17, align 8, !tbaa !17
  %18 = call noundef double @_ZN11alglib_impl17cmatrixtrrcondinfEPKNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %5)
  %19 = getelementptr inbounds i8, ptr %4, i64 16
  store double %18, ptr %19, align 8, !tbaa !18
  %20 = load double, ptr %17, align 8, !tbaa !17
  %21 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %5)
  %22 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %20, double noundef %21)
  br i1 %22, label %27, label %23

23:                                               ; preds = %6
  %24 = load double, ptr %19, align 8, !tbaa !18
  %25 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %5)
  %26 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %24, double noundef %25)
  br i1 %26, label %27, label %39

27:                                               ; preds = %23, %6
  br i1 %9, label %.preheader.lr.ph, label %._crit_edge61

.preheader.lr.ph:                                 ; preds = %27
  %28 = getelementptr inbounds i8, ptr %0, i64 72
  br label %.preheader.us

.preheader.us:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph
  %.060.us = phi i64 [ 0, %.preheader.lr.ph ], [ %38, %._crit_edge.us ]
  br label %29

29:                                               ; preds = %.preheader.us, %29
  %.05458.us = phi i64 [ 0, %.preheader.us ], [ %37, %29 ]
  %30 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %31 = extractvalue { double, double } %30, 0
  %32 = extractvalue { double, double } %30, 1
  %33 = load ptr, ptr %28, align 8, !tbaa !19
  %34 = getelementptr inbounds ptr, ptr %33, i64 %.060.us
  %35 = load ptr, ptr %34, align 8, !tbaa !20
  %36 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %35, i64 %.05458.us
  store double %31, ptr %36, align 8, !tbaa !21
  %.sroa.4.0..sroa_idx.us = getelementptr inbounds i8, ptr %36, i64 8
  store double %32, ptr %.sroa.4.0..sroa_idx.us, align 8, !tbaa !21
  %37 = add nuw nsw i64 %.05458.us, 1
  %exitcond.not = icmp eq i64 %37, %1
  br i1 %exitcond.not, label %._crit_edge.us, label %29, !llvm.loop !22

._crit_edge.us:                                   ; preds = %29
  %38 = add nuw nsw i64 %.060.us, 1
  %exitcond62.not = icmp eq i64 %38, %1
  br i1 %exitcond62.not, label %._crit_edge61, label %.preheader.us, !llvm.loop !24

._crit_edge61:                                    ; preds = %._crit_edge.us, %27
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %17, i8 0, i64 16, i1 false)
  store i64 -3, ptr %4, align 8, !tbaa !14
  br label %40

39:                                               ; preds = %23
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %1, ptr noundef %5)
  call void @_ZN11alglib_implL26matinv_cmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef 0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef nonnull %8, ptr noundef nonnull %4, ptr noundef %5)
  br label %40

40:                                               ; preds = %39, %._crit_edge61
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %5)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  ret void
}

declare noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef, double noundef) local_unnamed_addr #2

declare { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef) local_unnamed_addr #2

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #2

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

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

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

declare noundef zeroext i1 @_ZN11alglib_impl23apservisfinitectrmatrixEPKNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL26matinv_cmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, ptr noundef, ptr noundef, ptr 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 = { "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, !7, i64 8}
!6 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 40, !8, i64 72}
!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 = !{!6, !7, i64 0}
!14 = !{!15, !7, i64 0}
!15 = !{!"_ZTSN11alglib_impl12matinvreportE", !7, i64 0, !16, i64 8, !16, i64 16}
!16 = !{!"double", !8, i64 0}
!17 = !{!15, !16, i64 8}
!18 = !{!15, !16, i64 16}
!19 = !{!8, !8, i64 0}
!20 = !{!12, !12, i64 0}
!21 = !{!16, !16, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


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