; LLVM IR from nickmqb/muon :: bootstrap/mu.ll_Tag (static_init__)

; 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.string__ = type { ptr, i32 }
%struct.tag_____IAllocator__ = type { ptr, ptr, ptr, ptr }
%struct.tag_____Tag__ = type { ptr, ptr }
%struct.tag_____Namespace__ = type { %struct.string__, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.tag_____Map__string__Node____ = type { %struct.tag_____Array__MapEntry__string__Node______, i32, i32, i32 }
%struct.tag_____Array__MapEntry__string__Node______ = type { ptr, i32 }
%struct.tag_____List__Ptr__NamespaceDef______ = type { ptr, i32, i32 }

@mu_____string79 = external dso_local global %struct.string__, align 8
@top_____currentAllocator__ = external dso_local thread_local global %struct.tag_____IAllocator__, align 8
@Tag__null___ = external hidden global %struct.tag_____Tag__, align 8

; 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 speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local void @Tag__static_init__() #4 {
  %1 = alloca %struct.tag_____Tag__, align 8
  %2 = alloca ptr, align 8
  %3 = alloca %struct.tag_____Namespace__, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.tag_____Map__string__Node____, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.tag_____List__Ptr__NamespaceDef______, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %1) #5
  call void @llvm.memset.p0.i64(ptr align 8 %1, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %8 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %9 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %8, i32 0, i32 1
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %12 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %11, i32 0, i32 0
  %13 = load ptr, ptr %12, align 8, !tbaa !10
  %14 = call ptr %10(ptr noundef %13, i64 noundef 112)
  store ptr %14, ptr %2, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 112, ptr %3) #5
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 112, i1 false)
  %15 = getelementptr inbounds %struct.tag_____Namespace__, ptr %3, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 @mu_____string79, i64 16, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %16 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %17 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %16, i32 0, i32 1
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %20 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %19, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !10
  %22 = call ptr %18(ptr noundef %21, i64 noundef 32)
  store ptr %22, ptr %4, align 8, !tbaa !11
  %23 = load ptr, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #5
  call void @Map__create__string__Node____(ptr dead_on_unwind writable sret(%struct.tag_____Map__string__Node____) align 8 %5)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %5, i64 32, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  %24 = load ptr, ptr %4, align 8, !tbaa !11
  %25 = getelementptr inbounds %struct.tag_____Namespace__, ptr %3, i32 0, i32 4
  store ptr %24, ptr %25, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %26 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %27 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %26, i32 0, i32 1
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %30 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %29, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !10
  %32 = call ptr %28(ptr noundef %31, i64 noundef 16)
  store ptr %32, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 16, i1 false)
  %33 = load ptr, ptr %6, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %33, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !19
  %34 = load ptr, ptr %6, align 8, !tbaa !11
  %35 = getelementptr inbounds %struct.tag_____Namespace__, ptr %3, i32 0, i32 5
  store ptr %34, ptr %35, align 8, !tbaa !20
  %36 = load ptr, ptr %2, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %3, i64 112, i1 false), !tbaa.struct !21
  %37 = load ptr, ptr %2, align 8, !tbaa !11
  %38 = getelementptr inbounds %struct.tag_____Tag__, ptr %1, i32 0, i32 0
  store ptr %37, ptr %38, align 8, !tbaa !22
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @Tag__null___, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %1) #5
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @Map__create__string__Node____(ptr dead_on_unwind noalias writable sret(%struct.tag_____Map__string__Node____) align 8) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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, !7, i64 8}
!6 = !{!"tag_____IAllocator__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{i64 0, i64 8, !11, i64 8, i64 4, !13}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{i64 0, i64 8, !11, i64 8, i64 4, !13, i64 16, i64 4, !13, i64 20, i64 4, !13, i64 24, i64 4, !13}
!16 = !{!17, !7, i64 32}
!17 = !{!"tag_____Namespace__", !18, i64 0, !7, i64 16, !14, i64 24, !14, i64 28, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !14, i64 104}
!18 = !{!"", !7, i64 0, !14, i64 8}
!19 = !{i64 0, i64 8, !11, i64 8, i64 4, !13, i64 12, i64 4, !13}
!20 = !{!17, !7, i64 40}
!21 = !{i64 0, i64 8, !11, i64 8, i64 4, !13, i64 16, i64 8, !11, i64 24, i64 4, !13, i64 28, i64 4, !13, i64 32, i64 8, !11, i64 40, i64 8, !11, i64 48, i64 8, !11, i64 56, i64 8, !11, i64 64, i64 8, !11, i64 72, i64 8, !11, i64 80, i64 8, !11, i64 88, i64 8, !11, i64 96, i64 8, !11, i64 104, i64 4, !13}
!22 = !{!23, !7, i64 0}
!23 = !{!"tag_____Tag__", !7, i64 0, !7, i64 8}
!24 = !{i64 0, i64 8, !11, i64 8, i64 8, !11}


; 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.string__ = type { ptr, i32 }
%struct.tag_____IAllocator__ = type { ptr, ptr, ptr, ptr }
%struct.tag_____Tag__ = type { ptr, ptr }
%struct.tag_____Map__string__Node____ = type { %struct.tag_____Array__MapEntry__string__Node______, i32, i32, i32 }
%struct.tag_____Array__MapEntry__string__Node______ = type { ptr, i32 }

@mu_____string79 = external dso_local local_unnamed_addr global %struct.string__, align 8
@top_____currentAllocator__ = external dso_local thread_local local_unnamed_addr global %struct.tag_____IAllocator__, align 8
@Tag__null___ = external hidden local_unnamed_addr global %struct.tag_____Tag__, align 8

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local void @Tag__static_init__() local_unnamed_addr #4 {
  %.sroa.0 = alloca { %struct.string__, ptr, i32, i32 }, align 8
  %1 = alloca %struct.tag_____Map__string__Node____, align 8
  %2 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %3 = getelementptr inbounds i8, ptr %2, i64 8
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8, !tbaa !10
  %6 = tail call ptr %4(ptr noundef %5, i64 noundef 112) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %.sroa.0)
  %.sroa.0.16.sroa_idx = getelementptr inbounds i8, ptr %.sroa.0, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.0.16.sroa_idx, i8 0, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.0, ptr noundef nonnull align 8 dereferenceable(16) @mu_____string79, i64 16, i1 false), !tbaa.struct !11
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = load ptr, ptr %2, align 8, !tbaa !10
  %9 = tail call ptr %7(ptr noundef %8, i64 noundef 32) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #5
  call void @Map__create__string__Node____(ptr dead_on_unwind nonnull writable sret(%struct.tag_____Map__string__Node____) align 8 %1)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %1, i64 32, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #5
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8, !tbaa !10
  %12 = call ptr %10(ptr noundef %11, i64 noundef 16) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %12, i8 0, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %.sroa.0, i64 32, i1 false), !tbaa.struct !16
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 32
  store ptr %9, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !12
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 40
  store ptr %12, ptr %.sroa.6.0..sroa_idx, align 8, !tbaa !12
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 48
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %.sroa.7.0..sroa_idx, i8 0, i64 64, i1 false)
  store ptr %6, ptr @Tag__null___, align 8, !tbaa !12
  store ptr null, ptr getelementptr inbounds (i8, ptr @Tag__null___, i64 8), align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %.sroa.0)
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @Map__create__string__Node____(ptr dead_on_unwind noalias writable sret(%struct.tag_____Map__string__Node____) align 8) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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, !7, i64 8}
!6 = !{!"tag_____IAllocator__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 0}
!11 = !{i64 0, i64 8, !12, i64 8, i64 4, !13}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{i64 0, i64 8, !12, i64 8, i64 4, !13, i64 16, i64 4, !13, i64 20, i64 4, !13, i64 24, i64 4, !13}
!16 = !{i64 0, i64 8, !12, i64 8, i64 4, !13, i64 16, i64 8, !12, i64 24, i64 4, !13, i64 28, i64 4, !13, i64 32, i64 8, !12, i64 40, i64 8, !12, i64 48, i64 8, !12, i64 56, i64 8, !12, i64 64, i64 8, !12, i64 72, i64 8, !12, i64 80, i64 8, !12, i64 88, i64 8, !12, i64 96, i64 8, !12, i64 104, i64 4, !13}


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