; LLVM IR from venumb/ZSPACE :: cpp/depends/alglib/cpp/src (linalg)

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

declare void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !16, i64 320}
!14 = !{!"_ZTSN11alglib_impl12sparsematrixE", !15, i64 0, !15, i64 64, !15, i64 128, !15, i64 192, !15, i64 256, !16, i64 320, !16, i64 328, !16, i64 336, !16, i64 344, !16, i64 352, !16, i64 360}
!15 = !{!"_ZTSN11alglib_impl9ae_vectorE", !16, i64 0, !16, i64 8, !10, i64 16, !17, i64 24, !7, i64 56}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!14, !16, i64 328}
!19 = !{!14, !16, i64 336}
!20 = !{!14, !16, i64 344}
!21 = !{!14, !16, i64 352}
!22 = !{!14, !16, i64 360}


; 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_impl23_sparsematrix_init_copyEPvS0_PNS_8ae_stateEb(ptr noundef %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3) local_unnamed_addr #0 {
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3)
  %5 = getelementptr inbounds i8, ptr %0, i64 64
  %6 = getelementptr inbounds i8, ptr %1, i64 64
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef %2, i1 noundef zeroext %3)
  %7 = getelementptr inbounds i8, ptr %0, i64 128
  %8 = getelementptr inbounds i8, ptr %1, i64 128
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef %2, i1 noundef zeroext %3)
  %9 = getelementptr inbounds i8, ptr %0, i64 192
  %10 = getelementptr inbounds i8, ptr %1, i64 192
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef %2, i1 noundef zeroext %3)
  %11 = getelementptr inbounds i8, ptr %0, i64 256
  %12 = getelementptr inbounds i8, ptr %1, i64 256
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef %2, i1 noundef zeroext %3)
  %13 = getelementptr inbounds i8, ptr %1, i64 320
  %14 = getelementptr inbounds i8, ptr %0, i64 320
  %15 = load <2 x i64>, ptr %13, align 8, !tbaa !5
  store <2 x i64> %15, ptr %14, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %1, i64 336
  %17 = getelementptr inbounds i8, ptr %0, i64 336
  %18 = load <2 x i64>, ptr %16, align 8, !tbaa !5
  store <2 x i64> %18, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %1, i64 352
  %20 = getelementptr inbounds i8, ptr %0, i64 352
  %21 = load <2 x i64>, ptr %19, align 8, !tbaa !5
  store <2 x i64> %21, ptr %20, align 8, !tbaa !5
  ret void
}

declare void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) 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"}


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