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

; 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"

%"class.alglib::minqpreport" = type { %"class.alglib::_minqpreport_owner.base", ptr, ptr, ptr, ptr, ptr, ptr, %"class.alglib::real_1d_array", %"class.alglib::real_1d_array", %"class.alglib::real_1d_array" }
%"class.alglib::_minqpreport_owner.base" = type <{ ptr, ptr, i8 }>
%"class.alglib::real_1d_array" = type { %"class.alglib::ae_vector_wrapper.base", [7 x i8] }
%"class.alglib::ae_vector_wrapper.base" = type <{ ptr, ptr, %"struct.alglib_impl::ae_vector", i8 }>
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%union.anon.0 = type { ptr }
%"class.alglib::_minqpreport_owner" = type <{ ptr, ptr, i8, [7 x i8] }>
%"struct.alglib_impl::minqpreport" = type { i64, i64, i64, i64, i64, double, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector" }

@_ZTVN6alglib11minqpreportE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

declare void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef) unnamed_addr #0

; Function Attrs: nounwind
declare void @_ZN6alglib13real_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81)) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6alglib18_minqpreport_ownerC2EPN11alglib_impl11minqpreportE(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6alglib18_minqpreport_ownerD2Ev(ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6alglib11minqpreportC2EPN11alglib_impl11minqpreportE(ptr noundef nonnull align 8 dereferenceable(336) %0, ptr noundef %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN6alglib18_minqpreport_ownerC2EPN11alglib_impl11minqpreportE(ptr noundef nonnull align 8 dereferenceable(17) %7, ptr noundef %8)
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN6alglib11minqpreportE, i32 0, i32 0, i32 2), ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds %"class.alglib::minqpreport", ptr %7, i32 0, i32 1
  %10 = getelementptr inbounds %"class.alglib::_minqpreport_owner", ptr %7, i32 0, i32 1
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  %12 = getelementptr inbounds %"struct.alglib_impl::minqpreport", ptr %11, i32 0, i32 0
  store ptr %12, ptr %9, align 8, !tbaa !5
  %13 = getelementptr inbounds %"class.alglib::minqpreport", ptr %7, i32 0, i32 2
  %14 = getelementptr inbounds %"class.alglib::_minqpreport_owner", ptr %7, i32 0, i32 1
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = getelementptr inbounds %"struct.alglib_impl::minqpreport", ptr %15, i32 0, i32 1
  store ptr %16, ptr %13, align 8, !tbaa !5
  %17 = getelementptr inbounds %"class.alglib::minqpreport", ptr %7, i32 0, i32 3
  %18 = getelementptr inbounds %"class.alglib::_minqpreport_owner", ptr %7, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = getelementptr inbounds %"struct.alglib_impl::minqpreport", ptr %19, i32 0, i32 2
  store ptr %20, ptr %17, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.alglib::minqpreport", ptr %7, i32 0, i32 4
  %22 = getelementptr inbounds %"class.alglib::_minqpreport_owner", ptr %7, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds %"struct.alglib_impl::minqpreport", ptr %23, i32 0, i32 3
  store ptr %24, ptr %21, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.alglib::minqpreport", ptr %7, i32 0, i32 5
  %26 = getelementptr inbounds %"class.alglib::_minqpreport_owner", ptr %7, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = getelementptr inbounds %"struct.alglib_impl::minqpreport", ptr %27, i32 0, i32 4
  store ptr %28, ptr %25, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.alglib::minqpreport", ptr %7, i32 0, i32 6
  %30 = getelementptr inbounds %"class.alglib::_minqpreport_owner", ptr %7, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = getelementptr inbounds %"struct.alglib_impl::minqpreport", ptr %31, i32 0, i32 5
  store ptr %32, ptr %29, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.alglib::minqpreport", ptr %7, i32 0, i32 7
  %34 = getelementptr inbounds %"class.alglib::_minqpreport_owner", ptr %7, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  %36 = getelementptr inbounds %"struct.alglib_impl::minqpreport", ptr %35, i32 0, i32 6
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %33, ptr noundef %36)
          to label %37 unwind label %48

37:                                               ; preds = %2
  %38 = getelementptr inbounds %"class.alglib::minqpreport", ptr %7, i32 0, i32 8
  %39 = getelementptr inbounds %"class.alglib::_minqpreport_owner", ptr %7, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = getelementptr inbounds %"struct.alglib_impl::minqpreport", ptr %40, i32 0, i32 7
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %38, ptr noundef %41)
          to label %42 unwind label %52

42:                                               ; preds = %37
  %43 = getelementptr inbounds %"class.alglib::minqpreport", ptr %7, i32 0, i32 9
  %44 = getelementptr inbounds %"class.alglib::_minqpreport_owner", ptr %7, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !11
  %46 = getelementptr inbounds %"struct.alglib_impl::minqpreport", ptr %45, i32 0, i32 8
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %43, ptr noundef %46)
          to label %47 unwind label %56

47:                                               ; preds = %42
  ret void

48:                                               ; preds = %2
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %5, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %6, align 4
  br label %61

52:                                               ; preds = %37
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %5, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %6, align 4
  br label %60

56:                                               ; preds = %42
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %5, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %6, align 4
  call void @_ZN6alglib13real_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81) %38) #4
  br label %60

60:                                               ; preds = %56, %52
  call void @_ZN6alglib13real_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81) %33) #4
  br label %61

61:                                               ; preds = %60, %48
  call void @_ZN6alglib18_minqpreport_ownerD2Ev(ptr noundef nonnull align 8 dereferenceable(17) %7) #4
  br label %62

62:                                               ; preds = %61
  %63 = load ptr, ptr %5, align 8
  %64 = load i32, ptr %6, align 4
  %65 = insertvalue { ptr, i32 } poison, ptr %63, 0
  %66 = insertvalue { ptr, i32 } %65, i32 %64, 1
  resume { ptr, i32 } %66
}

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 = { nounwind "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 nounwind 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 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTSN6alglib18_minqpreport_ownerE", !6, i64 8, !13, i64 16}
!13 = !{!"bool", !7, i64 0}


; 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"

@_ZTVN6alglib11minqpreportE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

declare void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef) unnamed_addr #0

; Function Attrs: nounwind
declare void @_ZN6alglib13real_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81)) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6alglib18_minqpreport_ownerC2EPN11alglib_impl11minqpreportE(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6alglib18_minqpreport_ownerD2Ev(ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6alglib11minqpreportC2EPN11alglib_impl11minqpreportE(ptr noundef nonnull align 8 dereferenceable(336) %0, ptr noundef %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN6alglib18_minqpreport_ownerC2EPN11alglib_impl11minqpreportE(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef %1)
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN6alglib11minqpreportE, i64 16), ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = load ptr, ptr %4, align 8, !tbaa !8
  store ptr %5, ptr %3, align 8, !tbaa !13
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = insertelement <4 x ptr> poison, ptr %5, i64 0
  %8 = shufflevector <4 x ptr> %7, <4 x ptr> poison, <4 x i32> zeroinitializer
  %9 = getelementptr i8, <4 x ptr> %8, <4 x i64> <i64 8, i64 16, i64 24, i64 32>
  store <4 x ptr> %9, ptr %6, align 8, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %0, i64 64
  %11 = getelementptr inbounds i8, ptr %5, i64 40
  store ptr %11, ptr %10, align 8, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %0, i64 72
  %13 = getelementptr inbounds i8, ptr %5, i64 48
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %12, ptr noundef nonnull %13)
          to label %14 unwind label %23

14:                                               ; preds = %2
  %15 = getelementptr inbounds i8, ptr %0, i64 160
  %16 = load ptr, ptr %4, align 8, !tbaa !8
  %17 = getelementptr inbounds i8, ptr %16, i64 112
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %15, ptr noundef nonnull %17)
          to label %18 unwind label %25

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 248
  %20 = load ptr, ptr %4, align 8, !tbaa !8
  %21 = getelementptr inbounds i8, ptr %20, i64 176
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %19, ptr noundef nonnull %21)
          to label %22 unwind label %27

22:                                               ; preds = %18
  ret void

23:                                               ; preds = %2
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %30

25:                                               ; preds = %14
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %29

27:                                               ; preds = %18
  %28 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN6alglib13real_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81) %15) #4
  br label %29

29:                                               ; preds = %27, %25
  %.pn = phi { ptr, i32 } [ %28, %27 ], [ %26, %25 ]
  tail call void @_ZN6alglib13real_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81) %12) #4
  br label %30

30:                                               ; preds = %29, %23
  %.pn.pn = phi { ptr, i32 } [ %.pn, %29 ], [ %24, %23 ]
  tail call void @_ZN6alglib18_minqpreport_ownerD2Ev(ptr noundef nonnull align 8 dereferenceable(17) %0) #4
  resume { ptr, i32 } %.pn.pn
}

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 = { nounwind "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 nounwind 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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !10, i64 8}
!9 = !{!"_ZTSN6alglib18_minqpreport_ownerE", !10, i64 8, !12, i64 16}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"bool", !11, i64 0}
!13 = !{!10, !10, i64 0}


; Effective O3 passes: EarlyCSEPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass