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

@.str.306 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.307 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.308 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.309 = external hidden unnamed_addr constant [61 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_impl22hpdmatrixcholeskyrcondEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl18_matinvreport_initEPvPNS_8ae_stateEb(ptr noundef, ptr noundef, i1 noundef zeroext) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl24hpdmatrixcholeskyinverseEPNS_9ae_matrixElbPlPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %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 ptr, align 8
  %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::matinvreport", align 8
  %17 = alloca %"struct.alglib_impl::ae_vector", align 8
  %18 = alloca i8, align 1
  %19 = alloca %"struct.alglib_impl::ae_complex", align 8
  %20 = alloca %"struct.alglib_impl::ae_complex", align 8
  %21 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  %22 = zext i1 %2 to i8
  store i8 %22, ptr %9, align 1, !tbaa !11
  store ptr %3, ptr %10, align 8, !tbaa !5
  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 16, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #5
  %23 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %23, ptr noundef %13)
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 64, i1 false)
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 0, ptr %24, align 8, !tbaa !9
  %25 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %25)
  %26 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl18_matinvreport_initEPvPNS_8ae_stateEb(ptr noundef %16, ptr noundef %26, i1 noundef zeroext true)
  %27 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %17, i64 noundef 0, i64 noundef 4, ptr noundef %27, i1 noundef zeroext true)
  %28 = load i64, ptr %8, align 8, !tbaa !9
  %29 = icmp sgt i64 %28, 0
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %29, ptr noundef @.str.306, ptr noundef %30)
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %31, i32 0, i32 1
  %33 = load i64, ptr %32, align 8, !tbaa !13
  %34 = load i64, ptr %8, align 8, !tbaa !9
  %35 = icmp sge i64 %33, %34
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %35, ptr noundef @.str.307, ptr noundef %36)
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", 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 %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %41, ptr noundef @.str.308, ptr noundef %42)
  store i8 1, ptr %18, align 1, !tbaa !11
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %43

43:                                               ; preds = %80, %6
  %44 = load i64, ptr %14, align 8, !tbaa !9
  %45 = load i64, ptr %8, align 8, !tbaa !9
  %46 = sub nsw i64 %45, 1
  %47 = icmp sle i64 %44, %46
  br i1 %47, label %48, label %83

48:                                               ; preds = %43
  %49 = load i8, ptr %18, align 1, !tbaa !11, !range !17, !noundef !18
  %50 = trunc i8 %49 to i1
  br i1 %50, label %51, label %77

51:                                               ; preds = %48
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %52, i32 0, i32 6
  %54 = load ptr, ptr %53, align 8, !tbaa !19
  %55 = load i64, ptr %14, align 8, !tbaa !9
  %56 = getelementptr inbounds ptr, ptr %54, i64 %55
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  %58 = load i64, ptr %14, align 8, !tbaa !9
  %59 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %57, i64 %58
  %60 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %59, i32 0, i32 0
  %61 = load double, ptr %60, align 8, !tbaa !20
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %61, ptr noundef %62)
  br i1 %63, label %64, label %77

64:                                               ; preds = %51
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %65, i32 0, i32 6
  %67 = load ptr, ptr %66, align 8, !tbaa !19
  %68 = load i64, ptr %14, align 8, !tbaa !9
  %69 = getelementptr inbounds ptr, ptr %67, i64 %68
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  %71 = load i64, ptr %14, align 8, !tbaa !9
  %72 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %70, i64 %71
  %73 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %72, i32 0, i32 1
  %74 = load double, ptr %73, align 8, !tbaa !23
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %74, ptr noundef %75)
  br label %77

77:                                               ; preds = %64, %51, %48
  %78 = phi i1 [ false, %51 ], [ false, %48 ], [ %76, %64 ]
  %79 = zext i1 %78 to i8
  store i8 %79, ptr %18, align 1, !tbaa !11
  br label %80

80:                                               ; preds = %77
  %81 = load i64, ptr %14, align 8, !tbaa !9
  %82 = add nsw i64 %81, 1
  store i64 %82, ptr %14, align 8, !tbaa !9
  br label %43, !llvm.loop !24

83:                                               ; preds = %43
  %84 = load i8, ptr %18, align 1, !tbaa !11, !range !17, !noundef !18
  %85 = trunc i8 %84 to i1
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %85, ptr noundef @.str.309, ptr noundef %86)
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 1, ptr %87, align 8, !tbaa !9
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = load i64, ptr %8, align 8, !tbaa !9
  %90 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %91 = trunc i8 %90 to i1
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = call noundef double @_ZN11alglib_impl22hpdmatrixcholeskyrcondEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef %88, i64 noundef %89, i1 noundef zeroext %91, ptr noundef %92)
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %94, i32 0, i32 0
  store double %93, ptr %95, align 8, !tbaa !26
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %96, i32 0, i32 0
  %98 = load double, ptr %97, align 8, !tbaa !26
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %99, i32 0, i32 1
  store double %98, ptr %100, align 8, !tbaa !28
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %101, i32 0, i32 0
  %103 = load double, ptr %102, align 8, !tbaa !26
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  %105 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %104)
  %106 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %103, double noundef %105)
  br i1 %106, label %114, label %107

107:                                              ; preds = %83
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  %109 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %108, i32 0, i32 1
  %110 = load double, ptr %109, align 8, !tbaa !28
  %111 = load ptr, ptr %12, align 8, !tbaa !5
  %112 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %111)
  %113 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %110, double noundef %112)
  br i1 %113, label %114, label %192

114:                                              ; preds = %107, %83
  %115 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %116 = trunc i8 %115 to i1
  br i1 %116, label %117, label %152

117:                                              ; preds = %114
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %118

118:                                              ; preds = %148, %117
  %119 = load i64, ptr %14, align 8, !tbaa !9
  %120 = load i64, ptr %8, align 8, !tbaa !9
  %121 = sub nsw i64 %120, 1
  %122 = icmp sle i64 %119, %121
  br i1 %122, label %123, label %151

123:                                              ; preds = %118
  %124 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %124, ptr %15, align 8, !tbaa !9
  br label %125

125:                                              ; preds = %144, %123
  %126 = load i64, ptr %15, align 8, !tbaa !9
  %127 = load i64, ptr %8, align 8, !tbaa !9
  %128 = sub nsw i64 %127, 1
  %129 = icmp sle i64 %126, %128
  br i1 %129, label %130, label %147

130:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  %131 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %132 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %133 = extractvalue { double, double } %131, 0
  store double %133, ptr %132, align 8
  %134 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %135 = extractvalue { double, double } %131, 1
  store double %135, ptr %134, align 8
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %136, i32 0, i32 6
  %138 = load ptr, ptr %137, align 8, !tbaa !19
  %139 = load i64, ptr %14, align 8, !tbaa !9
  %140 = getelementptr inbounds ptr, ptr %138, i64 %139
  %141 = load ptr, ptr %140, align 8, !tbaa !5
  %142 = load i64, ptr %15, align 8, !tbaa !9
  %143 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %141, i64 %142
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %143, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  br label %144

144:                                              ; preds = %130
  %145 = load i64, ptr %15, align 8, !tbaa !9
  %146 = add nsw i64 %145, 1
  store i64 %146, ptr %15, align 8, !tbaa !9
  br label %125, !llvm.loop !31

147:                                              ; preds = %125
  br label %148

148:                                              ; preds = %147
  %149 = load i64, ptr %14, align 8, !tbaa !9
  %150 = add nsw i64 %149, 1
  store i64 %150, ptr %14, align 8, !tbaa !9
  br label %118, !llvm.loop !32

151:                                              ; preds = %118
  br label %185

152:                                              ; preds = %114
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %153

153:                                              ; preds = %181, %152
  %154 = load i64, ptr %14, align 8, !tbaa !9
  %155 = load i64, ptr %8, align 8, !tbaa !9
  %156 = sub nsw i64 %155, 1
  %157 = icmp sle i64 %154, %156
  br i1 %157, label %158, label %184

158:                                              ; preds = %153
  store i64 0, ptr %15, align 8, !tbaa !9
  br label %159

159:                                              ; preds = %177, %158
  %160 = load i64, ptr %15, align 8, !tbaa !9
  %161 = load i64, ptr %14, align 8, !tbaa !9
  %162 = icmp sle i64 %160, %161
  br i1 %162, label %163, label %180

163:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #5
  %164 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %165 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %166 = extractvalue { double, double } %164, 0
  store double %166, ptr %165, align 8
  %167 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %168 = extractvalue { double, double } %164, 1
  store double %168, ptr %167, align 8
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %169, i32 0, i32 6
  %171 = load ptr, ptr %170, align 8, !tbaa !19
  %172 = load i64, ptr %14, align 8, !tbaa !9
  %173 = getelementptr inbounds ptr, ptr %171, i64 %172
  %174 = load ptr, ptr %173, align 8, !tbaa !5
  %175 = load i64, ptr %15, align 8, !tbaa !9
  %176 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %174, i64 %175
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %176, ptr align 8 %20, i64 16, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #5
  br label %177

177:                                              ; preds = %163
  %178 = load i64, ptr %15, align 8, !tbaa !9
  %179 = add nsw i64 %178, 1
  store i64 %179, ptr %15, align 8, !tbaa !9
  br label %159, !llvm.loop !33

180:                                              ; preds = %159
  br label %181

181:                                              ; preds = %180
  %182 = load i64, ptr %14, align 8, !tbaa !9
  %183 = add nsw i64 %182, 1
  store i64 %183, ptr %14, align 8, !tbaa !9
  br label %153, !llvm.loop !34

184:                                              ; preds = %153
  br label %185

185:                                              ; preds = %184, %151
  %186 = load ptr, ptr %11, align 8, !tbaa !5
  %187 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %186, i32 0, i32 0
  store double 0.000000e+00, ptr %187, align 8, !tbaa !26
  %188 = load ptr, ptr %11, align 8, !tbaa !5
  %189 = getelementptr inbounds %"struct.alglib_impl::matinvreport", ptr %188, i32 0, i32 1
  store double 0.000000e+00, ptr %189, align 8, !tbaa !28
  %190 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 -3, ptr %190, align 8, !tbaa !9
  %191 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %191)
  store i32 1, ptr %21, align 4
  br label %201

192:                                              ; preds = %107
  %193 = load i64, ptr %8, align 8, !tbaa !9
  %194 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %17, i64 noundef %193, ptr noundef %194)
  %195 = load ptr, ptr %7, align 8, !tbaa !5
  %196 = load i64, ptr %8, align 8, !tbaa !9
  %197 = load i8, ptr %9, align 1, !tbaa !11, !range !17, !noundef !18
  %198 = trunc i8 %197 to i1
  %199 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_implL34matinv_hpdmatrixcholeskyinverserecEPNS_9ae_matrixEllbPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %195, i64 noundef 0, i64 noundef %196, i1 noundef zeroext %198, ptr noundef %17, ptr noundef %199)
  %200 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %200)
  store i32 0, ptr %21, align 4
  br label %201

201:                                              ; preds = %192, %185
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %17) #5
  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 32, ptr %13) #5
  %202 = load i32, ptr %21, align 4
  switch i32 %202, label %204 [
    i32 0, label %203
    i32 1, label %203
  ]

203:                                              ; preds = %201, %201
  ret void

204:                                              ; preds = %201
  unreachable
}

declare noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef, ptr noundef) #2

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL34matinv_hpdmatrixcholeskyinverserecEPNS_9ae_matrixEllbPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, i1 noundef zeroext, 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 = !{!7, !7, i64 0}
!20 = !{!21, !22, i64 0}
!21 = !{!"_ZTSN11alglib_impl10ae_complexE", !22, i64 0, !22, i64 8}
!22 = !{!"double", !7, i64 0}
!23 = !{!21, !22, i64 8}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !22, i64 0}
!27 = !{!"_ZTSN11alglib_impl12matinvreportE", !22, i64 0, !22, i64 8}
!28 = !{!27, !22, i64 8}
!29 = !{i64 0, i64 8, !30, i64 8, i64 8, !30}
!30 = !{!22, !22, i64 0}
!31 = distinct !{!31, !25}
!32 = distinct !{!32, !25}
!33 = distinct !{!33, !25}
!34 = distinct !{!34, !25}


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

@.str.306 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.307 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.308 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.309 = external hidden unnamed_addr constant [61 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_impl22hpdmatrixcholeskyrcondEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl18_matinvreport_initEPvPNS_8ae_stateEb(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl24hpdmatrixcholeskyinverseEPNS_9ae_matrixElbPlPNS_12matinvreportEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, ptr nocapture noundef writeonly %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::matinvreport", align 8
  %9 = 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 16, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #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(16) %8, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %9, i8 0, i64 64, i1 false)
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @_ZN11alglib_impl19_matinvreport_clearEPv(ptr noundef %4)
  call void @_ZN11alglib_impl18_matinvreport_initEPvPNS_8ae_stateEb(ptr noundef nonnull %8, ptr noundef %5, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %9, i64 noundef 0, i64 noundef 4, ptr noundef %5, i1 noundef zeroext true)
  %10 = icmp sgt i64 %1, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %10, ptr noundef nonnull @.str.306, ptr noundef %5)
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load i64, ptr %11, align 8, !tbaa !9
  %13 = icmp sge i64 %12, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %13, ptr noundef nonnull @.str.307, ptr noundef %5)
  %14 = load i64, ptr %0, align 8, !tbaa !14
  %15 = icmp sge i64 %14, %1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %15, ptr noundef nonnull @.str.308, ptr noundef %5)
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6
  %16 = getelementptr inbounds i8, ptr %0, i64 72
  br label %17

17:                                               ; preds = %.lr.ph, %32
  %.084 = phi i64 [ 0, %.lr.ph ], [ %34, %32 ]
  %.07383 = phi i1 [ true, %.lr.ph ], [ %33, %32 ]
  br i1 %.07383, label %18, label %32

18:                                               ; preds = %17
  %19 = load ptr, ptr %16, align 8, !tbaa !15
  %20 = getelementptr inbounds ptr, ptr %19, i64 %.084
  %21 = load ptr, ptr %20, align 8, !tbaa !16
  %22 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %21, i64 %.084
  %23 = load double, ptr %22, align 8, !tbaa !17
  %24 = call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %23, ptr noundef %5)
  br i1 %24, label %25, label %32

25:                                               ; preds = %18
  %26 = load ptr, ptr %16, align 8, !tbaa !15
  %27 = getelementptr inbounds ptr, ptr %26, i64 %.084
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  %29 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %28, i64 %.084, i32 1
  %30 = load double, ptr %29, align 8, !tbaa !20
  %31 = call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %30, ptr noundef %5)
  br label %32

32:                                               ; preds = %25, %18, %17
  %33 = phi i1 [ false, %18 ], [ false, %17 ], [ %31, %25 ]
  %34 = add nuw nsw i64 %.084, 1
  %exitcond.not = icmp eq i64 %34, %1
  br i1 %exitcond.not, label %._crit_edge, label %17, !llvm.loop !21

._crit_edge:                                      ; preds = %32, %6
  %.073.lcssa = phi i1 [ true, %6 ], [ %33, %32 ]
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %.073.lcssa, ptr noundef nonnull @.str.309, ptr noundef %5)
  store i64 1, ptr %3, align 8, !tbaa !5
  %35 = call noundef double @_ZN11alglib_impl22hpdmatrixcholeskyrcondEPNS_9ae_matrixElbPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %5)
  store double %35, ptr %4, align 8, !tbaa !23
  %36 = getelementptr inbounds i8, ptr %4, i64 8
  store double %35, ptr %36, align 8, !tbaa !25
  %37 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %5)
  %38 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %35, double noundef %37)
  br i1 %38, label %43, label %39

39:                                               ; preds = %._crit_edge
  %40 = load double, ptr %36, align 8, !tbaa !25
  %41 = call noundef double @_ZN11alglib_impl14rcondthresholdEPNS_8ae_stateE(ptr noundef %5)
  %42 = call noundef zeroext i1 @_ZN11alglib_impl10ae_fp_lessEdd(double noundef %40, double noundef %41)
  br i1 %42, label %43, label %68

43:                                               ; preds = %39, %._crit_edge
  br i1 %2, label %.preheader78, label %.preheader80

.preheader80:                                     ; preds = %43
  br i1 %10, label %.preheader79.lr.ph, label %.loopexit

.preheader79.lr.ph:                               ; preds = %.preheader80
  %44 = getelementptr inbounds i8, ptr %0, i64 72
  br label %.preheader79

.preheader78:                                     ; preds = %43
  br i1 %10, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %.preheader78
  %45 = getelementptr inbounds i8, ptr %0, i64 72
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %55
  %.190 = phi i64 [ 0, %.preheader.lr.ph ], [ %56, %55 ]
  br label %46

46:                                               ; preds = %.preheader, %46
  %.07188 = phi i64 [ %.190, %.preheader ], [ %54, %46 ]
  %47 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %48 = extractvalue { double, double } %47, 0
  %49 = extractvalue { double, double } %47, 1
  %50 = load ptr, ptr %45, align 8, !tbaa !15
  %51 = getelementptr inbounds ptr, ptr %50, i64 %.190
  %52 = load ptr, ptr %51, align 8, !tbaa !16
  %53 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %52, i64 %.07188
  store double %48, ptr %53, align 8, !tbaa !26
  %.sroa.42.0..sroa_idx = getelementptr inbounds i8, ptr %53, i64 8
  store double %49, ptr %.sroa.42.0..sroa_idx, align 8, !tbaa !26
  %54 = add nuw nsw i64 %.07188, 1
  %.not77.not = icmp slt i64 %54, %1
  br i1 %.not77.not, label %46, label %55, !llvm.loop !27

55:                                               ; preds = %46
  %56 = add nuw nsw i64 %.190, 1
  %exitcond95.not = icmp eq i64 %56, %1
  br i1 %exitcond95.not, label %.loopexit, label %.preheader, !llvm.loop !28

.preheader79:                                     ; preds = %.preheader79.lr.ph, %66
  %indvars.iv = phi i64 [ 1, %.preheader79.lr.ph ], [ %indvars.iv.next, %66 ]
  %.287 = phi i64 [ 0, %.preheader79.lr.ph ], [ %67, %66 ]
  br label %57

57:                                               ; preds = %.preheader79, %57
  %.17285 = phi i64 [ 0, %.preheader79 ], [ %65, %57 ]
  %58 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %59 = extractvalue { double, double } %58, 0
  %60 = extractvalue { double, double } %58, 1
  %61 = load ptr, ptr %44, align 8, !tbaa !15
  %62 = getelementptr inbounds ptr, ptr %61, i64 %.287
  %63 = load ptr, ptr %62, align 8, !tbaa !16
  %64 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %63, i64 %.17285
  store double %59, ptr %64, align 8, !tbaa !26
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %64, i64 8
  store double %60, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !26
  %65 = add nuw nsw i64 %.17285, 1
  %exitcond93.not = icmp eq i64 %65, %indvars.iv
  br i1 %exitcond93.not, label %66, label %57, !llvm.loop !29

66:                                               ; preds = %57
  %67 = add nuw nsw i64 %.287, 1
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  %exitcond94.not = icmp eq i64 %67, %1
  br i1 %exitcond94.not, label %.loopexit, label %.preheader79, !llvm.loop !30

.loopexit:                                        ; preds = %66, %55, %.preheader80, %.preheader78
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  store i64 -3, ptr %3, align 8, !tbaa !5
  br label %69

68:                                               ; preds = %39
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %9, i64 noundef %1, ptr noundef %5)
  call void @_ZN11alglib_implL34matinv_hpdmatrixcholeskyinverserecEPNS_9ae_matrixEllbPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef nonnull %0, i64 noundef 0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef nonnull %9, ptr noundef %5)
  br label %69

69:                                               ; preds = %68, %.loopexit
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %5)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  ret void
}

declare noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef, ptr 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_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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL34matinv_hpdmatrixcholeskyinverserecEPNS_9ae_matrixEllbPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, i1 noundef zeroext, 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 = !{!7, !7, i64 0}
!16 = !{!13, !13, i64 0}
!17 = !{!18, !19, i64 0}
!18 = !{!"_ZTSN11alglib_impl10ae_complexE", !19, i64 0, !19, i64 8}
!19 = !{!"double", !7, i64 0}
!20 = !{!18, !19, i64 8}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !19, i64 0}
!24 = !{!"_ZTSN11alglib_impl12matinvreportE", !19, i64 0, !19, i64 8}
!25 = !{!24, !19, i64 8}
!26 = !{!19, !19, i64 0}
!27 = distinct !{!27, !22}
!28 = distinct !{!28, !22}
!29 = distinct !{!29, !22}
!30 = distinct !{!30, !22}


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