; LLVM IR from Dimandragon/non-parametric-dsp :: alglib-cpp/src (optimization)

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

@.str.273 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.274 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.283 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.286 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.287 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.288 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.289 = external hidden unnamed_addr constant [93 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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef, double noundef) #1

declare noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef, ptr noundef) #1

declare noundef double @_ZN11alglib_impl8rmaxabsvElPKNS_9ae_vectorEPNS_8ae_stateE(i64 noundef, ptr noundef, ptr noundef) #1

declare void @_ZN11alglib_impl8ae_traceEPKcz(ptr noundef, ...) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL25optserv_resetlowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL18optserv_popfrontxyEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef, ptr noundef) #3

declare void @_ZN11alglib_impl7rcopyvrElPKNS_9ae_vectorEPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16hessianupdatesr1EPNS_12xbfgshessianEPKNS_9ae_vectorES4_S4_S4_blPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i1 noundef zeroext %5, i64 noundef %6, ptr noundef %7) #3 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i8, align 1
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  %23 = zext i1 %5 to i8
  store i8 %23, ptr %14, align 1, !tbaa !9
  store i64 %6, ptr %15, align 8, !tbaa !11
  store ptr %7, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %24, i32 0, i32 0
  %26 = load i64, ptr %25, align 8, !tbaa !13
  %27 = icmp eq i64 %26, 4
  %28 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %27, ptr noundef @.str.286, ptr noundef %28)
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %29, i32 0, i32 3
  %31 = load i64, ptr %30, align 8, !tbaa !19
  store i64 %31, ptr %18, align 8, !tbaa !11
  %32 = load i8, ptr %14, align 1, !tbaa !9, !range !20, !noundef !21
  %33 = trunc i8 %32 to i1
  br i1 %33, label %34, label %37

34:                                               ; preds = %8
  %35 = load i64, ptr %15, align 8, !tbaa !11
  %36 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl11traceanglesElPNS_8ae_stateE(i64 noundef %35, ptr noundef %36)
  call void (ptr, ...) @_ZN11alglib_impl8ae_traceEPKcz(ptr noundef @.str.273)
  br label %37

37:                                               ; preds = %34, %8
  store i64 0, ptr %17, align 8, !tbaa !11
  br label %38

38:                                               ; preds = %82, %37
  %39 = load i64, ptr %17, align 8, !tbaa !11
  %40 = load i64, ptr %18, align 8, !tbaa !11
  %41 = sub nsw i64 %40, 1
  %42 = icmp sle i64 %39, %41
  br i1 %42, label %43, label %85

43:                                               ; preds = %38
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %44, i32 0, i32 4
  %46 = load ptr, ptr %45, align 8, !tbaa !22
  %47 = load i64, ptr %17, align 8, !tbaa !11
  %48 = getelementptr inbounds double, ptr %46, i64 %47
  %49 = load double, ptr %48, align 8, !tbaa !23
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %50, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !22
  %53 = load i64, ptr %17, align 8, !tbaa !11
  %54 = getelementptr inbounds double, ptr %52, i64 %53
  %55 = load double, ptr %54, align 8, !tbaa !23
  %56 = fsub double %49, %55
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %57, i32 0, i32 46
  %59 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %58, i32 0, i32 4
  %60 = load ptr, ptr %59, align 8, !tbaa !22
  %61 = load i64, ptr %17, align 8, !tbaa !11
  %62 = getelementptr inbounds double, ptr %60, i64 %61
  store double %56, ptr %62, align 8, !tbaa !23
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %63, i32 0, i32 4
  %65 = load ptr, ptr %64, align 8, !tbaa !22
  %66 = load i64, ptr %17, align 8, !tbaa !11
  %67 = getelementptr inbounds double, ptr %65, i64 %66
  %68 = load double, ptr %67, align 8, !tbaa !23
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %69, i32 0, i32 4
  %71 = load ptr, ptr %70, align 8, !tbaa !22
  %72 = load i64, ptr %17, align 8, !tbaa !11
  %73 = getelementptr inbounds double, ptr %71, i64 %72
  %74 = load double, ptr %73, align 8, !tbaa !23
  %75 = fsub double %68, %74
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %76, i32 0, i32 47
  %78 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %77, i32 0, i32 4
  %79 = load ptr, ptr %78, align 8, !tbaa !22
  %80 = load i64, ptr %17, align 8, !tbaa !11
  %81 = getelementptr inbounds double, ptr %79, i64 %80
  store double %75, ptr %81, align 8, !tbaa !23
  br label %82

82:                                               ; preds = %43
  %83 = load i64, ptr %17, align 8, !tbaa !11
  %84 = add nsw i64 %83, 1
  store i64 %84, ptr %17, align 8, !tbaa !11
  br label %38, !llvm.loop !24

85:                                               ; preds = %38
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %86, i32 0, i32 12
  %88 = load i64, ptr %87, align 8, !tbaa !26
  %89 = icmp eq i64 %88, 0
  br i1 %89, label %90, label %98

90:                                               ; preds = %85
  %91 = load i8, ptr %14, align 1, !tbaa !9, !range !20, !noundef !21
  %92 = trunc i8 %91 to i1
  br i1 %92, label %93, label %97

93:                                               ; preds = %90
  %94 = load i64, ptr %15, align 8, !tbaa !11
  %95 = add nsw i64 %94, 1
  %96 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl11traceanglesElPNS_8ae_stateE(i64 noundef %95, ptr noundef %96)
  call void (ptr, ...) @_ZN11alglib_impl8ae_traceEPKcz(ptr noundef @.str.283)
  br label %97

97:                                               ; preds = %93, %90
  store i32 1, ptr %22, align 4
  br label %231

98:                                               ; preds = %85
  %99 = load i64, ptr %18, align 8, !tbaa !11
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %100, i32 0, i32 46
  %102 = load ptr, ptr %16, align 8, !tbaa !5
  %103 = call noundef double @_ZN11alglib_impl8rmaxabsvElPKNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %99, ptr noundef %101, ptr noundef %102)
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %104, i32 0, i32 5
  %106 = load double, ptr %105, align 8, !tbaa !27
  %107 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %103, double noundef %106)
  br i1 %107, label %108, label %116

108:                                              ; preds = %98
  %109 = load i8, ptr %14, align 1, !tbaa !9, !range !20, !noundef !21
  %110 = trunc i8 %109 to i1
  br i1 %110, label %111, label %115

111:                                              ; preds = %108
  %112 = load i64, ptr %15, align 8, !tbaa !11
  %113 = add nsw i64 %112, 1
  %114 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl11traceanglesElPNS_8ae_stateE(i64 noundef %113, ptr noundef %114)
  call void (ptr, ...) @_ZN11alglib_impl8ae_traceEPKcz(ptr noundef @.str.274)
  br label %115

115:                                              ; preds = %111, %108
  store i32 1, ptr %22, align 4
  br label %231

116:                                              ; preds = %98
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %117, i32 0, i32 20
  %119 = load i64, ptr %118, align 8, !tbaa !28
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %120, i32 0, i32 12
  %122 = load i64, ptr %121, align 8, !tbaa !26
  %123 = icmp sle i64 %119, %122
  %124 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %123, ptr noundef @.str.287, ptr noundef %124)
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  %126 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %125, i32 0, i32 20
  %127 = load i64, ptr %126, align 8, !tbaa !28
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %128, i32 0, i32 12
  %130 = load i64, ptr %129, align 8, !tbaa !26
  %131 = icmp eq i64 %127, %130
  br i1 %131, label %132, label %135

132:                                              ; preds = %116
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_implL18optserv_popfrontxyEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef %133, ptr noundef %134)
  br label %135

135:                                              ; preds = %132, %116
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %136, i32 0, i32 20
  %138 = load i64, ptr %137, align 8, !tbaa !28
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %139, i32 0, i32 12
  %141 = load i64, ptr %140, align 8, !tbaa !26
  %142 = icmp slt i64 %138, %141
  %143 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %142, ptr noundef @.str.288, ptr noundef %143)
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %144, i32 0, i32 20
  %146 = load i64, ptr %145, align 8, !tbaa !28
  %147 = add nsw i64 %146, 1
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %148, i32 0, i32 20
  store i64 %147, ptr %149, align 8, !tbaa !28
  %150 = load i64, ptr %18, align 8, !tbaa !11
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %151, i32 0, i32 46
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %153, i32 0, i32 22
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %155, i32 0, i32 20
  %157 = load i64, ptr %156, align 8, !tbaa !28
  %158 = sub nsw i64 %157, 1
  %159 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl7rcopyvrElPKNS_9ae_vectorEPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %150, ptr noundef %152, ptr noundef %154, i64 noundef %158, ptr noundef %159)
  %160 = load i64, ptr %18, align 8, !tbaa !11
  %161 = load ptr, ptr %9, align 8, !tbaa !5
  %162 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %161, i32 0, i32 47
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %163, i32 0, i32 23
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %165, i32 0, i32 20
  %167 = load i64, ptr %166, align 8, !tbaa !28
  %168 = sub nsw i64 %167, 1
  %169 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl7rcopyvrElPKNS_9ae_vectorEPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %160, ptr noundef %162, ptr noundef %164, i64 noundef %168, ptr noundef %169)
  %170 = load i8, ptr %14, align 1, !tbaa !9, !range !20, !noundef !21
  %171 = trunc i8 %170 to i1
  br i1 %171, label %172, label %228

172:                                              ; preds = %135
  %173 = load i64, ptr %15, align 8, !tbaa !11
  %174 = add nsw i64 %173, 1
  %175 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_impl11traceanglesElPNS_8ae_stateE(i64 noundef %174, ptr noundef %175)
  store double 0.000000e+00, ptr %20, align 8, !tbaa !23
  store double 0.000000e+00, ptr %21, align 8, !tbaa !23
  store i64 0, ptr %17, align 8, !tbaa !11
  br label %176

176:                                              ; preds = %217, %172
  %177 = load i64, ptr %17, align 8, !tbaa !11
  %178 = load i64, ptr %18, align 8, !tbaa !11
  %179 = sub nsw i64 %178, 1
  %180 = icmp sle i64 %177, %179
  br i1 %180, label %181, label %220

181:                                              ; preds = %176
  %182 = load double, ptr %20, align 8, !tbaa !23
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %183, i32 0, i32 46
  %185 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %184, i32 0, i32 4
  %186 = load ptr, ptr %185, align 8, !tbaa !22
  %187 = load i64, ptr %17, align 8, !tbaa !11
  %188 = getelementptr inbounds double, ptr %186, i64 %187
  %189 = load double, ptr %188, align 8, !tbaa !23
  %190 = load ptr, ptr %9, align 8, !tbaa !5
  %191 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %190, i32 0, i32 47
  %192 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %191, i32 0, i32 4
  %193 = load ptr, ptr %192, align 8, !tbaa !22
  %194 = load i64, ptr %17, align 8, !tbaa !11
  %195 = getelementptr inbounds double, ptr %193, i64 %194
  %196 = load double, ptr %195, align 8, !tbaa !23
  %197 = call double @llvm.fmuladd.f64(double %189, double %196, double %182)
  store double %197, ptr %20, align 8, !tbaa !23
  %198 = load double, ptr %21, align 8, !tbaa !23
  %199 = load ptr, ptr %9, align 8, !tbaa !5
  %200 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %199, i32 0, i32 46
  %201 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %200, i32 0, i32 4
  %202 = load ptr, ptr %201, align 8, !tbaa !22
  %203 = load i64, ptr %17, align 8, !tbaa !11
  %204 = getelementptr inbounds double, ptr %202, i64 %203
  %205 = load double, ptr %204, align 8, !tbaa !23
  %206 = load ptr, ptr %9, align 8, !tbaa !5
  %207 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %206, i32 0, i32 1
  %208 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %207, i32 0, i32 4
  %209 = load ptr, ptr %208, align 8, !tbaa !22
  %210 = load i64, ptr %17, align 8, !tbaa !11
  %211 = getelementptr inbounds double, ptr %209, i64 %210
  %212 = load double, ptr %211, align 8, !tbaa !23
  %213 = fdiv double %205, %212
  %214 = load ptr, ptr %16, align 8, !tbaa !5
  %215 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %213, ptr noundef %214)
  %216 = fadd double %198, %215
  store double %216, ptr %21, align 8, !tbaa !23
  br label %217

217:                                              ; preds = %181
  %218 = load i64, ptr %17, align 8, !tbaa !11
  %219 = add nsw i64 %218, 1
  store i64 %219, ptr %17, align 8, !tbaa !11
  br label %176, !llvm.loop !29

220:                                              ; preds = %176
  %221 = load double, ptr %20, align 8, !tbaa !23
  %222 = load double, ptr %21, align 8, !tbaa !23
  %223 = fadd double %222, 2.500000e-31
  %224 = fdiv double %221, %223
  store double %224, ptr %19, align 8, !tbaa !23
  %225 = load double, ptr %19, align 8, !tbaa !23
  %226 = load double, ptr %20, align 8, !tbaa !23
  %227 = load double, ptr %21, align 8, !tbaa !23
  call void (ptr, ...) @_ZN11alglib_impl8ae_traceEPKcz(ptr noundef @.str.289, double noundef %225, double noundef %226, double noundef %227)
  br label %228

228:                                              ; preds = %220, %135
  %229 = load ptr, ptr %9, align 8, !tbaa !5
  %230 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN11alglib_implL25optserv_resetlowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef %229, ptr noundef %230)
  store i32 0, ptr %22, align 4
  br label %231

231:                                              ; preds = %228, %115, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %232 = load i32, ptr %22, align 4
  switch i32 %232, label %234 [
    i32 0, label %233
    i32 1, label %233
  ]

233:                                              ; preds = %231, %231
  ret void

234:                                              ; preds = %231
  unreachable
}

declare void @_ZN11alglib_impl11traceanglesElPNS_8ae_stateE(i64 noundef, ptr noundef) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTSN11alglib_impl12xbfgshessianE", !12, i64 0, !15, i64 8, !15, i64 72, !12, i64 136, !12, i64 144, !17, i64 152, !17, i64 160, !17, i64 168, !17, i64 176, !17, i64 184, !17, i64 192, !17, i64 200, !12, i64 208, !17, i64 216, !17, i64 224, !18, i64 232, !12, i64 312, !17, i64 320, !17, i64 328, !17, i64 336, !12, i64 344, !17, i64 352, !18, i64 360, !18, i64 440, !18, i64 520, !18, i64 600, !10, i64 680, !12, i64 688, !18, i64 696, !18, i64 776, !10, i64 856, !15, i64 864, !10, i64 928, !12, i64 936, !18, i64 944, !15, i64 1024, !15, i64 1088, !18, i64 1152, !15, i64 1232, !15, i64 1296, !10, i64 1360, !15, i64 1368, !17, i64 1432, !17, i64 1440, !12, i64 1448, !18, i64 1456, !15, i64 1536, !15, i64 1600, !15, i64 1664, !15, i64 1728, !15, i64 1792, !15, i64 1856, !18, i64 1920, !18, i64 2000, !18, i64 2080, !18, i64 2160, !18, i64 2240, !18, i64 2320, !18, i64 2400, !18, i64 2480, !15, i64 2560, !15, i64 2624, !18, i64 2688, !15, i64 2768, !18, i64 2832, !18, i64 2912, !18, i64 2992, !18, i64 3072, !18, i64 3152, !15, i64 3232, !15, i64 3296}
!15 = !{!"_ZTSN11alglib_impl9ae_vectorE", !12, i64 0, !12, i64 8, !10, i64 16, !16, i64 24, !7, i64 56}
!16 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!"double", !7, i64 0}
!18 = !{!"_ZTSN11alglib_impl9ae_matrixE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !10, i64 32, !16, i64 40, !7, i64 72}
!19 = !{!14, !12, i64 136}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!7, !7, i64 0}
!23 = !{!17, !17, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!14, !12, i64 208}
!27 = !{!14, !17, i64 152}
!28 = !{!14, !12, i64 344}
!29 = distinct !{!29, !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"

@.str.273 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.274 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.283 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.286 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.287 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.288 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.289 = external hidden unnamed_addr constant [93 x i8], align 1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef, double noundef) local_unnamed_addr #0

declare noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #0

declare noundef double @_ZN11alglib_impl8rmaxabsvElPKNS_9ae_vectorEPNS_8ae_stateE(i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @_ZN11alglib_impl8ae_traceEPKcz(ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL25optserv_resetlowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL18optserv_popfrontxyEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl7rcopyvrElPKNS_9ae_vectorEPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16hessianupdatesr1EPNS_12xbfgshessianEPKNS_9ae_vectorES4_S4_S4_blPNS_8ae_stateE(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4, i1 noundef zeroext %5, i64 noundef %6, ptr noundef %7) local_unnamed_addr #2 {
  %9 = load i64, ptr %0, align 8, !tbaa !5
  %10 = icmp eq i64 %9, 4
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %10, ptr noundef nonnull @.str.286, ptr noundef %7)
  %11 = getelementptr inbounds i8, ptr %0, i64 136
  %12 = load i64, ptr %11, align 8, !tbaa !16
  br i1 %5, label %13, label %14

13:                                               ; preds = %8
  tail call void @_ZN11alglib_impl11traceanglesElPNS_8ae_stateE(i64 noundef %6, ptr noundef %7)
  tail call void (ptr, ...) @_ZN11alglib_impl8ae_traceEPKcz(ptr noundef nonnull @.str.273)
  br label %14

14:                                               ; preds = %13, %8
  %.not.not81 = icmp sgt i64 %12, 0
  br i1 %.not.not81, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %14
  %15 = getelementptr inbounds i8, ptr %3, i64 56
  %16 = getelementptr inbounds i8, ptr %1, i64 56
  %17 = getelementptr inbounds i8, ptr %0, i64 1592
  %18 = getelementptr inbounds i8, ptr %4, i64 56
  %19 = getelementptr inbounds i8, ptr %2, i64 56
  %20 = getelementptr inbounds i8, ptr %0, i64 1656
  br label %21

21:                                               ; preds = %.lr.ph, %21
  %.07882 = phi i64 [ 0, %.lr.ph ], [ %40, %21 ]
  %22 = load ptr, ptr %15, align 8, !tbaa !17
  %23 = getelementptr inbounds double, ptr %22, i64 %.07882
  %24 = load double, ptr %23, align 8, !tbaa !18
  %25 = load ptr, ptr %16, align 8, !tbaa !17
  %26 = getelementptr inbounds double, ptr %25, i64 %.07882
  %27 = load double, ptr %26, align 8, !tbaa !18
  %28 = fsub double %24, %27
  %29 = load ptr, ptr %17, align 8, !tbaa !17
  %30 = getelementptr inbounds double, ptr %29, i64 %.07882
  store double %28, ptr %30, align 8, !tbaa !18
  %31 = load ptr, ptr %18, align 8, !tbaa !17
  %32 = getelementptr inbounds double, ptr %31, i64 %.07882
  %33 = load double, ptr %32, align 8, !tbaa !18
  %34 = load ptr, ptr %19, align 8, !tbaa !17
  %35 = getelementptr inbounds double, ptr %34, i64 %.07882
  %36 = load double, ptr %35, align 8, !tbaa !18
  %37 = fsub double %33, %36
  %38 = load ptr, ptr %20, align 8, !tbaa !17
  %39 = getelementptr inbounds double, ptr %38, i64 %.07882
  store double %37, ptr %39, align 8, !tbaa !18
  %40 = add nuw nsw i64 %.07882, 1
  %exitcond.not = icmp eq i64 %40, %12
  br i1 %exitcond.not, label %._crit_edge, label %21, !llvm.loop !19

._crit_edge:                                      ; preds = %21, %14
  %41 = getelementptr inbounds i8, ptr %0, i64 208
  %42 = load i64, ptr %41, align 8, !tbaa !21
  %43 = icmp eq i64 %42, 0
  br i1 %43, label %44, label %47

44:                                               ; preds = %._crit_edge
  br i1 %5, label %45, label %99

45:                                               ; preds = %44
  %46 = add nsw i64 %6, 1
  tail call void @_ZN11alglib_impl11traceanglesElPNS_8ae_stateE(i64 noundef %46, ptr noundef %7)
  tail call void (ptr, ...) @_ZN11alglib_impl8ae_traceEPKcz(ptr noundef nonnull @.str.283)
  br label %99

47:                                               ; preds = %._crit_edge
  %48 = getelementptr inbounds i8, ptr %0, i64 1536
  %49 = tail call noundef double @_ZN11alglib_impl8rmaxabsvElPKNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %12, ptr noundef nonnull %48, ptr noundef %7)
  %50 = getelementptr inbounds i8, ptr %0, i64 152
  %51 = load double, ptr %50, align 8, !tbaa !22
  %52 = tail call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %49, double noundef %51)
  br i1 %52, label %53, label %56

53:                                               ; preds = %47
  br i1 %5, label %54, label %99

54:                                               ; preds = %53
  %55 = add nsw i64 %6, 1
  tail call void @_ZN11alglib_impl11traceanglesElPNS_8ae_stateE(i64 noundef %55, ptr noundef %7)
  tail call void (ptr, ...) @_ZN11alglib_impl8ae_traceEPKcz(ptr noundef nonnull @.str.274)
  br label %99

56:                                               ; preds = %47
  %57 = getelementptr inbounds i8, ptr %0, i64 344
  %58 = load i64, ptr %57, align 8, !tbaa !23
  %59 = load i64, ptr %41, align 8, !tbaa !21
  %60 = icmp sle i64 %58, %59
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %60, ptr noundef nonnull @.str.287, ptr noundef %7)
  %61 = load i64, ptr %57, align 8, !tbaa !23
  %62 = load i64, ptr %41, align 8, !tbaa !21
  %63 = icmp eq i64 %61, %62
  br i1 %63, label %64, label %65

64:                                               ; preds = %56
  tail call void @_ZN11alglib_implL18optserv_popfrontxyEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef nonnull %0, ptr noundef %7)
  %.pre = load i64, ptr %57, align 8, !tbaa !23
  %.pre93 = load i64, ptr %41, align 8, !tbaa !21
  br label %65

65:                                               ; preds = %64, %56
  %66 = phi i64 [ %.pre93, %64 ], [ %62, %56 ]
  %67 = phi i64 [ %.pre, %64 ], [ %61, %56 ]
  %68 = icmp slt i64 %67, %66
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %68, ptr noundef nonnull @.str.288, ptr noundef %7)
  %69 = load i64, ptr %57, align 8, !tbaa !23
  %70 = add nsw i64 %69, 1
  store i64 %70, ptr %57, align 8, !tbaa !23
  %71 = getelementptr inbounds i8, ptr %0, i64 360
  tail call void @_ZN11alglib_impl7rcopyvrElPKNS_9ae_vectorEPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %12, ptr noundef nonnull %48, ptr noundef nonnull %71, i64 noundef %69, ptr noundef %7)
  %72 = getelementptr inbounds i8, ptr %0, i64 1600
  %73 = getelementptr inbounds i8, ptr %0, i64 440
  %74 = load i64, ptr %57, align 8, !tbaa !23
  %75 = add nsw i64 %74, -1
  tail call void @_ZN11alglib_impl7rcopyvrElPKNS_9ae_vectorEPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %12, ptr noundef nonnull %72, ptr noundef nonnull %73, i64 noundef %75, ptr noundef %7)
  br i1 %5, label %76, label %98

76:                                               ; preds = %65
  %77 = add nsw i64 %6, 1
  tail call void @_ZN11alglib_impl11traceanglesElPNS_8ae_stateE(i64 noundef %77, ptr noundef %7)
  br i1 %.not.not81, label %.lr.ph88, label %._crit_edge89

.lr.ph88:                                         ; preds = %76
  %78 = getelementptr inbounds i8, ptr %0, i64 1592
  %79 = getelementptr inbounds i8, ptr %0, i64 1656
  %80 = getelementptr inbounds i8, ptr %0, i64 64
  br label %81

81:                                               ; preds = %.lr.ph88, %81
  %.086 = phi double [ 0.000000e+00, %.lr.ph88 ], [ %94, %81 ]
  %.07785 = phi double [ 0.000000e+00, %.lr.ph88 ], [ %88, %81 ]
  %.184 = phi i64 [ 0, %.lr.ph88 ], [ %95, %81 ]
  %82 = load ptr, ptr %78, align 8, !tbaa !17
  %83 = getelementptr inbounds double, ptr %82, i64 %.184
  %84 = load double, ptr %83, align 8, !tbaa !18
  %85 = load ptr, ptr %79, align 8, !tbaa !17
  %86 = getelementptr inbounds double, ptr %85, i64 %.184
  %87 = load double, ptr %86, align 8, !tbaa !18
  %88 = tail call double @llvm.fmuladd.f64(double %84, double %87, double %.07785)
  %89 = load ptr, ptr %80, align 8, !tbaa !17
  %90 = getelementptr inbounds double, ptr %89, i64 %.184
  %91 = load double, ptr %90, align 8, !tbaa !18
  %92 = fdiv double %84, %91
  %93 = tail call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %92, ptr noundef %7)
  %94 = fadd double %.086, %93
  %95 = add nuw nsw i64 %.184, 1
  %exitcond92.not = icmp eq i64 %95, %12
  br i1 %exitcond92.not, label %._crit_edge89, label %81, !llvm.loop !24

._crit_edge89:                                    ; preds = %81, %76
  %.077.lcssa = phi double [ 0.000000e+00, %76 ], [ %88, %81 ]
  %.0.lcssa = phi double [ 0.000000e+00, %76 ], [ %94, %81 ]
  %96 = fadd double %.0.lcssa, 2.500000e-31
  %97 = fdiv double %.077.lcssa, %96
  tail call void (ptr, ...) @_ZN11alglib_impl8ae_traceEPKcz(ptr noundef nonnull @.str.289, double noundef %97, double noundef %.077.lcssa, double noundef %.0.lcssa)
  br label %98

98:                                               ; preds = %._crit_edge89, %65
  tail call void @_ZN11alglib_implL25optserv_resetlowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef nonnull %0, ptr noundef %7)
  br label %99

99:                                               ; preds = %53, %54, %44, %45, %98
  ret void
}

declare void @_ZN11alglib_impl11traceanglesElPNS_8ae_stateE(i64 noundef, ptr noundef) local_unnamed_addr #0

attributes #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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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" }

!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 0}
!6 = !{!"_ZTSN11alglib_impl12xbfgshessianE", !7, i64 0, !10, i64 8, !10, i64 72, !7, i64 136, !7, i64 144, !14, i64 152, !14, i64 160, !14, i64 168, !14, i64 176, !14, i64 184, !14, i64 192, !14, i64 200, !7, i64 208, !14, i64 216, !14, i64 224, !15, i64 232, !7, i64 312, !14, i64 320, !14, i64 328, !14, i64 336, !7, i64 344, !14, i64 352, !15, i64 360, !15, i64 440, !15, i64 520, !15, i64 600, !11, i64 680, !7, i64 688, !15, i64 696, !15, i64 776, !11, i64 856, !10, i64 864, !11, i64 928, !7, i64 936, !15, i64 944, !10, i64 1024, !10, i64 1088, !15, i64 1152, !10, i64 1232, !10, i64 1296, !11, i64 1360, !10, i64 1368, !14, i64 1432, !14, i64 1440, !7, i64 1448, !15, i64 1456, !10, i64 1536, !10, i64 1600, !10, i64 1664, !10, i64 1728, !10, i64 1792, !10, i64 1856, !15, i64 1920, !15, i64 2000, !15, i64 2080, !15, i64 2160, !15, i64 2240, !15, i64 2320, !15, i64 2400, !15, i64 2480, !10, i64 2560, !10, i64 2624, !15, i64 2688, !10, i64 2768, !15, i64 2832, !15, i64 2912, !15, i64 2992, !15, i64 3072, !15, i64 3152, !10, i64 3232, !10, i64 3296}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !11, i64 16, !12, i64 24, !8, i64 56}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"double", !8, i64 0}
!15 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !12, i64 40, !8, i64 72}
!16 = !{!6, !7, i64 136}
!17 = !{!8, !8, i64 0}
!18 = !{!14, !14, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!6, !7, i64 208}
!22 = !{!6, !14, i64 152}
!23 = !{!6, !7, i64 344}
!24 = distinct !{!24, !20}


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