; 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.292 = external hidden unnamed_addr constant [49 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: mustprogress uwtable
declare hidden void @_ZN11alglib_implL25optserv_resetlowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl17hessianmultiplybyEPNS_12xbfgshessianEdPNS_8ae_stateE(ptr noundef %0, double noundef %1, ptr noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %10, i32 0, i32 0
  %12 = load i64, ptr %11, align 8, !tbaa !11
  %13 = icmp eq i64 %12, 0
  br i1 %13, label %24, label %14

14:                                               ; preds = %3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %15, i32 0, i32 0
  %17 = load i64, ptr %16, align 8, !tbaa !11
  %18 = icmp eq i64 %17, 3
  br i1 %18, label %24, label %19

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

24:                                               ; preds = %19, %14, %3
  %25 = phi i1 [ true, %14 ], [ true, %3 ], [ %23, %19 ]
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %25, ptr noundef @.str.292, ptr noundef %26)
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %27, i32 0, i32 3
  %29 = load i64, ptr %28, align 8, !tbaa !18
  store i64 %29, ptr %9, align 8, !tbaa !19
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %30, i32 0, i32 0
  %32 = load i64, ptr %31, align 8, !tbaa !11
  %33 = icmp eq i64 %32, 0
  br i1 %33, label %34, label %97

34:                                               ; preds = %24
  store i64 0, ptr %7, align 8, !tbaa !19
  br label %35

35:                                               ; preds = %93, %34
  %36 = load i64, ptr %7, align 8, !tbaa !19
  %37 = load i64, ptr %9, align 8, !tbaa !19
  %38 = sub nsw i64 %37, 1
  %39 = icmp sle i64 %36, %38
  br i1 %39, label %40, label %96

40:                                               ; preds = %35
  store i64 0, ptr %8, align 8, !tbaa !19
  br label %41

41:                                               ; preds = %89, %40
  %42 = load i64, ptr %8, align 8, !tbaa !19
  %43 = load i64, ptr %9, align 8, !tbaa !19
  %44 = sub nsw i64 %43, 1
  %45 = icmp sle i64 %42, %44
  br i1 %45, label %46, label %92

46:                                               ; preds = %41
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %47, i32 0, i32 15
  %49 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %48, i32 0, i32 6
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  %51 = load i64, ptr %7, align 8, !tbaa !19
  %52 = getelementptr inbounds ptr, ptr %50, i64 %51
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = load i64, ptr %8, align 8, !tbaa !19
  %55 = getelementptr inbounds double, ptr %53, i64 %54
  %56 = load double, ptr %55, align 8, !tbaa !9
  %57 = load double, ptr %5, align 8, !tbaa !9
  %58 = fmul double %56, %57
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %59, i32 0, i32 15
  %61 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %60, i32 0, i32 6
  %62 = load ptr, ptr %61, align 8, !tbaa !20
  %63 = load i64, ptr %7, align 8, !tbaa !19
  %64 = getelementptr inbounds ptr, ptr %62, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = load i64, ptr %8, align 8, !tbaa !19
  %67 = getelementptr inbounds double, ptr %65, i64 %66
  store double %58, ptr %67, align 8, !tbaa !9
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %68, i32 0, i32 45
  %70 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %69, i32 0, i32 6
  %71 = load ptr, ptr %70, align 8, !tbaa !20
  %72 = load i64, ptr %7, align 8, !tbaa !19
  %73 = getelementptr inbounds ptr, ptr %71, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = load i64, ptr %8, align 8, !tbaa !19
  %76 = getelementptr inbounds double, ptr %74, i64 %75
  %77 = load double, ptr %76, align 8, !tbaa !9
  %78 = load double, ptr %5, align 8, !tbaa !9
  %79 = fmul double %77, %78
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %80, i32 0, i32 45
  %82 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %81, i32 0, i32 6
  %83 = load ptr, ptr %82, align 8, !tbaa !20
  %84 = load i64, ptr %7, align 8, !tbaa !19
  %85 = getelementptr inbounds ptr, ptr %83, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = load i64, ptr %8, align 8, !tbaa !19
  %88 = getelementptr inbounds double, ptr %86, i64 %87
  store double %79, ptr %88, align 8, !tbaa !9
  br label %89

89:                                               ; preds = %46
  %90 = load i64, ptr %8, align 8, !tbaa !19
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr %8, align 8, !tbaa !19
  br label %41, !llvm.loop !21

92:                                               ; preds = %41
  br label %93

93:                                               ; preds = %92
  %94 = load i64, ptr %7, align 8, !tbaa !19
  %95 = add nsw i64 %94, 1
  store i64 %95, ptr %7, align 8, !tbaa !19
  br label %35, !llvm.loop !23

96:                                               ; preds = %35
  br label %97

97:                                               ; preds = %96, %24
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %98, i32 0, i32 0
  %100 = load i64, ptr %99, align 8, !tbaa !11
  %101 = icmp eq i64 %100, 3
  br i1 %101, label %102, label %138

102:                                              ; preds = %97
  %103 = load double, ptr %5, align 8, !tbaa !9
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %104, i32 0, i32 21
  %106 = load double, ptr %105, align 8, !tbaa !24
  %107 = fmul double %103, %106
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %108, i32 0, i32 21
  store double %107, ptr %109, align 8, !tbaa !24
  store i64 0, ptr %7, align 8, !tbaa !19
  br label %110

110:                                              ; preds = %132, %102
  %111 = load i64, ptr %7, align 8, !tbaa !19
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %112, i32 0, i32 20
  %114 = load i64, ptr %113, align 8, !tbaa !25
  %115 = sub nsw i64 %114, 1
  %116 = icmp sle i64 %111, %115
  br i1 %116, label %117, label %135

117:                                              ; preds = %110
  %118 = load i64, ptr %9, align 8, !tbaa !19
  %119 = load double, ptr %5, align 8, !tbaa !9
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %120, i32 0, i32 23
  %122 = load i64, ptr %7, align 8, !tbaa !19
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %118, double noundef %119, ptr noundef %121, i64 noundef %122, ptr noundef %123)
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %124, i32 0, i32 20
  %126 = load i64, ptr %125, align 8, !tbaa !25
  %127 = load double, ptr %5, align 8, !tbaa !9
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %128, i32 0, i32 25
  %130 = load i64, ptr %7, align 8, !tbaa !19
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %126, double noundef %127, ptr noundef %129, i64 noundef %130, ptr noundef %131)
  br label %132

132:                                              ; preds = %117
  %133 = load i64, ptr %7, align 8, !tbaa !19
  %134 = add nsw i64 %133, 1
  store i64 %134, ptr %7, align 8, !tbaa !19
  br label %110, !llvm.loop !26

135:                                              ; preds = %110
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_implL25optserv_resetlowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef %136, ptr noundef %137)
  br label %138

138:                                              ; preds = %135, %97
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %139, i32 0, i32 0
  %141 = load i64, ptr %140, align 8, !tbaa !11
  %142 = icmp eq i64 %141, 4
  br i1 %142, label %143, label %164

143:                                              ; preds = %138
  store i64 0, ptr %7, align 8, !tbaa !19
  br label %144

144:                                              ; preds = %158, %143
  %145 = load i64, ptr %7, align 8, !tbaa !19
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %146, i32 0, i32 20
  %148 = load i64, ptr %147, align 8, !tbaa !25
  %149 = sub nsw i64 %148, 1
  %150 = icmp sle i64 %145, %149
  br i1 %150, label %151, label %161

151:                                              ; preds = %144
  %152 = load i64, ptr %9, align 8, !tbaa !19
  %153 = load double, ptr %5, align 8, !tbaa !9
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %"struct.alglib_impl::xbfgshessian", ptr %154, i32 0, i32 23
  %156 = load i64, ptr %7, align 8, !tbaa !19
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %152, double noundef %153, ptr noundef %155, i64 noundef %156, ptr noundef %157)
  br label %158

158:                                              ; preds = %151
  %159 = load i64, ptr %7, align 8, !tbaa !19
  %160 = add nsw i64 %159, 1
  store i64 %160, ptr %7, align 8, !tbaa !19
  br label %144, !llvm.loop !27

161:                                              ; preds = %144
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_implL25optserv_resetlowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef %162, ptr noundef %163)
  br label %164

164:                                              ; preds = %161, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void
}

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


; 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.292 = external hidden unnamed_addr constant [49 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 uwtable
declare hidden void @_ZN11alglib_implL25optserv_resetlowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl17hessianmultiplybyEPNS_12xbfgshessianEdPNS_8ae_stateE(ptr noundef %0, double noundef %1, ptr noundef %2) local_unnamed_addr #1 {
switch.edge:
  %3 = load i64, ptr %0, align 8, !tbaa !5
  %4 = icmp ult i64 %3, 5
  %switch.cast = trunc i64 %3 to i5
  %switch.downshift = lshr i5 -7, %switch.cast
  %switch.masked = trunc i5 %switch.downshift to i1
  %5 = select i1 %4, i1 %switch.masked, i1 false
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %5, ptr noundef nonnull @.str.292, ptr noundef %2)
  %6 = getelementptr inbounds i8, ptr %0, i64 136
  %7 = load i64, ptr %6, align 8, !tbaa !16
  %8 = load i64, ptr %0, align 8, !tbaa !5
  switch i64 %8, label %._crit_edge67 [
    i64 0, label %.preheader62
    i64 3, label %51
  ]

.preheader62:                                     ; preds = %switch.edge
  %.not.not65 = icmp sgt i64 %7, 0
  br i1 %.not.not65, label %.preheader61.lr.ph, label %._crit_edge67.thread

.preheader61.lr.ph:                               ; preds = %.preheader62
  %9 = getelementptr inbounds i8, ptr %0, i64 304
  %10 = getelementptr inbounds i8, ptr %0, i64 1528
  %xtraiter = and i64 %7, 1
  %11 = icmp eq i64 %7, 1
  %unroll_iter = and i64 %7, 9223372036854775806
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader61.us

.preheader61.us:                                  ; preds = %._crit_edge.us, %.preheader61.lr.ph
  %.066.us = phi i64 [ 0, %.preheader61.lr.ph ], [ %50, %._crit_edge.us ]
  br i1 %11, label %._crit_edge.us.unr-lcssa, label %.preheader61.us.new

.preheader61.us.new:                              ; preds = %.preheader61.us, %.preheader61.us.new
  %.05564.us = phi i64 [ %37, %.preheader61.us.new ], [ 0, %.preheader61.us ]
  %niter = phi i64 [ %niter.next.1, %.preheader61.us.new ], [ 0, %.preheader61.us ]
  %12 = load ptr, ptr %9, align 8, !tbaa !17
  %13 = getelementptr inbounds ptr, ptr %12, i64 %.066.us
  %14 = load ptr, ptr %13, align 8, !tbaa !18
  %15 = getelementptr inbounds double, ptr %14, i64 %.05564.us
  %16 = load double, ptr %15, align 8, !tbaa !19
  %17 = fmul double %16, %1
  store double %17, ptr %15, align 8, !tbaa !19
  %18 = load ptr, ptr %10, align 8, !tbaa !17
  %19 = getelementptr inbounds ptr, ptr %18, i64 %.066.us
  %20 = load ptr, ptr %19, align 8, !tbaa !18
  %21 = getelementptr inbounds double, ptr %20, i64 %.05564.us
  %22 = load double, ptr %21, align 8, !tbaa !19
  %23 = fmul double %22, %1
  store double %23, ptr %21, align 8, !tbaa !19
  %24 = or disjoint i64 %.05564.us, 1
  %25 = load ptr, ptr %9, align 8, !tbaa !17
  %26 = getelementptr inbounds ptr, ptr %25, i64 %.066.us
  %27 = load ptr, ptr %26, align 8, !tbaa !18
  %28 = getelementptr inbounds double, ptr %27, i64 %24
  %29 = load double, ptr %28, align 8, !tbaa !19
  %30 = fmul double %29, %1
  store double %30, ptr %28, align 8, !tbaa !19
  %31 = load ptr, ptr %10, align 8, !tbaa !17
  %32 = getelementptr inbounds ptr, ptr %31, i64 %.066.us
  %33 = load ptr, ptr %32, align 8, !tbaa !18
  %34 = getelementptr inbounds double, ptr %33, i64 %24
  %35 = load double, ptr %34, align 8, !tbaa !19
  %36 = fmul double %35, %1
  store double %36, ptr %34, align 8, !tbaa !19
  %37 = add nuw nsw i64 %.05564.us, 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 %._crit_edge.us.unr-lcssa, label %.preheader61.us.new, !llvm.loop !20

._crit_edge.us.unr-lcssa:                         ; preds = %.preheader61.us.new, %.preheader61.us
  %.05564.us.unr = phi i64 [ 0, %.preheader61.us ], [ %37, %.preheader61.us.new ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %._crit_edge.us.epilog-lcssa

._crit_edge.us.epilog-lcssa:                      ; preds = %._crit_edge.us.unr-lcssa
  %38 = load ptr, ptr %9, align 8, !tbaa !17
  %39 = getelementptr inbounds ptr, ptr %38, i64 %.066.us
  %40 = load ptr, ptr %39, align 8, !tbaa !18
  %41 = getelementptr inbounds double, ptr %40, i64 %.05564.us.unr
  %42 = load double, ptr %41, align 8, !tbaa !19
  %43 = fmul double %42, %1
  store double %43, ptr %41, align 8, !tbaa !19
  %44 = load ptr, ptr %10, align 8, !tbaa !17
  %45 = getelementptr inbounds ptr, ptr %44, i64 %.066.us
  %46 = load ptr, ptr %45, align 8, !tbaa !18
  %47 = getelementptr inbounds double, ptr %46, i64 %.05564.us.unr
  %48 = load double, ptr %47, align 8, !tbaa !19
  %49 = fmul double %48, %1
  store double %49, ptr %47, align 8, !tbaa !19
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %._crit_edge.us.unr-lcssa, %._crit_edge.us.epilog-lcssa
  %50 = add nuw nsw i64 %.066.us, 1
  %exitcond74.not = icmp eq i64 %50, %7
  br i1 %exitcond74.not, label %._crit_edge67.thread, label %.preheader61.us, !llvm.loop !22

51:                                               ; preds = %switch.edge
  %52 = getelementptr inbounds i8, ptr %0, i64 352
  %53 = load double, ptr %52, align 8, !tbaa !23
  %54 = fmul double %53, %1
  store double %54, ptr %52, align 8, !tbaa !23
  %55 = getelementptr inbounds i8, ptr %0, i64 344
  %56 = load i64, ptr %55, align 8, !tbaa !24
  %.not.not5868 = icmp sgt i64 %56, 0
  br i1 %.not.not5868, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %51
  %57 = getelementptr inbounds i8, ptr %0, i64 440
  %58 = getelementptr inbounds i8, ptr %0, i64 600
  br label %59

59:                                               ; preds = %.lr.ph, %59
  %.169 = phi i64 [ 0, %.lr.ph ], [ %61, %59 ]
  tail call void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %7, double noundef %1, ptr noundef nonnull %57, i64 noundef %.169, ptr noundef %2)
  %60 = load i64, ptr %55, align 8, !tbaa !24
  tail call void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %60, double noundef %1, ptr noundef nonnull %58, i64 noundef %.169, ptr noundef %2)
  %61 = add nuw nsw i64 %.169, 1
  %62 = load i64, ptr %55, align 8, !tbaa !24
  %.not.not58 = icmp slt i64 %61, %62
  br i1 %.not.not58, label %59, label %._crit_edge, !llvm.loop !25

._crit_edge:                                      ; preds = %59, %51
  tail call void @_ZN11alglib_implL25optserv_resetlowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef nonnull %0, ptr noundef %2)
  %.pre = load i64, ptr %0, align 8, !tbaa !5
  br label %._crit_edge67

._crit_edge67:                                    ; preds = %switch.edge, %._crit_edge
  %63 = phi i64 [ %8, %switch.edge ], [ %.pre, %._crit_edge ]
  %64 = icmp eq i64 %63, 4
  br i1 %64, label %.preheader, label %._crit_edge67.thread

.preheader:                                       ; preds = %._crit_edge67
  %65 = getelementptr inbounds i8, ptr %0, i64 344
  %66 = load i64, ptr %65, align 8, !tbaa !24
  %.not.not5970 = icmp sgt i64 %66, 0
  br i1 %.not.not5970, label %.lr.ph72, label %._crit_edge73

.lr.ph72:                                         ; preds = %.preheader
  %67 = getelementptr inbounds i8, ptr %0, i64 440
  br label %68

68:                                               ; preds = %.lr.ph72, %68
  %.271 = phi i64 [ 0, %.lr.ph72 ], [ %69, %68 ]
  tail call void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef %7, double noundef %1, ptr noundef nonnull %67, i64 noundef %.271, ptr noundef %2)
  %69 = add nuw nsw i64 %.271, 1
  %70 = load i64, ptr %65, align 8, !tbaa !24
  %.not.not59 = icmp slt i64 %69, %70
  br i1 %.not.not59, label %68, label %._crit_edge73, !llvm.loop !26

._crit_edge73:                                    ; preds = %68, %.preheader
  tail call void @_ZN11alglib_implL25optserv_resetlowrankmodelEPNS_12xbfgshessianEPNS_8ae_stateE(ptr noundef nonnull %0, ptr noundef %2)
  br label %._crit_edge67.thread

._crit_edge67.thread:                             ; preds = %._crit_edge.us, %.preheader62, %._crit_edge73, %._crit_edge67
  ret void
}

declare void @_ZN11alglib_impl5rmulrEldPNS_9ae_matrixElPNS_8ae_stateE(i64 noundef, double noundef, ptr noundef, 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 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 = !{!13, !13, i64 0}
!19 = !{!14, !14, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = !{!6, !14, i64 352}
!24 = !{!6, !7, i64 344}
!25 = distinct !{!25, !21}
!26 = distinct !{!26, !21}


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