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

; 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::dfreport" = type { %"class.alglib::_dfreport_owner.base", ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.alglib::integer_1d_array", %"class.alglib::real_1d_array" }
%"class.alglib::_dfreport_owner.base" = type <{ ptr, ptr, i8 }>
%"class.alglib::integer_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.1 }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%union.anon.1 = type { ptr }
%"class.alglib::real_1d_array" = type { %"class.alglib::ae_vector_wrapper.base", [7 x i8] }
%"class.alglib::_dfreport_owner" = type <{ ptr, ptr, i8, [7 x i8] }>
%"struct.alglib_impl::dfreport" = type { double, double, double, double, double, double, double, double, double, double, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector" }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6alglib8dfreportC2EPN11alglib_impl8dfreportE(ptr noundef nonnull align 8 dereferenceable(280) %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 @_ZN6alglib15_dfreport_ownerC2EPN11alglib_impl8dfreportE(ptr noundef nonnull align 8 dereferenceable(17) %7, ptr noundef %8)
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN6alglib8dfreportE, i32 0, i32 0, i32 2), ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds %"class.alglib::dfreport", ptr %7, i32 0, i32 1
  %10 = getelementptr inbounds %"class.alglib::_dfreport_owner", ptr %7, i32 0, i32 1
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  %12 = getelementptr inbounds %"struct.alglib_impl::dfreport", ptr %11, i32 0, i32 0
  store ptr %12, ptr %9, align 8, !tbaa !5
  %13 = getelementptr inbounds %"class.alglib::dfreport", ptr %7, i32 0, i32 2
  %14 = getelementptr inbounds %"class.alglib::_dfreport_owner", ptr %7, i32 0, i32 1
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = getelementptr inbounds %"struct.alglib_impl::dfreport", ptr %15, i32 0, i32 1
  store ptr %16, ptr %13, align 8, !tbaa !5
  %17 = getelementptr inbounds %"class.alglib::dfreport", ptr %7, i32 0, i32 3
  %18 = getelementptr inbounds %"class.alglib::_dfreport_owner", ptr %7, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = getelementptr inbounds %"struct.alglib_impl::dfreport", ptr %19, i32 0, i32 2
  store ptr %20, ptr %17, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.alglib::dfreport", ptr %7, i32 0, i32 4
  %22 = getelementptr inbounds %"class.alglib::_dfreport_owner", ptr %7, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds %"struct.alglib_impl::dfreport", ptr %23, i32 0, i32 3
  store ptr %24, ptr %21, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.alglib::dfreport", ptr %7, i32 0, i32 5
  %26 = getelementptr inbounds %"class.alglib::_dfreport_owner", ptr %7, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = getelementptr inbounds %"struct.alglib_impl::dfreport", ptr %27, i32 0, i32 4
  store ptr %28, ptr %25, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.alglib::dfreport", ptr %7, i32 0, i32 6
  %30 = getelementptr inbounds %"class.alglib::_dfreport_owner", ptr %7, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = getelementptr inbounds %"struct.alglib_impl::dfreport", ptr %31, i32 0, i32 5
  store ptr %32, ptr %29, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.alglib::dfreport", ptr %7, i32 0, i32 7
  %34 = getelementptr inbounds %"class.alglib::_dfreport_owner", ptr %7, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  %36 = getelementptr inbounds %"struct.alglib_impl::dfreport", ptr %35, i32 0, i32 6
  store ptr %36, ptr %33, align 8, !tbaa !5
  %37 = getelementptr inbounds %"class.alglib::dfreport", ptr %7, i32 0, i32 8
  %38 = getelementptr inbounds %"class.alglib::_dfreport_owner", ptr %7, i32 0, i32 1
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = getelementptr inbounds %"struct.alglib_impl::dfreport", ptr %39, i32 0, i32 7
  store ptr %40, ptr %37, align 8, !tbaa !5
  %41 = getelementptr inbounds %"class.alglib::dfreport", ptr %7, i32 0, i32 9
  %42 = getelementptr inbounds %"class.alglib::_dfreport_owner", ptr %7, i32 0, i32 1
  %43 = load ptr, ptr %42, align 8, !tbaa !11
  %44 = getelementptr inbounds %"struct.alglib_impl::dfreport", ptr %43, i32 0, i32 8
  store ptr %44, ptr %41, align 8, !tbaa !5
  %45 = getelementptr inbounds %"class.alglib::dfreport", ptr %7, i32 0, i32 10
  %46 = getelementptr inbounds %"class.alglib::_dfreport_owner", ptr %7, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !11
  %48 = getelementptr inbounds %"struct.alglib_impl::dfreport", ptr %47, i32 0, i32 9
  store ptr %48, ptr %45, align 8, !tbaa !5
  %49 = getelementptr inbounds %"class.alglib::dfreport", ptr %7, i32 0, i32 11
  %50 = getelementptr inbounds %"class.alglib::_dfreport_owner", ptr %7, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8, !tbaa !11
  %52 = getelementptr inbounds %"struct.alglib_impl::dfreport", ptr %51, i32 0, i32 10
  invoke void @_ZN6alglib16integer_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %49, ptr noundef %52)
          to label %53 unwind label %59

53:                                               ; preds = %2
  %54 = getelementptr inbounds %"class.alglib::dfreport", ptr %7, i32 0, i32 12
  %55 = getelementptr inbounds %"class.alglib::_dfreport_owner", ptr %7, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !11
  %57 = getelementptr inbounds %"struct.alglib_impl::dfreport", ptr %56, i32 0, i32 11
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %54, ptr noundef %57)
          to label %58 unwind label %63

58:                                               ; preds = %53
  ret void

59:                                               ; preds = %2
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %5, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %6, align 4
  br label %67

63:                                               ; preds = %53
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %5, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %6, align 4
  call void @_ZN6alglib16integer_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81) %49) #4
  br label %67

67:                                               ; preds = %63, %59
  call void @_ZN6alglib15_dfreport_ownerD2Ev(ptr noundef nonnull align 8 dereferenceable(17) %7) #4
  br label %68

68:                                               ; preds = %67
  %69 = load ptr, ptr %5, align 8
  %70 = load i32, ptr %6, align 4
  %71 = insertvalue { ptr, i32 } poison, ptr %69, 0
  %72 = insertvalue { ptr, i32 } %71, i32 %70, 1
  resume { ptr, i32 } %72
}

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 = !{!"_ZTSN6alglib15_dfreport_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"

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6alglib8dfreportC2EPN11alglib_impl8dfreportE(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN6alglib15_dfreport_ownerC2EPN11alglib_impl8dfreportE(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef %1)
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN6alglib8dfreportE, 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 i8, <4 x ptr> %8, <4 x i64> <i64 40, i64 48, i64 56, i64 64>
  store <4 x ptr> %11, ptr %10, align 8, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %0, i64 96
  %13 = getelementptr inbounds i8, ptr %5, i64 72
  store ptr %13, ptr %12, align 8, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %0, i64 104
  %15 = getelementptr inbounds i8, ptr %5, i64 80
  invoke void @_ZN6alglib16integer_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %14, ptr noundef nonnull %15)
          to label %16 unwind label %21

16:                                               ; preds = %2
  %17 = getelementptr inbounds i8, ptr %0, i64 192
  %18 = load ptr, ptr %4, align 8, !tbaa !8
  %19 = getelementptr inbounds i8, ptr %18, i64 144
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %17, ptr noundef nonnull %19)
          to label %20 unwind label %23

20:                                               ; preds = %16
  ret void

21:                                               ; preds = %2
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %25

23:                                               ; preds = %16
  %24 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN6alglib16integer_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81) %14) #4
  br label %25

25:                                               ; preds = %23, %21
  %.pn = phi { ptr, i32 } [ %24, %23 ], [ %22, %21 ]
  tail call void @_ZN6alglib15_dfreport_ownerD2Ev(ptr noundef nonnull align 8 dereferenceable(17) %0) #4
  resume { ptr, i32 } %.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 = !{!"_ZTSN6alglib15_dfreport_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