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

; 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::minlpreport" = type { %"class.alglib::_minlpreport_owner.base", ptr, %"class.alglib::real_1d_array", %"class.alglib::real_1d_array", %"class.alglib::real_1d_array", %"class.alglib::integer_1d_array", ptr, ptr, ptr, ptr, ptr }
%"class.alglib::_minlpreport_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::integer_1d_array" = type { %"class.alglib::ae_vector_wrapper.base", [7 x i8] }
%"class.alglib::_minlpreport_owner" = type <{ ptr, ptr, i8, [7 x i8] }>
%"struct.alglib_impl::minlpreport" = type { double, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", double, double, double, i64, i64 }

@_ZTVN6alglib11minlpreportE = 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 uwtable
declare dso_local void @_ZN6alglib18_minlpreport_ownerC2Ev(ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6alglib11minlpreportC2Ev(ptr noundef nonnull align 8 dereferenceable(424) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @_ZN6alglib18_minlpreport_ownerC2Ev(ptr noundef nonnull align 8 dereferenceable(17) %5)
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN6alglib11minlpreportE, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %"class.alglib::minlpreport", ptr %5, i32 0, i32 1
  %7 = getelementptr inbounds %"class.alglib::_minlpreport_owner", ptr %5, i32 0, i32 1
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  %9 = getelementptr inbounds %"struct.alglib_impl::minlpreport", ptr %8, i32 0, i32 0
  store ptr %9, ptr %6, align 8, !tbaa !5
  %10 = getelementptr inbounds %"class.alglib::minlpreport", ptr %5, i32 0, i32 2
  %11 = getelementptr inbounds %"class.alglib::_minlpreport_owner", ptr %5, i32 0, i32 1
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds %"struct.alglib_impl::minlpreport", ptr %12, i32 0, i32 1
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %10, ptr noundef %13)
          to label %14 unwind label %50

14:                                               ; preds = %1
  %15 = getelementptr inbounds %"class.alglib::minlpreport", ptr %5, i32 0, i32 3
  %16 = getelementptr inbounds %"class.alglib::_minlpreport_owner", ptr %5, i32 0, i32 1
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = getelementptr inbounds %"struct.alglib_impl::minlpreport", ptr %17, i32 0, i32 2
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %15, ptr noundef %18)
          to label %19 unwind label %54

19:                                               ; preds = %14
  %20 = getelementptr inbounds %"class.alglib::minlpreport", ptr %5, i32 0, i32 4
  %21 = getelementptr inbounds %"class.alglib::_minlpreport_owner", ptr %5, i32 0, i32 1
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = getelementptr inbounds %"struct.alglib_impl::minlpreport", ptr %22, i32 0, i32 3
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %20, ptr noundef %23)
          to label %24 unwind label %58

24:                                               ; preds = %19
  %25 = getelementptr inbounds %"class.alglib::minlpreport", ptr %5, i32 0, i32 5
  %26 = getelementptr inbounds %"class.alglib::_minlpreport_owner", ptr %5, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = getelementptr inbounds %"struct.alglib_impl::minlpreport", ptr %27, i32 0, i32 4
  invoke void @_ZN6alglib16integer_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %25, ptr noundef %28)
          to label %29 unwind label %62

29:                                               ; preds = %24
  %30 = getelementptr inbounds %"class.alglib::minlpreport", ptr %5, i32 0, i32 6
  %31 = getelementptr inbounds %"class.alglib::_minlpreport_owner", ptr %5, i32 0, i32 1
  %32 = load ptr, ptr %31, align 8, !tbaa !11
  %33 = getelementptr inbounds %"struct.alglib_impl::minlpreport", ptr %32, i32 0, i32 5
  store ptr %33, ptr %30, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.alglib::minlpreport", ptr %5, i32 0, i32 7
  %35 = getelementptr inbounds %"class.alglib::_minlpreport_owner", ptr %5, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds %"struct.alglib_impl::minlpreport", ptr %36, i32 0, i32 6
  store ptr %37, ptr %34, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.alglib::minlpreport", ptr %5, i32 0, i32 8
  %39 = getelementptr inbounds %"class.alglib::_minlpreport_owner", ptr %5, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = getelementptr inbounds %"struct.alglib_impl::minlpreport", ptr %40, i32 0, i32 7
  store ptr %41, ptr %38, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.alglib::minlpreport", ptr %5, i32 0, i32 9
  %43 = getelementptr inbounds %"class.alglib::_minlpreport_owner", ptr %5, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = getelementptr inbounds %"struct.alglib_impl::minlpreport", ptr %44, i32 0, i32 8
  store ptr %45, ptr %42, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.alglib::minlpreport", ptr %5, i32 0, i32 10
  %47 = getelementptr inbounds %"class.alglib::_minlpreport_owner", ptr %5, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !11
  %49 = getelementptr inbounds %"struct.alglib_impl::minlpreport", ptr %48, i32 0, i32 9
  store ptr %49, ptr %46, align 8, !tbaa !5
  ret void

50:                                               ; preds = %1
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %3, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %4, align 4
  br label %68

54:                                               ; preds = %14
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %3, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %4, align 4
  br label %67

58:                                               ; preds = %19
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %3, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %4, align 4
  br label %66

62:                                               ; preds = %24
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %3, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %4, align 4
  call void @_ZN6alglib13real_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81) %20) #4
  br label %66

66:                                               ; preds = %62, %58
  call void @_ZN6alglib13real_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81) %15) #4
  br label %67

67:                                               ; preds = %66, %54
  call void @_ZN6alglib13real_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81) %10) #4
  br label %68

68:                                               ; preds = %67, %50
  call void @_ZN6alglib18_minlpreport_ownerD2Ev(ptr noundef nonnull align 8 dereferenceable(17) %5) #4
  br label %69

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

declare void @_ZN6alglib16integer_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef) 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 = { 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 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 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 #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_minlpreport_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"

@_ZTVN6alglib11minlpreportE = 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 uwtable
declare dso_local void @_ZN6alglib18_minlpreport_ownerC2Ev(ptr noundef nonnull align 8 dereferenceable(17)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6alglib11minlpreportC2Ev(ptr noundef nonnull align 8 dereferenceable(424) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN6alglib18_minlpreport_ownerC2Ev(ptr noundef nonnull align 8 dereferenceable(17) %0)
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN6alglib11minlpreportE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load ptr, ptr %3, align 8, !tbaa !8
  store ptr %4, ptr %2, align 8, !tbaa !13
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  %6 = getelementptr inbounds i8, ptr %4, i64 8
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %5, ptr noundef nonnull %6)
          to label %7 unwind label %27

7:                                                ; preds = %1
  %8 = getelementptr inbounds i8, ptr %0, i64 120
  %9 = load ptr, ptr %3, align 8, !tbaa !8
  %10 = getelementptr inbounds i8, ptr %9, i64 72
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %8, ptr noundef nonnull %10)
          to label %11 unwind label %29

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %0, i64 208
  %13 = load ptr, ptr %3, align 8, !tbaa !8
  %14 = getelementptr inbounds i8, ptr %13, i64 136
  invoke void @_ZN6alglib13real_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %12, ptr noundef nonnull %14)
          to label %15 unwind label %31

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %0, i64 296
  %17 = load ptr, ptr %3, align 8, !tbaa !8
  %18 = getelementptr inbounds i8, ptr %17, i64 200
  invoke void @_ZN6alglib16integer_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81) %16, ptr noundef nonnull %18)
          to label %19 unwind label %33

19:                                               ; preds = %15
  %20 = getelementptr inbounds i8, ptr %0, i64 384
  %21 = load ptr, ptr %3, align 8, !tbaa !8
  %22 = insertelement <4 x ptr> poison, ptr %21, i64 0
  %23 = shufflevector <4 x ptr> %22, <4 x ptr> poison, <4 x i32> zeroinitializer
  %24 = getelementptr i8, <4 x ptr> %23, <4 x i64> <i64 264, i64 272, i64 280, i64 288>
  store <4 x ptr> %24, ptr %20, align 8, !tbaa !13
  %25 = getelementptr inbounds i8, ptr %0, i64 416
  %26 = getelementptr inbounds i8, ptr %21, i64 296
  store ptr %26, ptr %25, align 8, !tbaa !13
  ret void

27:                                               ; preds = %1
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %37

29:                                               ; preds = %7
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %36

31:                                               ; preds = %11
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %35

33:                                               ; preds = %15
  %34 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN6alglib13real_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81) %12) #4
  br label %35

35:                                               ; preds = %33, %31
  %.pn = phi { ptr, i32 } [ %34, %33 ], [ %32, %31 ]
  tail call void @_ZN6alglib13real_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81) %8) #4
  br label %36

36:                                               ; preds = %35, %29
  %.pn.pn = phi { ptr, i32 } [ %.pn, %35 ], [ %30, %29 ]
  tail call void @_ZN6alglib13real_1d_arrayD1Ev(ptr noundef nonnull align 8 dereferenceable(81) %5) #4
  br label %37

37:                                               ; preds = %36, %27
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %36 ], [ %28, %27 ]
  tail call void @_ZN6alglib18_minlpreport_ownerD2Ev(ptr noundef nonnull align 8 dereferenceable(17) %0) #4
  resume { ptr, i32 } %.pn.pn.pn
}

declare void @_ZN6alglib16integer_1d_arrayC1EPN11alglib_impl9ae_vectorE(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef) 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 = { 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 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 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 #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_minlpreport_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