; LLVM IR from microsoft/X-Mem :: src/Configurator.ll (ZN4xmem12ConfiguratorC2Ev)

; 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.xmem::Configurator" = type <{ i8, i8, i8, i8, i8, [3 x i8], i64, i32, i8, i8, i8, i8, %"class.std::__cxx11::list", %"class.std::__cxx11::list", i32, i8, i8, [2 x i8], i32, [4 x i8], %"class.std::__cxx11::basic_string", i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }>
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<unsigned int, std::allocator<unsigned int>>::_List_impl" }
%"struct.std::__cxx11::_List_base<unsigned int, std::allocator<unsigned int>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4xmem12ConfiguratorC2Ev(ptr noundef nonnull align 8 dereferenceable(135) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 0
  store i8 0, ptr %4, align 8, !tbaa !9
  %5 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 1
  store i8 0, ptr %5, align 1, !tbaa !21
  %6 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 2
  store i8 0, ptr %6, align 2, !tbaa !22
  %7 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 3
  store i8 1, ptr %7, align 1, !tbaa !23
  %8 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 4
  store i8 1, ptr %8, align 4, !tbaa !24
  %9 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 6
  store i64 4096, ptr %9, align 8, !tbaa !25
  %10 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 7
  store i32 1, ptr %10, align 8, !tbaa !26
  %11 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 8
  store i8 0, ptr %11, align 4, !tbaa !27
  %12 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 9
  store i8 1, ptr %12, align 1, !tbaa !28
  %13 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 10
  store i8 1, ptr %13, align 2, !tbaa !29
  %14 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 12
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 24, i1 false)
  call void @_ZNSt7__cxx114listIjSaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #2
  %15 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 13
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 24, i1 false)
  call void @_ZNSt7__cxx114listIjSaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #2
  %16 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 14
  store i32 1, ptr %16, align 8, !tbaa !30
  %17 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 15
  store i8 0, ptr %17, align 4, !tbaa !31
  %18 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 16
  store i8 1, ptr %18, align 1, !tbaa !32
  %19 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 18
  store i32 1, ptr %19, align 8, !tbaa !33
  %20 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 20
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #2
  %21 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 21
  store i8 0, ptr %21, align 8, !tbaa !34
  %22 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 22
  store i8 0, ptr %22, align 1, !tbaa !35
  %23 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 23
  store i8 0, ptr %23, align 2, !tbaa !36
  %24 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 24
  store i8 1, ptr %24, align 1, !tbaa !37
  %25 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 25
  store i8 1, ptr %25, align 4, !tbaa !38
  %26 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 26
  store i8 1, ptr %26, align 1, !tbaa !39
  %27 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 27
  store i8 0, ptr %27, align 2, !tbaa !40
  %28 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 28
  store i8 0, ptr %28, align 1, !tbaa !41
  %29 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 29
  store i8 0, ptr %29, align 8, !tbaa !42
  %30 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 30
  store i8 0, ptr %30, align 1, !tbaa !43
  %31 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 31
  store i8 0, ptr %31, align 2, !tbaa !44
  %32 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 32
  store i8 0, ptr %32, align 1, !tbaa !45
  %33 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 33
  store i8 0, ptr %33, align 4, !tbaa !46
  %34 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 34
  store i8 0, ptr %34, align 1, !tbaa !47
  %35 = getelementptr inbounds %"class.xmem::Configurator", ptr %3, i32 0, i32 35
  store i8 0, ptr %35, align 2, !tbaa !48
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) 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 = { 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, !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 = !{!"_ZTSN4xmem12ConfiguratorE", !11, i64 0, !11, i64 1, !11, i64 2, !11, i64 3, !11, i64 4, !12, i64 8, !13, i64 16, !11, i64 20, !11, i64 21, !11, i64 22, !14, i64 24, !14, i64 48, !13, i64 72, !11, i64 76, !11, i64 77, !13, i64 80, !19, i64 88, !11, i64 120, !11, i64 121, !11, i64 122, !11, i64 123, !11, i64 124, !11, i64 125, !11, i64 126, !11, i64 127, !11, i64 128, !11, i64 129, !11, i64 130, !11, i64 131, !11, i64 132, !11, i64 133, !11, i64 134}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSNSt7__cxx114listIjSaIjEEE", !15, i64 0}
!15 = !{!"_ZTSNSt7__cxx1110_List_baseIjSaIjEEE", !16, i64 0}
!16 = !{!"_ZTSNSt7__cxx1110_List_baseIjSaIjEE10_List_implE", !17, i64 0}
!17 = !{!"_ZTSNSt8__detail17_List_node_headerE", !18, i64 0, !12, i64 16}
!18 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !12, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!21 = !{!10, !11, i64 1}
!22 = !{!10, !11, i64 2}
!23 = !{!10, !11, i64 3}
!24 = !{!10, !11, i64 4}
!25 = !{!10, !12, i64 8}
!26 = !{!10, !13, i64 16}
!27 = !{!10, !11, i64 20}
!28 = !{!10, !11, i64 21}
!29 = !{!10, !11, i64 22}
!30 = !{!10, !13, i64 72}
!31 = !{!10, !11, i64 76}
!32 = !{!10, !11, i64 77}
!33 = !{!10, !13, i64 80}
!34 = !{!10, !11, i64 120}
!35 = !{!10, !11, i64 121}
!36 = !{!10, !11, i64 122}
!37 = !{!10, !11, i64 123}
!38 = !{!10, !11, i64 124}
!39 = !{!10, !11, i64 125}
!40 = !{!10, !11, i64 126}
!41 = !{!10, !11, i64 127}
!42 = !{!10, !11, i64 128}
!43 = !{!10, !11, i64 129}
!44 = !{!10, !11, i64 130}
!45 = !{!10, !11, i64 131}
!46 = !{!10, !11, i64 132}
!47 = !{!10, !11, i64 133}
!48 = !{!10, !11, i64 134}


; 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 @_ZN4xmem12ConfiguratorC2Ev(ptr noundef nonnull align 8 dereferenceable(135) %0) unnamed_addr #0 align 2 {
  store <4 x i8> <i8 0, i8 0, i8 0, i8 1>, ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 4
  store i8 1, ptr %2, align 4, !tbaa !9
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 4096, ptr %3, align 8, !tbaa !21
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 1, ptr %4, align 8, !tbaa !22
  %5 = getelementptr inbounds i8, ptr %0, i64 20
  store i8 0, ptr %5, align 4, !tbaa !23
  %6 = getelementptr inbounds i8, ptr %0, i64 21
  store i8 1, ptr %6, align 1, !tbaa !24
  %7 = getelementptr inbounds i8, ptr %0, i64 22
  store i8 1, ptr %7, align 2, !tbaa !25
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %8, i8 0, i64 24, i1 false)
  tail call void @_ZNSt7__cxx114listIjSaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #2
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %9, i8 0, i64 24, i1 false)
  tail call void @_ZNSt7__cxx114listIjSaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #2
  %10 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 1, ptr %10, align 8, !tbaa !26
  %11 = getelementptr inbounds i8, ptr %0, i64 76
  store i8 0, ptr %11, align 4, !tbaa !27
  %12 = getelementptr inbounds i8, ptr %0, i64 77
  store i8 1, ptr %12, align 1, !tbaa !28
  %13 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 1, ptr %13, align 8, !tbaa !29
  %14 = getelementptr inbounds i8, ptr %0, i64 88
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #2
  %15 = getelementptr inbounds i8, ptr %0, i64 120
  store <4 x i8> <i8 0, i8 0, i8 0, i8 1>, ptr %15, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 124
  store i8 1, ptr %16, align 4, !tbaa !30
  %17 = getelementptr inbounds i8, ptr %0, i64 125
  store i8 1, ptr %17, align 1, !tbaa !31
  %18 = getelementptr inbounds i8, ptr %0, i64 126
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(9) %18, i8 0, i64 9, i1 false)
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) 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 = { mustprogress 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, !6, i64 0}
!6 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"_ZTSN4xmem12ConfiguratorE", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !6, i64 4, !11, i64 8, !12, i64 16, !6, i64 20, !6, i64 21, !6, i64 22, !13, i64 24, !13, i64 48, !12, i64 72, !6, i64 76, !6, i64 77, !12, i64 80, !19, i64 88, !6, i64 120, !6, i64 121, !6, i64 122, !6, i64 123, !6, i64 124, !6, i64 125, !6, i64 126, !6, i64 127, !6, i64 128, !6, i64 129, !6, i64 130, !6, i64 131, !6, i64 132, !6, i64 133, !6, i64 134}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSNSt7__cxx114listIjSaIjEEE", !14, i64 0}
!14 = !{!"_ZTSNSt7__cxx1110_List_baseIjSaIjEEE", !15, i64 0}
!15 = !{!"_ZTSNSt7__cxx1110_List_baseIjSaIjEE10_List_implE", !16, i64 0}
!16 = !{!"_ZTSNSt8__detail17_List_node_headerE", !17, i64 0, !11, i64 16}
!17 = !{!"_ZTSNSt8__detail15_List_node_baseE", !18, i64 0, !18, i64 8}
!18 = !{!"any pointer", !7, i64 0}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !11, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !18, i64 0}
!21 = !{!10, !11, i64 8}
!22 = !{!10, !12, i64 16}
!23 = !{!10, !6, i64 20}
!24 = !{!10, !6, i64 21}
!25 = !{!10, !6, i64 22}
!26 = !{!10, !12, i64 72}
!27 = !{!10, !6, i64 76}
!28 = !{!10, !6, i64 77}
!29 = !{!10, !12, i64 80}
!30 = !{!10, !6, i64 124}
!31 = !{!10, !6, i64 125}


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