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

; 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.std::nothrow_t" = type { i8 }
%"class.wordembedding::DataBlock" = type <{ %"class.std::unordered_set", %"class.std::unordered_set", %"class.std::unordered_set", %"class.std::vector", ptr, ptr, ptr, ptr, i8, i8, [6 x i8] }>
%"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 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<wordembedding::DataBlock::Sentence, std::allocator<wordembedding::DataBlock::Sentence>>::_Vector_impl" }
%"struct.std::_Vector_base<wordembedding::DataBlock::Sentence, std::allocator<wordembedding::DataBlock::Sentence>>::_Vector_impl" = type { %"struct.std::_Vector_base<wordembedding::DataBlock::Sentence, std::allocator<wordembedding::DataBlock::Sentence>>::_Vector_impl_data" }
%"struct.std::_Vector_base<wordembedding::DataBlock::Sentence, std::allocator<wordembedding::DataBlock::Sentence>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZSt7nothrow = external global %"struct.std::nothrow_t", align 1
@.str = external hidden unnamed_addr constant [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [100 x i8], align 1
@__PRETTY_FUNCTION__._ZN13wordembedding9DataBlock12MallocMemoryEib = external hidden unnamed_addr constant [55 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN13wordembedding9DataBlock12MallocMemoryEib(ptr noundef nonnull align 8 dereferenceable(226) %0, i32 noundef %1, i1 noundef zeroext %2) #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %7 = zext i1 %2 to i8
  store i8 %7, ptr %6, align 1, !tbaa !11
  %8 = load ptr, ptr %4, align 8
  %9 = load i32, ptr %5, align 4, !tbaa !9
  %10 = sext i32 %9 to i64
  %11 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %10, i64 8)
  %12 = extractvalue { i64, i1 } %11, 1
  %13 = extractvalue { i64, i1 } %11, 0
  %14 = select i1 %12, i64 -1, i64 %13
  %15 = call noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef %14, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #4
  %16 = getelementptr inbounds %"class.wordembedding::DataBlock", ptr %8, i32 0, i32 4
  store ptr %15, ptr %16, align 8, !tbaa !13
  %17 = getelementptr inbounds %"class.wordembedding::DataBlock", ptr %8, i32 0, i32 4
  %18 = load ptr, ptr %17, align 8, !tbaa !13
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %3
  br label %23

21:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 91, ptr noundef @__PRETTY_FUNCTION__._ZN13wordembedding9DataBlock12MallocMemoryEib) #5
  unreachable

22:                                               ; No predecessors!
  br label %23

23:                                               ; preds = %22, %20
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %25, i64 8)
  %27 = extractvalue { i64, i1 } %26, 1
  %28 = extractvalue { i64, i1 } %26, 0
  %29 = select i1 %27, i64 -1, i64 %28
  %30 = call noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef %29, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #4
  %31 = getelementptr inbounds %"class.wordembedding::DataBlock", ptr %8, i32 0, i32 5
  store ptr %30, ptr %31, align 8, !tbaa !25
  %32 = getelementptr inbounds %"class.wordembedding::DataBlock", ptr %8, i32 0, i32 5
  %33 = load ptr, ptr %32, align 8, !tbaa !25
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %36

35:                                               ; preds = %23
  br label %38

36:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 93, ptr noundef @__PRETTY_FUNCTION__._ZN13wordembedding9DataBlock12MallocMemoryEib) #5
  unreachable

37:                                               ; No predecessors!
  br label %38

38:                                               ; preds = %37, %35
  %39 = load i8, ptr %6, align 1, !tbaa !11, !range !26, !noundef !27
  %40 = trunc i8 %39 to i1
  %41 = getelementptr inbounds %"class.wordembedding::DataBlock", ptr %8, i32 0, i32 8
  %42 = zext i1 %40 to i8
  store i8 %42, ptr %41, align 8, !tbaa !28
  %43 = getelementptr inbounds %"class.wordembedding::DataBlock", ptr %8, i32 0, i32 8
  %44 = load i8, ptr %43, align 8, !tbaa !28, !range !26, !noundef !27
  %45 = trunc i8 %44 to i1
  br i1 %45, label %46, label %77

46:                                               ; preds = %38
  %47 = load i32, ptr %5, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %48, i64 8)
  %50 = extractvalue { i64, i1 } %49, 1
  %51 = extractvalue { i64, i1 } %49, 0
  %52 = select i1 %50, i64 -1, i64 %51
  %53 = call noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef %52, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #4
  %54 = getelementptr inbounds %"class.wordembedding::DataBlock", ptr %8, i32 0, i32 6
  store ptr %53, ptr %54, align 8, !tbaa !29
  %55 = load i32, ptr %5, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %56, i64 8)
  %58 = extractvalue { i64, i1 } %57, 1
  %59 = extractvalue { i64, i1 } %57, 0
  %60 = select i1 %58, i64 -1, i64 %59
  %61 = call noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef %60, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #4
  %62 = getelementptr inbounds %"class.wordembedding::DataBlock", ptr %8, i32 0, i32 7
  store ptr %61, ptr %62, align 8, !tbaa !30
  %63 = getelementptr inbounds %"class.wordembedding::DataBlock", ptr %8, i32 0, i32 6
  %64 = load ptr, ptr %63, align 8, !tbaa !29
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %67

66:                                               ; preds = %46
  br label %69

67:                                               ; preds = %46
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 99, ptr noundef @__PRETTY_FUNCTION__._ZN13wordembedding9DataBlock12MallocMemoryEib) #5
  unreachable

68:                                               ; No predecessors!
  br label %69

69:                                               ; preds = %68, %66
  %70 = getelementptr inbounds %"class.wordembedding::DataBlock", ptr %8, i32 0, i32 7
  %71 = load ptr, ptr %70, align 8, !tbaa !30
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %74

73:                                               ; preds = %69
  br label %76

74:                                               ; preds = %69
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 100, ptr noundef @__PRETTY_FUNCTION__._ZN13wordembedding9DataBlock12MallocMemoryEib) #5
  unreachable

75:                                               ; No predecessors!
  br label %76

76:                                               ; preds = %75, %73
  br label %77

77:                                               ; preds = %76, %38
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin nounwind allocsize(0)
declare noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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 nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin nounwind allocsize(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 #3 = { noreturn nounwind "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 #4 = { builtin nounwind allocsize(0) }
attributes #5 = { noreturn 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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !6, i64 192}
!14 = !{!"_ZTSN13wordembedding9DataBlockE", !15, i64 0, !15, i64 56, !15, i64 112, !21, i64 168, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !12, i64 224, !12, i64 225}
!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, !17, i64 8, !18, i64 16, !17, i64 24, !19, i64 32, !6, i64 48}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!19 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !20, i64 0, !17, i64 8}
!20 = !{!"float", !7, i64 0}
!21 = !{!"_ZTSSt6vectorIN13wordembedding9DataBlock8SentenceESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIN13wordembedding9DataBlock8SentenceESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN13wordembedding9DataBlock8SentenceESaIS2_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN13wordembedding9DataBlock8SentenceESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!14, !6, i64 200}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!14, !12, i64 224}
!29 = !{!14, !6, i64 208}
!30 = !{!14, !6, i64 216}


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

%"struct.std::nothrow_t" = type { i8 }

@_ZSt7nothrow = external global %"struct.std::nothrow_t", align 1
@.str = external hidden unnamed_addr constant [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [100 x i8], align 1
@__PRETTY_FUNCTION__._ZN13wordembedding9DataBlock12MallocMemoryEib = external hidden unnamed_addr constant [55 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN13wordembedding9DataBlock12MallocMemoryEib(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(226) %0, i32 noundef %1, i1 noundef zeroext %2) local_unnamed_addr #0 align 2 {
  %4 = zext i1 %2 to i8
  %5 = zext nneg i32 %1 to i64
  %6 = icmp slt i32 %1, 0
  %7 = shl nuw nsw i64 %5, 3
  %8 = select i1 %6, i64 -1, i64 %7
  %9 = tail call noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef %8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #3
  %10 = getelementptr inbounds i8, ptr %0, i64 192
  store ptr %9, ptr %10, align 8, !tbaa !5
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %11, label %12

11:                                               ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 91, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13wordembedding9DataBlock12MallocMemoryEib) #4
  unreachable

12:                                               ; preds = %3
  %13 = tail call noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef %8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #3
  %14 = getelementptr inbounds i8, ptr %0, i64 200
  store ptr %13, ptr %14, align 8, !tbaa !21
  %.not5 = icmp eq ptr %13, null
  br i1 %.not5, label %15, label %16

15:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 93, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13wordembedding9DataBlock12MallocMemoryEib) #4
  unreachable

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %0, i64 224
  store i8 %4, ptr %17, align 8, !tbaa !22
  br i1 %2, label %18, label %26

18:                                               ; preds = %16
  %19 = tail call noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef %8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #3
  %20 = getelementptr inbounds i8, ptr %0, i64 208
  store ptr %19, ptr %20, align 8, !tbaa !23
  %21 = tail call noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef %8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #3
  %22 = getelementptr inbounds i8, ptr %0, i64 216
  store ptr %21, ptr %22, align 8, !tbaa !24
  %.not6 = icmp eq ptr %19, null
  br i1 %.not6, label %23, label %24

23:                                               ; preds = %18
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 99, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13wordembedding9DataBlock12MallocMemoryEib) #4
  unreachable

24:                                               ; preds = %18
  %.not7 = icmp eq ptr %21, null
  br i1 %.not7, label %25, label %26

25:                                               ; preds = %24
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 100, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13wordembedding9DataBlock12MallocMemoryEib) #4
  unreachable

26:                                               ; preds = %24, %16
  ret void
}

; Function Attrs: nobuiltin nounwind allocsize(0)
declare noalias noundef ptr @_ZnamRKSt9nothrow_t(i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #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 = { nobuiltin nounwind allocsize(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 = { noreturn nounwind "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 = { builtin nounwind allocsize(0) }
attributes #4 = { noreturn 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, !9, i64 192}
!6 = !{!"_ZTSN13wordembedding9DataBlockE", !7, i64 0, !7, i64 56, !7, i64 112, !16, i64 168, !9, i64 192, !9, i64 200, !9, i64 208, !9, i64 216, !20, i64 224, !20, i64 225}
!7 = !{!"_ZTSSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE", !8, i64 0}
!8 = !{!"_ZTSSt10_HashtableIiiSaIiENSt8__detail9_IdentityESt8equal_toIiESt4hashIiENS1_18_Mod_range_hashingENS1_20_Default_ranged_hashENS1_20_Prime_rehash_policyENS1_17_Hashtable_traitsILb0ELb1ELb1EEEE", !9, i64 0, !12, i64 8, !13, i64 16, !12, i64 24, !14, i64 32, !9, i64 48}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"long", !10, i64 0}
!13 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !9, i64 0}
!14 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !15, i64 0, !12, i64 8}
!15 = !{!"float", !10, i64 0}
!16 = !{!"_ZTSSt6vectorIN13wordembedding9DataBlock8SentenceESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIN13wordembedding9DataBlock8SentenceESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN13wordembedding9DataBlock8SentenceESaIS2_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN13wordembedding9DataBlock8SentenceESaIS2_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!20 = !{!"bool", !10, i64 0}
!21 = !{!6, !9, i64 200}
!22 = !{!6, !20, i64 224}
!23 = !{!6, !9, i64 208}
!24 = !{!6, !9, i64 216}


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