; 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.479 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.480 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.481 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.482 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.483 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.484 = external hidden unnamed_addr constant [42 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_impl15cmatrixlurcond1EPKNS_9ae_matrixElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16cmatrixluinverseEPNS_9ae_matrixEPKNS_9ae_vectorElPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) #4 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, 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 i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca %"struct.alglib_impl::ae_complex", align 8
  %17 = alloca %"struct.alglib_impl::ae_complex", align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, 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 16, ptr %16) #5
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %19, ptr noundef %11)
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 64, i1 false)
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %20)
  %21 = 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 4, ptr noundef %21, i1 noundef zeroext true)
  %22 = load i64, ptr %8, align 8, !tbaa !9
  %23 = icmp sgt i64 %22, 0
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %23, ptr noundef @.str.479, ptr noundef %24)
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %25, i32 0, i32 1
  %27 = load i64, ptr %26, align 8, !tbaa !11
  %28 = load i64, ptr %8, align 8, !tbaa !9
  %29 = icmp sge i64 %27, %28
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %29, ptr noundef @.str.480, ptr noundef %30)
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %31, i32 0, i32 0
  %33 = load i64, ptr %32, align 8, !tbaa !15
  %34 = load i64, ptr %8, align 8, !tbaa !9
  %35 = icmp sge i64 %33, %34
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %35, ptr noundef @.str.481, ptr noundef %36)
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %37, i32 0, i32 0
  %39 = load i64, ptr %38, align 8, !tbaa !16
  %40 = load i64, ptr %8, align 8, !tbaa !9
  %41 = icmp sge i64 %39, %40
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %41, ptr noundef @.str.482, ptr noundef %42)
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load i64, ptr %8, align 8, !tbaa !9
  %45 = load i64, ptr %8, align 8, !tbaa !9
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = call noundef zeroext i1 @_ZN11alglib_impl21apservisfinitecmatrixEPKNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %43, i64 noundef %44, i64 noundef %45, ptr noundef %46)
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %47, ptr noundef @.str.483, ptr noundef %48)
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %49

49:                                               ; preds = %75, %5
  %50 = load i64, ptr %13, align 8, !tbaa !9
  %51 = load i64, ptr %8, align 8, !tbaa !9
  %52 = sub nsw i64 %51, 1
  %53 = icmp sle i64 %50, %52
  br i1 %53, label %54, label %78

54:                                               ; preds = %49
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %55, i32 0, i32 4
  %57 = load ptr, ptr %56, align 8, !tbaa !18
  %58 = load i64, ptr %13, align 8, !tbaa !9
  %59 = getelementptr inbounds i64, ptr %57, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !9
  %61 = load i64, ptr %8, align 8, !tbaa !9
  %62 = sub nsw i64 %61, 1
  %63 = icmp sgt i64 %60, %62
  br i1 %63, label %72, label %64

64:                                               ; preds = %54
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %65, i32 0, i32 4
  %67 = load ptr, ptr %66, align 8, !tbaa !18
  %68 = load i64, ptr %13, align 8, !tbaa !9
  %69 = getelementptr inbounds i64, ptr %67, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !9
  %71 = icmp slt i64 %70, 0
  br i1 %71, label %72, label %74

72:                                               ; preds = %64, %54
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef @.str.484, ptr noundef %73)
  br label %74

74:                                               ; preds = %72, %64
  br label %75

75:                                               ; preds = %74
  %76 = load i64, ptr %13, align 8, !tbaa !9
  %77 = add nsw i64 %76, 1
  store i64 %77, ptr %13, align 8, !tbaa !9
  br label %49, !llvm.loop !19

78:                                               ; preds = %49
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %79, i32 0, i32 0
  store i64 1, ptr %80, align 8, !tbaa !21
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = load i64, ptr %8, align 8, !tbaa !9
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = call noundef double @_ZN11alglib_impl15cmatrixlurcond1EPKNS_9ae_matrixElPNS_8ae_stateE(ptr noundef %81, i64 noundef %82, ptr noundef %83)
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %85, i32 0, i32 1
  store double %84, ptr %86, align 8, !tbaa !24
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = load i64, ptr %8, align 8, !tbaa !9
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = call noundef double @_ZN11alglib_impl17cmatrixlurcondinfEPKNS_9ae_matrixElPNS_8ae_stateE(ptr noundef %87, i64 noundef %88, ptr noundef %89)
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %91, i32 0, i32 2
  store double %90, ptr %92, align 8, !tbaa !25
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %93, i32 0, i32 1
  %95 = load double, ptr %94, align 8, !tbaa !24
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %96)
  %98 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %95, double noundef %97)
  br i1 %98, label %106, label %99

99:                                               ; preds = %78
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %100, i32 0, i32 2
  %102 = load double, ptr %101, align 8, !tbaa !25
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %103)
  %105 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %102, double noundef %104)
  br i1 %105, label %106, label %147

106:                                              ; preds = %99, %78
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %107

107:                                              ; preds = %136, %106
  %108 = load i64, ptr %13, align 8, !tbaa !9
  %109 = load i64, ptr %8, align 8, !tbaa !9
  %110 = sub nsw i64 %109, 1
  %111 = icmp sle i64 %108, %110
  br i1 %111, label %112, label %139

112:                                              ; preds = %107
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %113

113:                                              ; preds = %132, %112
  %114 = load i64, ptr %14, align 8, !tbaa !9
  %115 = load i64, ptr %8, align 8, !tbaa !9
  %116 = sub nsw i64 %115, 1
  %117 = icmp sle i64 %114, %116
  br i1 %117, label %118, label %135

118:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #5
  %119 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %120 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %121 = extractvalue { double, double } %119, 0
  store double %121, ptr %120, align 8
  %122 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %123 = extractvalue { double, double } %119, 1
  store double %123, ptr %122, align 8
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %124, i32 0, i32 6
  %126 = load ptr, ptr %125, align 8, !tbaa !18
  %127 = load i64, ptr %13, align 8, !tbaa !9
  %128 = getelementptr inbounds ptr, ptr %126, i64 %127
  %129 = load ptr, ptr %128, align 8, !tbaa !5
  %130 = load i64, ptr %14, align 8, !tbaa !9
  %131 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %129, i64 %130
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %131, ptr align 8 %17, i64 16, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  br label %132

132:                                              ; preds = %118
  %133 = load i64, ptr %14, align 8, !tbaa !9
  %134 = add nsw i64 %133, 1
  store i64 %134, ptr %14, align 8, !tbaa !9
  br label %113, !llvm.loop !28

135:                                              ; preds = %113
  br label %136

136:                                              ; preds = %135
  %137 = load i64, ptr %13, align 8, !tbaa !9
  %138 = add nsw i64 %137, 1
  store i64 %138, ptr %13, align 8, !tbaa !9
  br label %107, !llvm.loop !29

139:                                              ; preds = %107
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %140, i32 0, i32 1
  store double 0.000000e+00, ptr %141, align 8, !tbaa !24
  %142 = load ptr, ptr %9, align 8, !tbaa !5
  %143 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %142, i32 0, i32 2
  store double 0.000000e+00, ptr %143, align 8, !tbaa !25
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %144, i32 0, i32 0
  store i64 -3, ptr %145, align 8, !tbaa !21
  %146 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %146)
  store i32 1, ptr %18, align 4
  br label %213

147:                                              ; preds = %99
  %148 = load i64, ptr %8, align 8, !tbaa !9
  %149 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %12, i64 noundef %148, ptr noundef %149)
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = load i64, ptr %8, align 8, !tbaa !9
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_implL26matinv_cmatrixluinverserecEPNS_9ae_matrixEllPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %150, i64 noundef 0, i64 noundef %151, ptr noundef %12, ptr noundef %152, ptr noundef %153)
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %154

154:                                              ; preds = %208, %147
  %155 = load i64, ptr %13, align 8, !tbaa !9
  %156 = load i64, ptr %8, align 8, !tbaa !9
  %157 = sub nsw i64 %156, 1
  %158 = icmp sle i64 %155, %157
  br i1 %158, label %159, label %211

159:                                              ; preds = %154
  %160 = load i64, ptr %8, align 8, !tbaa !9
  %161 = sub nsw i64 %160, 2
  store i64 %161, ptr %14, align 8, !tbaa !9
  br label %162

162:                                              ; preds = %204, %159
  %163 = load i64, ptr %14, align 8, !tbaa !9
  %164 = icmp sge i64 %163, 0
  br i1 %164, label %165, label %207

165:                                              ; preds = %162
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %166, i32 0, i32 4
  %168 = load ptr, ptr %167, align 8, !tbaa !18
  %169 = load i64, ptr %14, align 8, !tbaa !9
  %170 = getelementptr inbounds i64, ptr %168, i64 %169
  %171 = load i64, ptr %170, align 8, !tbaa !9
  store i64 %171, ptr %15, align 8, !tbaa !9
  %172 = load ptr, ptr %6, align 8, !tbaa !5
  %173 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %172, i32 0, i32 6
  %174 = load ptr, ptr %173, align 8, !tbaa !18
  %175 = load i64, ptr %13, align 8, !tbaa !9
  %176 = getelementptr inbounds ptr, ptr %174, i64 %175
  %177 = load ptr, ptr %176, align 8, !tbaa !5
  %178 = load i64, ptr %14, align 8, !tbaa !9
  %179 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %177, i64 %178
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %179, i64 16, i1 false), !tbaa.struct !26
  %180 = load ptr, ptr %6, align 8, !tbaa !5
  %181 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %180, i32 0, i32 6
  %182 = load ptr, ptr %181, align 8, !tbaa !18
  %183 = load i64, ptr %13, align 8, !tbaa !9
  %184 = getelementptr inbounds ptr, ptr %182, i64 %183
  %185 = load ptr, ptr %184, align 8, !tbaa !5
  %186 = load i64, ptr %15, align 8, !tbaa !9
  %187 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %185, i64 %186
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  %189 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %188, i32 0, i32 6
  %190 = load ptr, ptr %189, align 8, !tbaa !18
  %191 = load i64, ptr %13, align 8, !tbaa !9
  %192 = getelementptr inbounds ptr, ptr %190, i64 %191
  %193 = load ptr, ptr %192, align 8, !tbaa !5
  %194 = load i64, ptr %14, align 8, !tbaa !9
  %195 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %193, i64 %194
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %195, ptr align 8 %187, i64 16, i1 false), !tbaa.struct !26
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %196, i32 0, i32 6
  %198 = load ptr, ptr %197, align 8, !tbaa !18
  %199 = load i64, ptr %13, align 8, !tbaa !9
  %200 = getelementptr inbounds ptr, ptr %198, i64 %199
  %201 = load ptr, ptr %200, align 8, !tbaa !5
  %202 = load i64, ptr %15, align 8, !tbaa !9
  %203 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %201, i64 %202
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %203, ptr align 8 %16, i64 16, i1 false), !tbaa.struct !26
  br label %204

204:                                              ; preds = %165
  %205 = load i64, ptr %14, align 8, !tbaa !9
  %206 = add nsw i64 %205, -1
  store i64 %206, ptr %14, align 8, !tbaa !9
  br label %162, !llvm.loop !30

207:                                              ; preds = %162
  br label %208

208:                                              ; preds = %207
  %209 = load i64, ptr %13, align 8, !tbaa !9
  %210 = add nsw i64 %209, 1
  store i64 %210, ptr %13, align 8, !tbaa !9
  br label %154, !llvm.loop !31

211:                                              ; preds = %154
  %212 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %212)
  store i32 0, ptr %18, align 4
  br label %213

213:                                              ; preds = %211, %139
  call void @llvm.lifetime.end.p0(i64 16, 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 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  %214 = load i32, ptr %18, align 4
  switch i32 %214, label %216 [
    i32 0, label %215
    i32 1, label %215
  ]

215:                                              ; preds = %213, %213
  ret void

216:                                              ; preds = %213
  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_impl21apservisfinitecmatrixEPKNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL26matinv_cmatrixluinverserecEPNS_9ae_matrixEllPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, 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, !10, i64 8}
!12 = !{!"_ZTSN11alglib_impl9ae_matrixE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !13, i64 32, !14, i64 40, !7, i64 72}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!12, !10, i64 0}
!16 = !{!17, !10, i64 0}
!17 = !{!"_ZTSN11alglib_impl9ae_vectorE", !10, i64 0, !10, i64 8, !13, i64 16, !14, i64 24, !7, i64 56}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !10, i64 0}
!22 = !{!"_ZTSN11alglib_impl12matinvreportE", !10, i64 0, !23, i64 8, !23, i64 16}
!23 = !{!"double", !7, i64 0}
!24 = !{!22, !23, i64 8}
!25 = !{!22, !23, i64 16}
!26 = !{i64 0, i64 8, !27, i64 8, i64 8, !27}
!27 = !{!23, !23, i64 0}
!28 = distinct !{!28, !20}
!29 = distinct !{!29, !20}
!30 = distinct !{!30, !20}
!31 = distinct !{!31, !20}


; 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.479 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.480 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.481 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.482 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.483 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.484 = external hidden unnamed_addr constant [42 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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress 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) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16cmatrixluinverseEPNS_9ae_matrixEPKNS_9ae_vectorElPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, ptr nocapture noundef readonly %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #4 {
  %6 = alloca %"struct.alglib_impl::ae_frame", align 8
  %7 = alloca %"struct.alglib_impl::ae_vector", align 8
  %8 = alloca %"struct.alglib_impl::ae_complex", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8)
  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 @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %3)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %7, i64 noundef 0, i64 noundef 4, ptr noundef %4, i1 noundef zeroext true)
  %9 = icmp sgt i64 %2, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef nonnull @.str.479, ptr noundef %4)
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load i64, ptr %10, align 8, !tbaa !5
  %12 = icmp sge i64 %11, %2
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %12, ptr noundef nonnull @.str.480, ptr noundef %4)
  %13 = load i64, ptr %0, align 8, !tbaa !13
  %14 = icmp sge i64 %13, %2
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.481, ptr noundef %4)
  %15 = load i64, ptr %1, align 8, !tbaa !14
  %16 = icmp sge i64 %15, %2
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %16, ptr noundef nonnull @.str.482, ptr noundef %4)
  %17 = call noundef zeroext i1 @_ZN11alglib_impl21apservisfinitecmatrixEPKNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %2, i64 noundef %2, ptr noundef %4)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %17, ptr noundef nonnull @.str.483, ptr noundef %4)
  br i1 %9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %5
  %18 = getelementptr inbounds i8, ptr %1, i64 56
  br label %19

19:                                               ; preds = %.lr.ph, %24
  %.089 = phi i64 [ 0, %.lr.ph ], [ %25, %24 ]
  %20 = load ptr, ptr %18, align 8, !tbaa !16
  %21 = getelementptr inbounds i64, ptr %20, i64 %.089
  %22 = load i64, ptr %21, align 8, !tbaa !17
  %or.cond.not = icmp ult i64 %22, %2
  br i1 %or.cond.not, label %24, label %23

23:                                               ; preds = %19
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef nonnull @.str.484, ptr noundef %4)
  br label %24

24:                                               ; preds = %19, %23
  %25 = add nuw nsw i64 %.089, 1
  %exitcond.not = icmp eq i64 %25, %2
  br i1 %exitcond.not, label %._crit_edge, label %19, !llvm.loop !18

._crit_edge:                                      ; preds = %24, %5
  store i64 1, ptr %3, align 8, !tbaa !20
  %26 = call noundef double @_ZN11alglib_impl15cmatrixlurcond1EPKNS_9ae_matrixElPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %2, ptr noundef %4)
  %27 = getelementptr inbounds i8, ptr %3, i64 8
  store double %26, ptr %27, align 8, !tbaa !23
  %28 = call noundef double @_ZN11alglib_impl17cmatrixlurcondinfEPKNS_9ae_matrixElPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %2, ptr noundef %4)
  %29 = getelementptr inbounds i8, ptr %3, i64 16
  store double %28, ptr %29, align 8, !tbaa !24
  %30 = load double, ptr %27, align 8, !tbaa !23
  %31 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %4)
  %32 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %30, double noundef %31)
  br i1 %32, label %37, label %33

33:                                               ; preds = %._crit_edge
  %34 = load double, ptr %29, align 8, !tbaa !24
  %35 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %4)
  %36 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %34, double noundef %35)
  br i1 %36, label %37, label %49

37:                                               ; preds = %33, %._crit_edge
  br i1 %9, label %.preheader.lr.ph, label %._crit_edge105

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

.preheader.us:                                    ; preds = %._crit_edge102.us, %.preheader.lr.ph
  %.1104.us = phi i64 [ 0, %.preheader.lr.ph ], [ %48, %._crit_edge102.us ]
  br label %39

39:                                               ; preds = %.preheader.us, %39
  %.080100.us = phi i64 [ 0, %.preheader.us ], [ %47, %39 ]
  %40 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %41 = extractvalue { double, double } %40, 0
  %42 = extractvalue { double, double } %40, 1
  %43 = load ptr, ptr %38, align 8, !tbaa !16
  %44 = getelementptr inbounds ptr, ptr %43, i64 %.1104.us
  %45 = load ptr, ptr %44, align 8, !tbaa !25
  %46 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %45, i64 %.080100.us
  store double %41, ptr %46, align 8, !tbaa !26
  %.sroa.4.0..sroa_idx.us = getelementptr inbounds i8, ptr %46, i64 8
  store double %42, ptr %.sroa.4.0..sroa_idx.us, align 8, !tbaa !26
  %47 = add nuw nsw i64 %.080100.us, 1
  %exitcond108.not = icmp eq i64 %47, %2
  br i1 %exitcond108.not, label %._crit_edge102.us, label %39, !llvm.loop !27

._crit_edge102.us:                                ; preds = %39
  %48 = add nuw nsw i64 %.1104.us, 1
  %exitcond109.not = icmp eq i64 %48, %2
  br i1 %exitcond109.not, label %._crit_edge105, label %.preheader.us, !llvm.loop !28

._crit_edge105:                                   ; preds = %._crit_edge102.us, %37
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %27, i8 0, i64 16, i1 false)
  store i64 -3, ptr %3, align 8, !tbaa !20
  br label %._crit_edge98

49:                                               ; preds = %33
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %7, i64 noundef %2, ptr noundef %4)
  call void @_ZN11alglib_implL26matinv_cmatrixluinverserecEPNS_9ae_matrixEllPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef 0, i64 noundef %2, ptr noundef nonnull %7, ptr noundef nonnull %3, ptr noundef %4)
  br i1 %9, label %.lr.ph97, label %._crit_edge98

.lr.ph97:                                         ; preds = %49
  %50 = add nsw i64 %2, -2
  %.not = icmp eq i64 %2, 1
  %51 = getelementptr inbounds i8, ptr %1, i64 56
  %52 = getelementptr inbounds i8, ptr %0, i64 72
  br i1 %.not, label %._crit_edge98, label %.lr.ph92.us

.lr.ph92.us:                                      ; preds = %.lr.ph97, %._crit_edge93.us
  %.295.us = phi i64 [ %68, %._crit_edge93.us ], [ 0, %.lr.ph97 ]
  br label %53

53:                                               ; preds = %.lr.ph92.us, %53
  %.18190.us = phi i64 [ %50, %.lr.ph92.us ], [ %66, %53 ]
  %54 = load ptr, ptr %51, align 8, !tbaa !16
  %55 = getelementptr inbounds i64, ptr %54, i64 %.18190.us
  %56 = load i64, ptr %55, align 8, !tbaa !17
  %57 = load ptr, ptr %52, align 8, !tbaa !16
  %58 = getelementptr inbounds ptr, ptr %57, i64 %.295.us
  %59 = load ptr, ptr %58, align 8, !tbaa !25
  %60 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %59, i64 %.18190.us
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %60, i64 16, i1 false), !tbaa.struct !29
  %61 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %59, i64 %56
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef nonnull align 8 dereferenceable(16) %61, i64 16, i1 false), !tbaa.struct !29
  %62 = load ptr, ptr %52, align 8, !tbaa !16
  %63 = getelementptr inbounds ptr, ptr %62, i64 %.295.us
  %64 = load ptr, ptr %63, align 8, !tbaa !25
  %65 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %64, i64 %56
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %65, ptr noundef nonnull align 8 dereferenceable(16) %8, i64 16, i1 false), !tbaa.struct !29
  %66 = add nsw i64 %.18190.us, -1
  %67 = icmp sgt i64 %.18190.us, 0
  br i1 %67, label %53, label %._crit_edge93.us, !llvm.loop !30

._crit_edge93.us:                                 ; preds = %53
  %68 = add nuw nsw i64 %.295.us, 1
  %exitcond107.not = icmp eq i64 %68, %2
  br i1 %exitcond107.not, label %._crit_edge98, label %.lr.ph92.us, !llvm.loop !31

._crit_edge98:                                    ; preds = %._crit_edge93.us, %49, %.lr.ph97, %._crit_edge105
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  ret void
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL26matinv_cmatrixluinverserecEPNS_9ae_matrixEllPNS_9ae_vectorEPNS_12matinvreportEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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, !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_impl9ae_vectorE", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !8, i64 56}
!16 = !{!8, !8, i64 0}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!21, !7, i64 0}
!21 = !{!"_ZTSN11alglib_impl12matinvreportE", !7, i64 0, !22, i64 8, !22, i64 16}
!22 = !{!"double", !8, i64 0}
!23 = !{!21, !22, i64 8}
!24 = !{!21, !22, i64 16}
!25 = !{!12, !12, i64 0}
!26 = !{!22, !22, i64 0}
!27 = distinct !{!27, !19}
!28 = distinct !{!28, !19}
!29 = !{i64 0, i64 8, !26, i64 8, i64 8, !26}
!30 = distinct !{!30, !19}
!31 = distinct !{!31, !19}


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