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

; 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::clusterizerstate" = type { i64, i64, i64, %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_matrix", i64, i64, i64, i64, i8, i64, %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::apbuffers", %"struct.alglib_impl::kmeansbuffers" }
%"struct.alglib_impl::ae_matrix" = type { i64, i64, 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::apbuffers" = 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", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_matrix" }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%union.anon.1 = type { ptr }
%"struct.alglib_impl::kmeansbuffers" = type { %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::apbuffers", %"struct.alglib_impl::ae_shared_pool" }
%"struct.alglib_impl::ae_shared_pool" = type { %"struct.alglib_impl::ae_lock", ptr, ptr, ptr, ptr, i64, ptr, ptr, ptr, %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_lock" = type { ptr, %"struct.alglib_impl::ae_dyn_block", i8 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl17clusterizercreateEPNS_16clusterizerstateEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN11alglib_impl23_clusterizerstate_clearEPv(ptr noundef %5)
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = getelementptr inbounds %"struct.alglib_impl::clusterizerstate", ptr %6, i32 0, i32 0
  store i64 0, ptr %7, align 8, !tbaa !9
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %"struct.alglib_impl::clusterizerstate", ptr %8, i32 0, i32 1
  store i64 0, ptr %9, align 8, !tbaa !20
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = getelementptr inbounds %"struct.alglib_impl::clusterizerstate", ptr %10, i32 0, i32 2
  store i64 2, ptr %11, align 8, !tbaa !21
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %"struct.alglib_impl::clusterizerstate", ptr %12, i32 0, i32 5
  store i64 0, ptr %13, align 8, !tbaa !22
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %"struct.alglib_impl::clusterizerstate", ptr %14, i32 0, i32 6
  store i64 1, ptr %15, align 8, !tbaa !23
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %"struct.alglib_impl::clusterizerstate", ptr %16, i32 0, i32 7
  store i64 0, ptr %17, align 8, !tbaa !24
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.alglib_impl::clusterizerstate", ptr %18, i32 0, i32 8
  store i64 0, ptr %19, align 8, !tbaa !25
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.alglib_impl::clusterizerstate", ptr %20, i32 0, i32 9
  store i8 0, ptr %21, align 8, !tbaa !26
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.alglib_impl::clusterizerstate", ptr %22, i32 0, i32 10
  store i64 1, ptr %23, align 8, !tbaa !27
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.alglib_impl::clusterizerstate", ptr %24, i32 0, i32 13
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl13kmeansinitbufEPNS_13kmeansbuffersEPNS_8ae_stateE(ptr noundef %25, ptr noundef %26)
  ret void
}

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

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

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, !11, i64 0}
!10 = !{!"_ZTSN11alglib_impl16clusterizerstateE", !11, i64 0, !11, i64 8, !11, i64 16, !12, i64 24, !12, i64 104, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !13, i64 216, !11, i64 224, !12, i64 232, !15, i64 312, !17, i64 1048}
!11 = !{!"long", !7, i64 0}
!12 = !{!"_ZTSN11alglib_impl9ae_matrixE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !13, i64 32, !14, i64 40, !7, i64 72}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!"_ZTSN11alglib_impl9apbuffersE", !16, i64 0, !16, i64 64, !16, i64 128, !16, i64 192, !16, i64 256, !16, i64 320, !16, i64 384, !16, i64 448, !16, i64 512, !12, i64 576, !12, i64 656}
!16 = !{!"_ZTSN11alglib_impl9ae_vectorE", !11, i64 0, !11, i64 8, !13, i64 16, !14, i64 24, !7, i64 56}
!17 = !{!"_ZTSN11alglib_impl13kmeansbuffersE", !12, i64 0, !12, i64 80, !16, i64 160, !16, i64 224, !16, i64 288, !16, i64 352, !15, i64 416, !18, i64 1152}
!18 = !{!"_ZTSN11alglib_impl14ae_shared_poolE", !19, i64 0, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !11, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !14, i64 112}
!19 = !{!"_ZTSN11alglib_impl7ae_lockE", !6, i64 0, !14, i64 8, !13, i64 40}
!20 = !{!10, !11, i64 8}
!21 = !{!10, !11, i64 16}
!22 = !{!10, !11, i64 184}
!23 = !{!10, !11, i64 192}
!24 = !{!10, !11, i64 200}
!25 = !{!10, !11, i64 208}
!26 = !{!10, !13, i64 216}
!27 = !{!10, !11, i64 224}


; 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_impl17clusterizercreateEPNS_16clusterizerstateEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  tail call void @_ZN11alglib_impl23_clusterizerstate_clearEPv(ptr noundef %0)
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %0, i8 0, i64 16, i1 false)
  store i64 2, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 184
  store i64 0, ptr %4, align 8, !tbaa !19
  %5 = getelementptr inbounds i8, ptr %0, i64 192
  store i64 1, ptr %5, align 8, !tbaa !20
  %6 = getelementptr inbounds i8, ptr %0, i64 200
  %7 = getelementptr inbounds i8, ptr %0, i64 224
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(17) %6, i8 0, i64 17, i1 false)
  store i64 1, ptr %7, align 8, !tbaa !21
  %8 = getelementptr inbounds i8, ptr %0, i64 1048
  tail call void @_ZN11alglib_impl13kmeansinitbufEPNS_13kmeansbuffersEPNS_8ae_stateE(ptr noundef nonnull %8, ptr noundef %1)
  ret void
}

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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, !7, i64 16}
!6 = !{!"_ZTSN11alglib_impl16clusterizerstateE", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 104, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !11, i64 216, !7, i64 224, !10, i64 232, !14, i64 312, !16, i64 1048}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !12, i64 40, !8, i64 72}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"_ZTSN11alglib_impl9apbuffersE", !15, i64 0, !15, i64 64, !15, i64 128, !15, i64 192, !15, i64 256, !15, i64 320, !15, i64 384, !15, i64 448, !15, i64 512, !10, i64 576, !10, i64 656}
!15 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !11, i64 16, !12, i64 24, !8, i64 56}
!16 = !{!"_ZTSN11alglib_impl13kmeansbuffersE", !10, i64 0, !10, i64 80, !15, i64 160, !15, i64 224, !15, i64 288, !15, i64 352, !14, i64 416, !17, i64 1152}
!17 = !{!"_ZTSN11alglib_impl14ae_shared_poolE", !18, i64 0, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !7, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !12, i64 112}
!18 = !{!"_ZTSN11alglib_impl7ae_lockE", !13, i64 0, !12, i64 8, !11, i64 40}
!19 = !{!6, !7, i64 184}
!20 = !{!6, !7, i64 192}
!21 = !{!6, !7, i64 224}


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