; 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::qpxproblem" = type { i64, i8, double, i8, %"struct.alglib_impl::ae_vector", i8, %"struct.alglib_impl::ae_vector", i8, %"struct.alglib_impl::ae_vector", i8, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i8, %"struct.alglib_impl::sparsematrix", i8, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64, %"struct.alglib_impl::sparsematrix", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64, %"struct.alglib_impl::xquadraticconstraints", i64, %"struct.alglib_impl::sparsematrix" }
%"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 }
%"struct.alglib_impl::xquadraticconstraints" = type { i64, %"struct.alglib_impl::ae_obj_array", %"struct.alglib_impl::ae_vector" }
%"struct.alglib_impl::ae_obj_array" = type { i64, i64, i8, ptr, ptr, ptr, ptr, %"struct.alglib_impl::ae_lock", %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_lock" = type { ptr, %"struct.alglib_impl::ae_dyn_block", i8 }
%"struct.alglib_impl::sparsematrix" = type { %"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", i64, i64, i64, i64, i64, i64 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16qpxproblemgetlc2EPNS_10qpxproblemEPNS_12sparsematrixEPNS_9ae_vectorES5_PlPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #0 {
  %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
  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
  %13 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl19_sparsematrix_clearEPv(ptr noundef %13)
  %14 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %14)
  %15 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %15)
  %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::qpxproblem", ptr %17, i32 0, i32 17
  %19 = load i64, ptr %18, align 8, !tbaa !11
  %20 = icmp eq i64 %19, 0
  br i1 %20, label %21, label %23

21:                                               ; preds = %6
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 0, ptr %22, align 8, !tbaa !9
  br label %44

23:                                               ; preds = %6
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.alglib_impl::qpxproblem", ptr %24, i32 0, i32 17
  %26 = load i64, ptr %25, align 8, !tbaa !11
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 %26, ptr %27, align 8, !tbaa !9
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.alglib_impl::qpxproblem", ptr %28, i32 0, i32 18
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl13sparsecopybufEPKNS_12sparsematrixEPS0_PNS_8ae_stateE(ptr noundef %29, ptr noundef %30, ptr noundef %31)
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.alglib_impl::qpxproblem", ptr %34, i32 0, i32 19
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %33, ptr noundef %35, ptr noundef %36, ptr noundef %37)
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.alglib_impl::qpxproblem", ptr %40, i32 0, i32 20
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %39, ptr noundef %41, ptr noundef %42, ptr noundef %43)
  br label %44

44:                                               ; preds = %23, %21
  ret void
}

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) #1

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

declare void @_ZN11alglib_impl13sparsecopybufEPKNS_12sparsematrixEPS0_PNS_8ae_stateE(ptr noundef, ptr noundef, ptr noundef) #1

declare void @_ZN11alglib_impl19_sparsematrix_clearEPv(ptr noundef) #1

attributes #0 = { 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 #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" }

!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 888}
!12 = !{!"_ZTSN11alglib_impl10qpxproblemE", !10, i64 0, !13, i64 8, !14, i64 16, !13, i64 24, !15, i64 32, !13, i64 96, !15, i64 104, !13, i64 168, !15, i64 176, !13, i64 240, !15, i64 248, !15, i64 312, !13, i64 376, !17, i64 384, !13, i64 752, !15, i64 760, !15, i64 824, !10, i64 888, !17, i64 896, !15, i64 1264, !15, i64 1328, !10, i64 1392, !18, i64 1400, !10, i64 1608, !17, i64 1616}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"_ZTSN11alglib_impl9ae_vectorE", !10, i64 0, !10, i64 8, !13, i64 16, !16, i64 24, !7, i64 56}
!16 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!"_ZTSN11alglib_impl12sparsematrixE", !15, i64 0, !15, i64 64, !15, i64 128, !15, i64 192, !15, i64 256, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360}
!18 = !{!"_ZTSN11alglib_impl21xquadraticconstraintsE", !10, i64 0, !19, i64 8, !15, i64 144}
!19 = !{!"_ZTSN11alglib_impl12ae_obj_arrayE", !10, i64 0, !10, i64 8, !13, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !20, i64 56, !16, i64 104}
!20 = !{!"_ZTSN11alglib_impl7ae_lockE", !6, i64 0, !16, i64 8, !13, i64 40}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16qpxproblemgetlc2EPNS_10qpxproblemEPNS_12sparsematrixEPNS_9ae_vectorES5_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 #0 {
  tail call void @_ZN11alglib_impl19_sparsematrix_clearEPv(ptr noundef %1)
  tail call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %2)
  tail call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %3)
  store i64 0, ptr %4, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 888
  %8 = load i64, ptr %7, align 8, !tbaa !9
  %9 = icmp eq i64 %8, 0
  br i1 %9, label %16, label %10

10:                                               ; preds = %6
  store i64 %8, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 896
  tail call void @_ZN11alglib_impl13sparsecopybufEPKNS_12sparsematrixEPS0_PNS_8ae_stateE(ptr noundef nonnull %11, ptr noundef %1, ptr noundef %5)
  %12 = load i64, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 1264
  tail call void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %12, ptr noundef nonnull %13, ptr noundef %2, ptr noundef %5)
  %14 = load i64, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 1328
  tail call void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %14, ptr noundef nonnull %15, ptr noundef %3, ptr noundef %5)
  br label %16

16:                                               ; preds = %6, %10
  ret void
}

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) local_unnamed_addr #1

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

declare void @_ZN11alglib_impl13sparsecopybufEPKNS_12sparsematrixEPS0_PNS_8ae_stateE(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @_ZN11alglib_impl19_sparsematrix_clearEPv(ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #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" }

!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 888}
!10 = !{!"_ZTSN11alglib_impl10qpxproblemE", !6, i64 0, !11, i64 8, !12, i64 16, !11, i64 24, !13, i64 32, !11, i64 96, !13, i64 104, !11, i64 168, !13, i64 176, !11, i64 240, !13, i64 248, !13, i64 312, !11, i64 376, !16, i64 384, !11, i64 752, !13, i64 760, !13, i64 824, !6, i64 888, !16, i64 896, !13, i64 1264, !13, i64 1328, !6, i64 1392, !17, i64 1400, !6, i64 1608, !16, i64 1616}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"_ZTSN11alglib_impl9ae_vectorE", !6, i64 0, !6, i64 8, !11, i64 16, !14, i64 24, !7, i64 56}
!14 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"_ZTSN11alglib_impl12sparsematrixE", !13, i64 0, !13, i64 64, !13, i64 128, !13, i64 192, !13, i64 256, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360}
!17 = !{!"_ZTSN11alglib_impl21xquadraticconstraintsE", !6, i64 0, !18, i64 8, !13, i64 144}
!18 = !{!"_ZTSN11alglib_impl12ae_obj_arrayE", !6, i64 0, !6, i64 8, !11, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !19, i64 56, !14, i64 104}
!19 = !{!"_ZTSN11alglib_impl7ae_lockE", !15, i64 0, !14, i64 8, !11, i64 40}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass