; 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.297 = external hidden unnamed_addr constant [55 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

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

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

declare void @_ZN11alglib_impl10rsetallocvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef, double noundef, ptr noundef, ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl17hessiangetlowrankEPNS_12xbfgshessianEPNS_9ae_vectorEPNS_9ae_matrixES3_PlPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  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 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %16 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 0, ptr %16, align 8, !tbaa !9
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %17, i32 0, i32 0
  %19 = load i64, ptr %18, align 8, !tbaa !11
  %20 = icmp eq i64 %19, 3
  br i1 %20, label %26, label %21

21:                                               ; preds = %6
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %22, i32 0, i32 0
  %24 = load i64, ptr %23, align 8, !tbaa !11
  %25 = icmp eq i64 %24, 4
  br label %26

26:                                               ; preds = %21, %6
  %27 = phi i1 [ true, %6 ], [ %25, %21 ]
  %28 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %27, ptr noundef @.str.297, ptr noundef %28)
  %29 = load ptr, ptr %7, 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 !18
  store i64 %31, ptr %15, align 8, !tbaa !9
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %32, i32 0, i32 0
  %34 = load i64, ptr %33, align 8, !tbaa !11
  %35 = icmp eq i64 %34, 3
  br i1 %35, label %36, label %141

36:                                               ; preds = %26
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_implL29optserv_recomputelowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef %37, ptr noundef %38)
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %39, i32 0, i32 27
  %41 = load i64, ptr %40, align 8, !tbaa !19
  %42 = mul nsw i64 2, %41
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 %42, ptr %43, align 8, !tbaa !9
  %44 = load i64, ptr %15, align 8, !tbaa !9
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %45, i32 0, i32 21
  %47 = load double, ptr %46, align 8, !tbaa !20
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl10rsetallocvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %44, double noundef %47, ptr noundef %48, ptr noundef %49)
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %50, i32 0, i32 27
  %52 = load i64, ptr %51, align 8, !tbaa !19
  %53 = icmp sgt i64 %52, 0
  br i1 %53, label %54, label %140

54:                                               ; preds = %36
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = load i64, ptr %55, align 8, !tbaa !9
  %57 = load i64, ptr %15, align 8, !tbaa !9
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl7rallocmEllPNS_9ae_matrixEPNS_8ae_stateE(i64 noundef %56, i64 noundef %57, ptr noundef %58, ptr noundef %59)
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl7rallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %61, ptr noundef %62, ptr noundef %63)
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %64

64:                                               ; preds = %136, %54
  %65 = load i64, ptr %13, align 8, !tbaa !9
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %66, i32 0, i32 27
  %68 = load i64, ptr %67, align 8, !tbaa !19
  %69 = sub nsw i64 %68, 1
  %70 = icmp sle i64 %65, %69
  br i1 %70, label %71, label %139

71:                                               ; preds = %64
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %72

72:                                               ; preds = %118, %71
  %73 = load i64, ptr %14, align 8, !tbaa !9
  %74 = load i64, ptr %15, align 8, !tbaa !9
  %75 = sub nsw i64 %74, 1
  %76 = icmp sle i64 %73, %75
  br i1 %76, label %77, label %121

77:                                               ; preds = %72
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %78, i32 0, i32 28
  %80 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %79, i32 0, i32 6
  %81 = load ptr, ptr %80, align 8, !tbaa !21
  %82 = load i64, ptr %13, align 8, !tbaa !9
  %83 = getelementptr inbounds ptr, ptr %81, i64 %82
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  %85 = load i64, ptr %14, align 8, !tbaa !9
  %86 = getelementptr inbounds double, ptr %84, i64 %85
  %87 = load double, ptr %86, align 8, !tbaa !22
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %88, i32 0, i32 6
  %90 = load ptr, ptr %89, align 8, !tbaa !21
  %91 = load i64, ptr %13, align 8, !tbaa !9
  %92 = mul nsw i64 2, %91
  %93 = add nsw i64 %92, 0
  %94 = getelementptr inbounds ptr, ptr %90, i64 %93
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  %96 = load i64, ptr %14, align 8, !tbaa !9
  %97 = getelementptr inbounds double, ptr %95, i64 %96
  store double %87, ptr %97, align 8, !tbaa !22
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %98, i32 0, i32 29
  %100 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %99, i32 0, i32 6
  %101 = load ptr, ptr %100, align 8, !tbaa !21
  %102 = load i64, ptr %13, align 8, !tbaa !9
  %103 = getelementptr inbounds ptr, ptr %101, i64 %102
  %104 = load ptr, ptr %103, align 8, !tbaa !5
  %105 = load i64, ptr %14, align 8, !tbaa !9
  %106 = getelementptr inbounds double, ptr %104, i64 %105
  %107 = load double, ptr %106, align 8, !tbaa !22
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %108, i32 0, i32 6
  %110 = load ptr, ptr %109, align 8, !tbaa !21
  %111 = load i64, ptr %13, align 8, !tbaa !9
  %112 = mul nsw i64 2, %111
  %113 = add nsw i64 %112, 1
  %114 = getelementptr inbounds ptr, ptr %110, i64 %113
  %115 = load ptr, ptr %114, align 8, !tbaa !5
  %116 = load i64, ptr %14, align 8, !tbaa !9
  %117 = getelementptr inbounds double, ptr %115, i64 %116
  store double %107, ptr %117, align 8, !tbaa !22
  br label %118

118:                                              ; preds = %77
  %119 = load i64, ptr %14, align 8, !tbaa !9
  %120 = add nsw i64 %119, 1
  store i64 %120, ptr %14, align 8, !tbaa !9
  br label %72, !llvm.loop !23

121:                                              ; preds = %72
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %122, i32 0, i32 4
  %124 = load ptr, ptr %123, align 8, !tbaa !21
  %125 = load i64, ptr %13, align 8, !tbaa !9
  %126 = mul nsw i64 2, %125
  %127 = add nsw i64 %126, 0
  %128 = getelementptr inbounds double, ptr %124, i64 %127
  store double 1.000000e+00, ptr %128, align 8, !tbaa !22
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  %130 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %129, i32 0, i32 4
  %131 = load ptr, ptr %130, align 8, !tbaa !21
  %132 = load i64, ptr %13, align 8, !tbaa !9
  %133 = mul nsw i64 2, %132
  %134 = add nsw i64 %133, 1
  %135 = getelementptr inbounds double, ptr %131, i64 %134
  store double -1.000000e+00, ptr %135, align 8, !tbaa !22
  br label %136

136:                                              ; preds = %121
  %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 %64, !llvm.loop !25

139:                                              ; preds = %64
  br label %140

140:                                              ; preds = %139, %36
  br label %141

141:                                              ; preds = %140, %26
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %142, i32 0, i32 0
  %144 = load i64, ptr %143, align 8, !tbaa !11
  %145 = icmp eq i64 %144, 4
  br i1 %145, label %146, label %177

146:                                              ; preds = %141
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_implL29optserv_recomputelowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef %147, ptr noundef %148)
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %149, i32 0, i32 33
  %151 = load i64, ptr %150, align 8, !tbaa !26
  %152 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 %151, ptr %152, align 8, !tbaa !9
  %153 = load i64, ptr %15, align 8, !tbaa !9
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %154, i32 0, i32 35
  %156 = load ptr, ptr %8, align 8, !tbaa !5
  %157 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %153, ptr noundef %155, ptr noundef %156, ptr noundef %157)
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %158, i32 0, i32 33
  %160 = load i64, ptr %159, align 8, !tbaa !26
  %161 = icmp sgt i64 %160, 0
  br i1 %161, label %162, label %176

162:                                              ; preds = %146
  %163 = load ptr, ptr %11, align 8, !tbaa !5
  %164 = load i64, ptr %163, align 8, !tbaa !9
  %165 = load i64, ptr %15, align 8, !tbaa !9
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %166, i32 0, i32 34
  %168 = load ptr, ptr %9, align 8, !tbaa !5
  %169 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl11rcopyallocmEllPKNS_9ae_matrixEPS0_PNS_8ae_stateE(i64 noundef %164, i64 noundef %165, ptr noundef %167, ptr noundef %168, ptr noundef %169)
  %170 = load ptr, ptr %11, align 8, !tbaa !5
  %171 = load i64, ptr %170, align 8, !tbaa !9
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %172, i32 0, i32 36
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %171, ptr noundef %173, ptr noundef %174, ptr noundef %175)
  br label %176

176:                                              ; preds = %162, %146
  br label %177

177:                                              ; preds = %176, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  ret void
}

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

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


; 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.297 = external hidden unnamed_addr constant [55 x i8], align 1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl17hessiangetlowrankEPNS_12xbfgshessianEPNS_9ae_vectorEPNS_9ae_matrixES3_PlPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr nocapture noundef %4, ptr noundef %5) local_unnamed_addr #1 {
  store i64 0, ptr %4, align 8, !tbaa !5
  %7 = load i64, ptr %0, align 8, !tbaa !9
  %8 = add i64 %7, -3
  %spec.select = icmp ult i64 %8, 2
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %spec.select, ptr noundef nonnull @.str.297, ptr noundef %5)
  %9 = getelementptr inbounds i8, ptr %0, i64 136
  %10 = load i64, ptr %9, align 8, !tbaa !17
  %11 = load i64, ptr %0, align 8, !tbaa !9
  %12 = icmp eq i64 %11, 3
  br i1 %12, label %13, label %77

13:                                               ; preds = %6
  tail call void @_ZN11alglib_implL29optserv_recomputelowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef nonnull %0, ptr noundef %5)
  %14 = getelementptr inbounds i8, ptr %0, i64 688
  %15 = load i64, ptr %14, align 8, !tbaa !18
  %16 = shl nsw i64 %15, 1
  store i64 %16, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 352
  %18 = load double, ptr %17, align 8, !tbaa !19
  tail call void @_ZN11alglib_impl10rsetallocvEldPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %10, double noundef %18, ptr noundef %1, ptr noundef %5)
  %19 = load i64, ptr %14, align 8, !tbaa !18
  %20 = icmp sgt i64 %19, 0
  br i1 %20, label %21, label %thread-pre-split

21:                                               ; preds = %13
  %22 = load i64, ptr %4, align 8, !tbaa !5
  tail call void @_ZN11alglib_impl7rallocmEllPNS_9ae_matrixEPNS_8ae_stateE(i64 noundef %22, i64 noundef %10, ptr noundef %2, ptr noundef %5)
  %23 = load i64, ptr %4, align 8, !tbaa !5
  tail call void @_ZN11alglib_impl7rallocvElPNS_9ae_vectorEPNS_8ae_stateE(i64 noundef %23, ptr noundef %3, ptr noundef %5)
  %24 = load i64, ptr %14, align 8, !tbaa !18
  %.not.not67 = icmp sgt i64 %24, 0
  br i1 %.not.not67, label %.preheader.lr.ph, label %thread-pre-split

.preheader.lr.ph:                                 ; preds = %21
  %.not.not6465 = icmp sgt i64 %10, 0
  %25 = getelementptr inbounds i8, ptr %0, i64 768
  %26 = getelementptr inbounds i8, ptr %2, i64 72
  %27 = getelementptr inbounds i8, ptr %0, i64 848
  %28 = getelementptr inbounds i8, ptr %3, i64 56
  br i1 %.not.not6465, label %.preheader.us, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %xtraiter = and i64 %24, 1
  %29 = icmp eq i64 %24, 1
  br i1 %29, label %thread-pre-split.loopexit74.unr-lcssa, label %.preheader.preheader.new

.preheader.preheader.new:                         ; preds = %.preheader.preheader
  %unroll_iter = and i64 %24, 9223372036854775806
  br label %.preheader

.preheader.us:                                    ; preds = %.preheader.lr.ph, %._crit_edge.us
  %.068.us = phi i64 [ %56, %._crit_edge.us ], [ 0, %.preheader.lr.ph ]
  %30 = shl nuw nsw i64 %.068.us, 1
  %31 = or disjoint i64 %30, 1
  br label %32

32:                                               ; preds = %.preheader.us, %32
  %.06266.us = phi i64 [ 0, %.preheader.us ], [ %51, %32 ]
  %33 = load ptr, ptr %25, align 8, !tbaa !20
  %34 = getelementptr inbounds ptr, ptr %33, i64 %.068.us
  %35 = load ptr, ptr %34, align 8, !tbaa !21
  %36 = getelementptr inbounds double, ptr %35, i64 %.06266.us
  %37 = load double, ptr %36, align 8, !tbaa !22
  %38 = load ptr, ptr %26, align 8, !tbaa !20
  %39 = getelementptr inbounds ptr, ptr %38, i64 %30
  %40 = load ptr, ptr %39, align 8, !tbaa !21
  %41 = getelementptr inbounds double, ptr %40, i64 %.06266.us
  store double %37, ptr %41, align 8, !tbaa !22
  %42 = load ptr, ptr %27, align 8, !tbaa !20
  %43 = getelementptr inbounds ptr, ptr %42, i64 %.068.us
  %44 = load ptr, ptr %43, align 8, !tbaa !21
  %45 = getelementptr inbounds double, ptr %44, i64 %.06266.us
  %46 = load double, ptr %45, align 8, !tbaa !22
  %47 = load ptr, ptr %26, align 8, !tbaa !20
  %48 = getelementptr inbounds ptr, ptr %47, i64 %31
  %49 = load ptr, ptr %48, align 8, !tbaa !21
  %50 = getelementptr inbounds double, ptr %49, i64 %.06266.us
  store double %46, ptr %50, align 8, !tbaa !22
  %51 = add nuw nsw i64 %.06266.us, 1
  %exitcond70.not = icmp eq i64 %51, %10
  br i1 %exitcond70.not, label %._crit_edge.us, label %32, !llvm.loop !23

._crit_edge.us:                                   ; preds = %32
  %52 = load ptr, ptr %28, align 8, !tbaa !20
  %53 = getelementptr inbounds double, ptr %52, i64 %30
  store double 1.000000e+00, ptr %53, align 8, !tbaa !22
  %54 = load ptr, ptr %28, align 8, !tbaa !20
  %55 = getelementptr inbounds double, ptr %54, i64 %31
  store double -1.000000e+00, ptr %55, align 8, !tbaa !22
  %56 = add nuw nsw i64 %.068.us, 1
  %exitcond71.not = icmp eq i64 %56, %24
  br i1 %exitcond71.not, label %thread-pre-split, label %.preheader.us, !llvm.loop !25

.preheader:                                       ; preds = %.preheader, %.preheader.preheader.new
  %.068 = phi i64 [ 0, %.preheader.preheader.new ], [ %70, %.preheader ]
  %niter = phi i64 [ 0, %.preheader.preheader.new ], [ %niter.next.1, %.preheader ]
  %57 = load ptr, ptr %28, align 8, !tbaa !20
  %58 = shl nuw nsw i64 %.068, 1
  %59 = getelementptr inbounds double, ptr %57, i64 %58
  store double 1.000000e+00, ptr %59, align 8, !tbaa !22
  %60 = load ptr, ptr %28, align 8, !tbaa !20
  %61 = or disjoint i64 %58, 1
  %62 = getelementptr inbounds double, ptr %60, i64 %61
  store double -1.000000e+00, ptr %62, align 8, !tbaa !22
  %63 = load ptr, ptr %28, align 8, !tbaa !20
  %64 = shl nuw i64 %.068, 1
  %65 = or disjoint i64 %64, 2
  %66 = getelementptr inbounds double, ptr %63, i64 %65
  store double 1.000000e+00, ptr %66, align 8, !tbaa !22
  %67 = load ptr, ptr %28, align 8, !tbaa !20
  %68 = or disjoint i64 %64, 3
  %69 = getelementptr inbounds double, ptr %67, i64 %68
  store double -1.000000e+00, ptr %69, align 8, !tbaa !22
  %70 = add nuw nsw i64 %.068, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %thread-pre-split.loopexit74.unr-lcssa.loopexit, label %.preheader, !llvm.loop !25

thread-pre-split.loopexit74.unr-lcssa.loopexit:   ; preds = %.preheader
  %71 = shl nuw nsw i64 %70, 1
  br label %thread-pre-split.loopexit74.unr-lcssa

thread-pre-split.loopexit74.unr-lcssa:            ; preds = %thread-pre-split.loopexit74.unr-lcssa.loopexit, %.preheader.preheader
  %.068.unr = phi i64 [ 0, %.preheader.preheader ], [ %71, %thread-pre-split.loopexit74.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %thread-pre-split, label %.preheader.epil

.preheader.epil:                                  ; preds = %thread-pre-split.loopexit74.unr-lcssa
  %72 = load ptr, ptr %28, align 8, !tbaa !20
  %73 = getelementptr inbounds double, ptr %72, i64 %.068.unr
  store double 1.000000e+00, ptr %73, align 8, !tbaa !22
  %74 = load ptr, ptr %28, align 8, !tbaa !20
  %75 = or disjoint i64 %.068.unr, 1
  %76 = getelementptr inbounds double, ptr %74, i64 %75
  store double -1.000000e+00, ptr %76, align 8, !tbaa !22
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %.preheader.epil, %thread-pre-split.loopexit74.unr-lcssa, %._crit_edge.us, %21, %13
  %.pr = load i64, ptr %0, align 8, !tbaa !9
  br label %77

77:                                               ; preds = %thread-pre-split, %6
  %78 = phi i64 [ %.pr, %thread-pre-split ], [ %11, %6 ]
  %79 = icmp eq i64 %78, 4
  br i1 %79, label %80, label %91

80:                                               ; preds = %77
  tail call void @_ZN11alglib_implL29optserv_recomputelowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef nonnull %0, ptr noundef %5)
  %81 = getelementptr inbounds i8, ptr %0, i64 936
  %82 = load i64, ptr %81, align 8, !tbaa !26
  store i64 %82, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds i8, ptr %0, i64 1024
  tail call void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %10, ptr noundef nonnull %83, ptr noundef %1, ptr noundef %5)
  %84 = load i64, ptr %81, align 8, !tbaa !26
  %85 = icmp sgt i64 %84, 0
  br i1 %85, label %86, label %91

86:                                               ; preds = %80
  %87 = load i64, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %0, i64 944
  tail call void @_ZN11alglib_impl11rcopyallocmEllPKNS_9ae_matrixEPS0_PNS_8ae_stateE(i64 noundef %87, i64 noundef %10, ptr noundef nonnull %88, ptr noundef %2, ptr noundef %5)
  %89 = load i64, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %0, i64 1088
  tail call void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %89, ptr noundef nonnull %90, ptr noundef %3, ptr noundef %5)
  br label %91

91:                                               ; preds = %80, %86, %77
  ret void
}

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

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


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