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

@.str.318 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.319 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.320 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.321 = 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 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

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

; 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) #3

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

77:                                               ; preds = %7
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %78, i32 0, i32 1
  %80 = load double, ptr %79, align 8, !tbaa !22
  %81 = load ptr, ptr %14, align 8, !tbaa !5
  %82 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %81)
  %83 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %80, double noundef %82)
  br i1 %83, label %84, label %124

84:                                               ; preds = %77, %7
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %85

85:                                               ; preds = %114, %84
  %86 = load i64, ptr %16, align 8, !tbaa !9
  %87 = load i64, ptr %9, align 8, !tbaa !9
  %88 = sub nsw i64 %87, 1
  %89 = icmp sle i64 %86, %88
  br i1 %89, label %90, label %117

90:                                               ; preds = %85
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %91

91:                                               ; preds = %110, %90
  %92 = load i64, ptr %17, align 8, !tbaa !9
  %93 = load i64, ptr %9, align 8, !tbaa !9
  %94 = sub nsw i64 %93, 1
  %95 = icmp sle i64 %92, %94
  br i1 %95, label %96, label %113

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

110:                                              ; preds = %96
  %111 = load i64, ptr %17, align 8, !tbaa !9
  %112 = add nsw i64 %111, 1
  store i64 %112, ptr %17, align 8, !tbaa !9
  br label %91, !llvm.loop !26

113:                                              ; preds = %91
  br label %114

114:                                              ; preds = %113
  %115 = load i64, ptr %16, align 8, !tbaa !9
  %116 = add nsw i64 %115, 1
  store i64 %116, ptr %16, align 8, !tbaa !9
  br label %85, !llvm.loop !28

117:                                              ; preds = %85
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %118, i32 0, i32 0
  store double 0.000000e+00, ptr %119, align 8, !tbaa !19
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %120, i32 0, i32 1
  store double 0.000000e+00, ptr %121, align 8, !tbaa !22
  %122 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 -3, ptr %122, align 8, !tbaa !9
  %123 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %123)
  store i32 1, ptr %21, align 4
  br label %139

124:                                              ; preds = %77
  %125 = load i64, ptr %9, align 8, !tbaa !9
  %126 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %18, i64 noundef %125, ptr noundef %126)
  %127 = getelementptr inbounds %"struct.alglib_impl::sinteger", ptr %19, i32 0, i32 0
  store i64 1, ptr %127, align 8, !tbaa !29
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  %129 = load i64, ptr %9, align 8, !tbaa !9
  %130 = load i8, ptr %10, align 1, !tbaa !11, !range !17, !noundef !18
  %131 = trunc i8 %130 to i1
  %132 = load i8, ptr %11, align 1, !tbaa !11, !range !17, !noundef !18
  %133 = trunc i8 %132 to i1
  %134 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_implL26matinv_cmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_8sintegerEPNS_8ae_stateE(ptr noundef %128, i64 noundef 0, i64 noundef %129, i1 noundef zeroext %131, i1 noundef zeroext %133, ptr noundef %18, ptr noundef %19, ptr noundef %134)
  %135 = getelementptr inbounds %"struct.alglib_impl::sinteger", ptr %19, i32 0, i32 0
  %136 = load i64, ptr %135, align 8, !tbaa !29
  %137 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 %136, ptr %137, align 8, !tbaa !9
  %138 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %138)
  store i32 0, ptr %21, align 4
  br label %139

139:                                              ; preds = %124, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  %140 = load i32, ptr %21, align 4
  switch i32 %140, label %142 [
    i32 0, label %141
    i32 1, label %141
  ]

141:                                              ; preds = %139, %139
  ret void

142:                                              ; preds = %139
  unreachable
}

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

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #2

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

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

; 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 void @_ZN11alglib_impl14_sinteger_initEPvPNS_8ae_stateEb(ptr noundef, ptr noundef, i1 noundef zeroext) #2

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL26matinv_cmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_8sintegerEPNS_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: 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !21, i64 0}
!20 = !{!"_ZTSN11alglib_impl12matinvreportE", !21, i64 0, !21, i64 8}
!21 = !{!"double", !7, i64 0}
!22 = !{!20, !21, i64 8}
!23 = !{!7, !7, i64 0}
!24 = !{i64 0, i64 8, !25, i64 8, i64 8, !25}
!25 = !{!21, !21, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = !{!30, !10, i64 0}
!30 = !{!"_ZTSN11alglib_impl8sintegerE", !10, i64 0}


; 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 }
%"struct.alglib_impl::sinteger" = type { i64 }
%"struct.alglib_impl::ae_complex" = type { double, double }

@.str.318 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.319 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.320 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.321 = 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 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

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_impl15cmatrixtrrcond1EPNS_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_impl17cmatrixtrrcondinfEPNS_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_matrixElbbPlPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr nocapture noundef writeonly %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #3 {
  %8 = alloca %"struct.alglib_impl::ae_frame", align 8
  %9 = alloca %"struct.alglib_impl::ae_vector", align 8
  %10 = alloca %"struct.alglib_impl::sinteger", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %6, ptr noundef nonnull %8)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %9, i8 0, i64 64, i1 false)
  store i64 0, ptr %10, align 8
  store i64 0, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %5)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %9, i64 noundef 0, i64 noundef 4, ptr noundef %6, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14_sinteger_initEPvPNS_8ae_stateEb(ptr noundef nonnull %10, ptr noundef %6, i1 noundef zeroext true)
  %11 = icmp sgt i64 %1, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %11, ptr noundef nonnull @.str.318, ptr noundef %6)
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load i64, ptr %12, align 8, !tbaa !9
  %14 = icmp sge i64 %13, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.319, ptr noundef %6)
  %15 = load i64, ptr %0, align 8, !tbaa !14
  %16 = icmp sge i64 %15, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %16, ptr noundef nonnull @.str.320, ptr noundef %6)
  %17 = call noundef zeroext i1 @_ZN11alglib_impl23apservisfinitectrmatrixEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %6)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %17, ptr noundef nonnull @.str.321, ptr noundef %6)
  %18 = call noundef double @_ZN11alglib_impl15cmatrixtrrcond1EPNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %6)
  store double %18, ptr %5, align 8, !tbaa !15
  %19 = call noundef double @_ZN11alglib_impl17cmatrixtrrcondinfEPNS_9ae_matrixElbbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef %6)
  %20 = getelementptr inbounds i8, ptr %5, i64 8
  store double %19, ptr %20, align 8, !tbaa !18
  %21 = load double, ptr %5, align 8, !tbaa !15
  %22 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %6)
  %23 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %21, double noundef %22)
  br i1 %23, label %28, label %24

24:                                               ; preds = %7
  %25 = load double, ptr %20, align 8, !tbaa !18
  %26 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %6)
  %27 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %25, double noundef %26)
  br i1 %27, label %28, label %40

28:                                               ; preds = %24, %7
  br i1 %11, label %.preheader.lr.ph, label %._crit_edge62

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

.preheader.us:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph
  %.061.us = phi i64 [ 0, %.preheader.lr.ph ], [ %39, %._crit_edge.us ]
  br label %30

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

._crit_edge.us:                                   ; preds = %30
  %39 = add nuw nsw i64 %.061.us, 1
  %exitcond63.not = icmp eq i64 %39, %1
  br i1 %exitcond63.not, label %._crit_edge62, label %.preheader.us, !llvm.loop !24

._crit_edge62:                                    ; preds = %._crit_edge.us, %28
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, i8 0, i64 16, i1 false)
  br label %42

40:                                               ; preds = %24
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %9, i64 noundef %1, ptr noundef %6)
  store i64 1, ptr %10, align 8, !tbaa !25
  call void @_ZN11alglib_implL26matinv_cmatrixtrinverserecEPNS_9ae_matrixEllbbPNS_9ae_vectorEPNS_8sintegerEPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef 0, i64 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef %6)
  %41 = load i64, ptr %10, align 8, !tbaa !25
  br label %42

42:                                               ; preds = %40, %._crit_edge62
  %.sink = phi i64 [ %41, %40 ], [ -3, %._crit_edge62 ]
  store i64 %.sink, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #4
  ret void
}

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_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #2

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

; 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 void @_ZN11alglib_impl14_sinteger_initEPvPNS_8ae_stateEb(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN11alglib_impl23apservisfinitectrmatrixEPNS_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_8sintegerEPNS_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, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTSN11alglib_impl9ae_matrixE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !12, i64 40, !7, i64 72}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!10, !6, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"_ZTSN11alglib_impl12matinvreportE", !17, i64 0, !17, i64 8}
!17 = !{!"double", !7, i64 0}
!18 = !{!16, !17, i64 8}
!19 = !{!7, !7, i64 0}
!20 = !{!13, !13, i64 0}
!21 = !{!17, !17, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = !{!26, !6, i64 0}
!26 = !{!"_ZTSN11alglib_impl8sintegerE", !6, i64 0}


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