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

; 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::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 }
%"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 }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl11icopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl13sparsecopybufEPKNS_12sparsematrixEPS0_PNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %7, i32 0, i32 5
  %9 = load i64, ptr %8, align 8, !tbaa !9
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %10, i32 0, i32 5
  store i64 %9, ptr %11, align 8, !tbaa !9
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %12, i32 0, i32 6
  %14 = load i64, ptr %13, align 8, !tbaa !15
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %15, i32 0, i32 6
  store i64 %14, ptr %16, align 8, !tbaa !15
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %17, i32 0, i32 7
  %19 = load i64, ptr %18, align 8, !tbaa !16
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %20, i32 0, i32 7
  store i64 %19, ptr %21, align 8, !tbaa !16
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %22, i32 0, i32 8
  %24 = load i64, ptr %23, align 8, !tbaa !17
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %25, i32 0, i32 8
  store i64 %24, ptr %26, align 8, !tbaa !17
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %27, i32 0, i32 9
  %29 = load i64, ptr %28, align 8, !tbaa !18
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %30, i32 0, i32 9
  store i64 %29, ptr %31, align 8, !tbaa !18
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %32, i32 0, i32 10
  %34 = load i64, ptr %33, align 8, !tbaa !19
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %35, i32 0, i32 10
  store i64 %34, ptr %36, align 8, !tbaa !19
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %37, i32 0, i32 2
  %39 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %38, i32 0, i32 0
  %40 = load i64, ptr %39, align 8, !tbaa !20
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %41, i32 0, i32 2
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %43, i32 0, i32 2
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl11icopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %40, ptr noundef %42, ptr noundef %44, ptr noundef %45)
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %46, i32 0, i32 1
  %48 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %47, i32 0, i32 0
  %49 = load i64, ptr %48, align 8, !tbaa !21
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl11icopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %49, ptr noundef %51, ptr noundef %53, ptr noundef %54)
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %56, i32 0, i32 0
  %58 = load i64, ptr %57, align 8, !tbaa !22
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %58, ptr noundef %60, ptr noundef %62, ptr noundef %63)
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %64, i32 0, i32 3
  %66 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %65, i32 0, i32 0
  %67 = load i64, ptr %66, align 8, !tbaa !23
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %68, i32 0, i32 3
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %70, i32 0, i32 3
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl11icopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %67, ptr noundef %69, ptr noundef %71, ptr noundef %72)
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %73, i32 0, i32 4
  %75 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %74, i32 0, i32 0
  %76 = load i64, ptr %75, align 8, !tbaa !24
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %77, i32 0, i32 4
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.alglib_impl::sparsematrix", ptr %79, i32 0, i32 4
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl11icopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %76, ptr noundef %78, ptr noundef %80, ptr noundef %81)
  ret void
}

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

!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, !12, i64 320}
!10 = !{!"_ZTSN11alglib_impl12sparsematrixE", !11, i64 0, !11, i64 64, !11, i64 128, !11, i64 192, !11, i64 256, !12, i64 320, !12, i64 328, !12, i64 336, !12, i64 344, !12, i64 352, !12, i64 360}
!11 = !{!"_ZTSN11alglib_impl9ae_vectorE", !12, i64 0, !12, i64 8, !13, i64 16, !14, i64 24, !7, i64 56}
!12 = !{!"long", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!10, !12, i64 328}
!16 = !{!10, !12, i64 336}
!17 = !{!10, !12, i64 344}
!18 = !{!10, !12, i64 352}
!19 = !{!10, !12, i64 360}
!20 = !{!10, !12, i64 128}
!21 = !{!10, !12, i64 64}
!22 = !{!10, !12, i64 0}
!23 = !{!10, !12, i64 192}
!24 = !{!10, !12, i64 256}


; 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
declare dso_local void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl11icopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl13sparsecopybufEPKNS_12sparsematrixEPS0_PNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 320
  %5 = getelementptr inbounds i8, ptr %1, i64 320
  %6 = load <2 x i64>, ptr %4, align 8, !tbaa !5
  store <2 x i64> %6, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 336
  %8 = getelementptr inbounds i8, ptr %1, i64 336
  %9 = load <2 x i64>, ptr %7, align 8, !tbaa !5
  store <2 x i64> %9, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 352
  %11 = getelementptr inbounds i8, ptr %1, i64 352
  %12 = load <2 x i64>, ptr %10, align 8, !tbaa !5
  store <2 x i64> %12, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 128
  %14 = load i64, ptr %13, align 8, !tbaa !9
  %15 = getelementptr inbounds i8, ptr %1, i64 128
  tail call void @_ZN11alglib_impl11icopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %14, ptr noundef nonnull %13, ptr noundef nonnull %15, ptr noundef %2)
  %16 = getelementptr inbounds i8, ptr %0, i64 64
  %17 = load i64, ptr %16, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %1, i64 64
  tail call void @_ZN11alglib_impl11icopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %17, ptr noundef nonnull %16, ptr noundef nonnull %18, ptr noundef %2)
  %19 = load i64, ptr %0, align 8, !tbaa !16
  tail call void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %19, ptr noundef nonnull %0, ptr noundef %1, ptr noundef %2)
  %20 = getelementptr inbounds i8, ptr %0, i64 192
  %21 = load i64, ptr %20, align 8, !tbaa !17
  %22 = getelementptr inbounds i8, ptr %1, i64 192
  tail call void @_ZN11alglib_impl11icopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %21, ptr noundef nonnull %20, ptr noundef nonnull %22, ptr noundef %2)
  %23 = getelementptr inbounds i8, ptr %0, i64 256
  %24 = load i64, ptr %23, align 8, !tbaa !18
  %25 = getelementptr inbounds i8, ptr %1, i64 256
  tail call void @_ZN11alglib_impl11icopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %24, ptr noundef nonnull %23, ptr noundef nonnull %25, ptr noundef %2)
  ret void
}

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

!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 128}
!10 = !{!"_ZTSN11alglib_impl12sparsematrixE", !11, i64 0, !11, i64 64, !11, i64 128, !11, i64 192, !11, i64 256, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360}
!11 = !{!"_ZTSN11alglib_impl9ae_vectorE", !6, i64 0, !6, i64 8, !12, i64 16, !13, i64 24, !7, i64 56}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!10, !6, i64 64}
!16 = !{!10, !6, i64 0}
!17 = !{!10, !6, i64 192}
!18 = !{!10, !6, i64 256}


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