; LLVM IR from microsoft/Multiverso :: Applications/WordEmbedding/src (wordembedding)

; 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.wordembedding::WordEmbedding" = type { float, i64, ptr, ptr, ptr, ptr, %"class.std::unordered_set", %"class.std::unordered_set", i32, ptr }
%"class.std::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"struct.wordembedding::Option" = type <{ ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, i8, i8, [2 x i8], float, [4 x i8], i64, i32, i32, i32, i32, i32, i32, i64, i64, float, [4 x i8] }>

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN13wordembedding13WordEmbeddingC2EPNS_6OptionEPNS_14HuffmanEncoderEPNS_7SamplerEi(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) unnamed_addr #0 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store i32 %4, ptr %10, align 4, !tbaa !9
  %11 = load ptr, ptr %6, align 8
  %12 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 2
  store ptr null, ptr %12, align 8, !tbaa !11
  %13 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 3
  store ptr null, ptr %13, align 8, !tbaa !19
  %14 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 4
  store ptr null, ptr %14, align 8, !tbaa !20
  %15 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 5
  store ptr null, ptr %15, align 8, !tbaa !21
  %16 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 6
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %16) #1
  %17 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 7
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %17) #1
  %18 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 9
  store ptr null, ptr %18, align 8, !tbaa !22
  %19 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 1
  store i64 0, ptr %19, align 8, !tbaa !23
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 2
  store ptr %20, ptr %21, align 8, !tbaa !11
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 4
  store ptr %22, ptr %23, align 8, !tbaa !20
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 5
  store ptr %24, ptr %25, align 8, !tbaa !21
  %26 = load i32, ptr %10, align 4, !tbaa !9
  %27 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 8
  store i32 %26, ptr %27, align 8, !tbaa !24
  %28 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = getelementptr inbounds %"struct.wordembedding::Option", ptr %29, i32 0, i32 23
  %31 = load float, ptr %30, align 8, !tbaa !25
  %32 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 0
  store float %31, ptr %32, align 8, !tbaa !28
  %33 = getelementptr inbounds %"class.wordembedding::WordEmbedding", ptr %11, i32 0, i32 9
  store ptr null, ptr %33, align 8, !tbaa !22
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"_ZTSN13wordembedding13WordEmbeddingE", !13, i64 0, !14, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !15, i64 48, !15, i64 104, !10, i64 160, !6, i64 168}
!13 = !{!"float", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE", !16, i64 0}
!16 = !{!"_ZTSSt10_HashtableIiiSaIiENSt8__detail9_IdentityESt8equal_toIiESt4hashIiENS1_18_Mod_range_hashingENS1_20_Default_ranged_hashENS1_20_Prime_rehash_policyENS1_17_Hashtable_traitsILb0ELb1ELb1EEEE", !6, i64 0, !14, i64 8, !17, i64 16, !14, i64 24, !18, i64 32, !6, i64 48}
!17 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!18 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !13, i64 0, !14, i64 8}
!19 = !{!12, !6, i64 24}
!20 = !{!12, !6, i64 32}
!21 = !{!12, !6, i64 40}
!22 = !{!12, !6, i64 168}
!23 = !{!12, !14, i64 8}
!24 = !{!12, !10, i64 160}
!25 = !{!26, !13, i64 104}
!26 = !{!"_ZTSN13wordembedding6OptionE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !27, i64 40, !27, i64 41, !27, i64 42, !27, i64 43, !27, i64 44, !27, i64 45, !13, i64 48, !14, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !14, i64 88, !14, i64 96, !13, i64 104}
!27 = !{!"bool", !7, i64 0}
!28 = !{!12, !13, 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"

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN13wordembedding13WordEmbeddingC2EPNS_6OptionEPNS_14HuffmanEncoderEPNS_7SamplerEi(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) unnamed_addr #0 align 2 {
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  %8 = getelementptr inbounds i8, ptr %0, i64 40
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %6, i8 0, i64 32, i1 false)
  tail call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #2
  %10 = getelementptr inbounds i8, ptr %0, i64 104
  tail call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %10) #2
  %11 = getelementptr inbounds i8, ptr %0, i64 168
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !17
  store ptr %2, ptr %7, align 8, !tbaa !18
  store ptr %3, ptr %8, align 8, !tbaa !19
  %13 = getelementptr inbounds i8, ptr %0, i64 160
  store i32 %4, ptr %13, align 8, !tbaa !20
  %14 = getelementptr inbounds i8, ptr %1, i64 104
  %15 = load float, ptr %14, align 8, !tbaa !21
  store float %15, ptr %0, align 8, !tbaa !24
  store ptr null, ptr %11, align 8, !tbaa !25
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #0 align 2

; 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 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { 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, !10, i64 8}
!6 = !{!"_ZTSN13wordembedding13WordEmbeddingE", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !12, i64 48, !12, i64 104, !16, i64 160, !11, i64 168}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_ZTSSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE", !13, i64 0}
!13 = !{!"_ZTSSt10_HashtableIiiSaIiENSt8__detail9_IdentityESt8equal_toIiESt4hashIiENS1_18_Mod_range_hashingENS1_20_Default_ranged_hashENS1_20_Prime_rehash_policyENS1_17_Hashtable_traitsILb0ELb1ELb1EEEE", !11, i64 0, !10, i64 8, !14, i64 16, !10, i64 24, !15, i64 32, !11, i64 48}
!14 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !11, i64 0}
!15 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !7, i64 0, !10, i64 8}
!16 = !{!"int", !8, i64 0}
!17 = !{!6, !11, i64 16}
!18 = !{!6, !11, i64 32}
!19 = !{!6, !11, i64 40}
!20 = !{!6, !16, i64 160}
!21 = !{!22, !7, i64 104}
!22 = !{!"_ZTSN13wordembedding6OptionE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !23, i64 40, !23, i64 41, !23, i64 42, !23, i64 43, !23, i64 44, !23, i64 45, !7, i64 48, !10, i64 56, !16, i64 64, !16, i64 68, !16, i64 72, !16, i64 76, !16, i64 80, !16, i64 84, !10, i64 88, !10, i64 96, !7, i64 104}
!23 = !{!"bool", !8, i64 0}
!24 = !{!6, !7, i64 0}
!25 = !{!6, !11, i64 168}


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