; LLVM IR from thepowersgang/mrustc :: src/hir/visitor.ll (ZN3HIR7Visitor11visit_unionENS_8ItemPathERNS_5UnionE)

; 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.HIR::ItemPath" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%class.TraceLog = type { ptr, %"class.std::function.179" }
%"class.std::function.179" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.461 = type { ptr }
%"class.__gnu_cxx::__normal_iterator.456" = type { ptr }
%"class.HIR::Visitor" = type { ptr, ptr }
%"class.HIR::Union" = type { %"class.HIR::GenericParams", i32, %"class.std::vector.233", %"struct.HIR::TraitMarkings" }
%"class.HIR::GenericParams" = type { %"class.std::vector.188", %"class.std::vector.193", %"class.std::vector.198", %"class.std::vector.203" }
%"class.std::vector.188" = type { %"struct.std::_Vector_base.189" }
%"struct.std::_Vector_base.189" = type { %"struct.std::_Vector_base<HIR::TypeParamDef, std::allocator<HIR::TypeParamDef>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::TypeParamDef, std::allocator<HIR::TypeParamDef>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::TypeParamDef, std::allocator<HIR::TypeParamDef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::TypeParamDef, std::allocator<HIR::TypeParamDef>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.193" = type { %"struct.std::_Vector_base.194" }
%"struct.std::_Vector_base.194" = type { %"struct.std::_Vector_base<HIR::LifetimeDef, std::allocator<HIR::LifetimeDef>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::LifetimeDef, std::allocator<HIR::LifetimeDef>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::LifetimeDef, std::allocator<HIR::LifetimeDef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::LifetimeDef, std::allocator<HIR::LifetimeDef>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.198" = type { %"struct.std::_Vector_base.199" }
%"struct.std::_Vector_base.199" = type { %"struct.std::_Vector_base<HIR::ValueParamDef, std::allocator<HIR::ValueParamDef>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::ValueParamDef, std::allocator<HIR::ValueParamDef>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::ValueParamDef, std::allocator<HIR::ValueParamDef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::ValueParamDef, std::allocator<HIR::ValueParamDef>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.203" = type { %"struct.std::_Vector_base.204" }
%"struct.std::_Vector_base.204" = type { %"struct.std::_Vector_base<HIR::GenericBound, std::allocator<HIR::GenericBound>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::GenericBound, std::allocator<HIR::GenericBound>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::GenericBound, std::allocator<HIR::GenericBound>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::GenericBound, std::allocator<HIR::GenericBound>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.233" = type { %"struct.std::_Vector_base.234" }
%"struct.std::_Vector_base.234" = type { %"struct.std::_Vector_base<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>, std::allocator<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>, std::allocator<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>, std::allocator<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>, std::allocator<std::pair<RcString, HIR::VisEnt<HIR::TypeRef>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.HIR::TraitMarkings" = type { i8, i8, i8, %"class.std::map.213" }
%"class.std::map.213" = type { %"class.std::_Rb_tree.214" }
%"class.std::_Rb_tree.214" = type { %"struct.std::_Rb_tree<HIR::SimplePath, std::pair<const HIR::SimplePath, HIR::TraitMarkings::AutoMarking>, std::_Select1st<std::pair<const HIR::SimplePath, HIR::TraitMarkings::AutoMarking>>, std::less<HIR::SimplePath>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<HIR::SimplePath, std::pair<const HIR::SimplePath, HIR::TraitMarkings::AutoMarking>, std::_Select1st<std::pair<const HIR::SimplePath, HIR::TraitMarkings::AutoMarking>>, std::less<HIR::SimplePath>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair.457" = type { %class.RcString, %"struct.HIR::VisEnt.455" }
%class.RcString = type { ptr }
%"struct.HIR::VisEnt.455" = type { %"class.HIR::Publicity", %"class.HIR::TypeRef" }
%"class.HIR::Publicity" = type { %"class.std::shared_ptr" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.HIR::TypeRef" = type { ptr }

@__func__._ZN3HIR7Visitor11visit_unionENS_8ItemPathERNS_5UnionE = external hidden unnamed_addr constant [12 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

declare noundef zeroext i1 @_Z13debug_enabledv() #1

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

declare void @_ZN8TraceLogC1EPKcSt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, ptr noundef) unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN18StaticTraitResolve21set_impl_generics_rawE12MetadataTypeRKN3HIR13GenericParamsE(ptr noundef nonnull align 8 dereferenceable(424), i32 noundef, ptr noundef nonnull align 8 dereferenceable(96)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN18StaticTraitResolve19clear_impl_genericsEv(ptr noundef nonnull align 8 dereferenceable(424)) #4 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3HIR7Visitor11visit_unionENS_8ItemPathERNS_5UnionE(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef byval(%"class.HIR::ItemPath") align 8 %1, ptr noundef nonnull align 8 dereferenceable(184) %2) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %class.TraceLog, align 8
  %7 = alloca %"class.std::function.179", align 8
  %8 = alloca %class.anon.461, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.456", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.456", align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %2, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr %6) #6
  %16 = call noundef zeroext i1 @_Z13debug_enabledv()
  %17 = zext i1 %16 to i64
  %18 = select i1 %16, ptr @__func__._ZN3HIR7Visitor11visit_unionENS_8ItemPathERNS_5UnionE, ptr null
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %19 = getelementptr inbounds %class.anon.461, ptr %8, i32 0, i32 0
  store ptr %1, ptr %19, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZN3HIR7Visitor11visit_unionENS4_8ItemPathERNS4_5UnionEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  invoke void @_ZN8TraceLogC1EPKcSt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef %18, ptr noundef %7)
          to label %20 unwind label %30

20:                                               ; preds = %3
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %21 = getelementptr inbounds %"class.HIR::Visitor", ptr %15, i32 0, i32 1
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %38

24:                                               ; preds = %20
  %25 = getelementptr inbounds %"class.HIR::Visitor", ptr %15, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %"class.HIR::Union", ptr %27, i32 0, i32 0
  invoke void @_ZN18StaticTraitResolve21set_impl_generics_rawE12MetadataTypeRKN3HIR13GenericParamsE(ptr noundef nonnull align 8 dereferenceable(424) %26, i32 noundef 0, ptr noundef nonnull align 8 dereferenceable(96) %28)
          to label %29 unwind label %34

29:                                               ; preds = %24
  br label %38

30:                                               ; preds = %3
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %9, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %10, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %81

34:                                               ; preds = %75, %38, %24
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %9, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %10, align 4
  br label %80

38:                                               ; preds = %29, %20
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.HIR::Union", ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %15, align 8, !tbaa !11
  %42 = getelementptr inbounds ptr, ptr %41, i64 17
  %43 = load ptr, ptr %42, align 8
  invoke void %43(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(96) %40)
          to label %44 unwind label %34

44:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.HIR::Union", ptr %45, i32 0, i32 2
  store ptr %46, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = call ptr @_ZNSt6vectorISt4pairI8RcStringN3HIR6VisEntINS2_7TypeRefEEEESaIS6_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #6
  %49 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.456", ptr %12, i32 0, i32 0
  store ptr %48, ptr %49, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = call ptr @_ZNSt6vectorISt4pairI8RcStringN3HIR6VisEntINS2_7TypeRefEEEESaIS6_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #6
  %52 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.456", ptr %13, i32 0, i32 0
  store ptr %51, ptr %52, align 8
  br label %53

53:                                               ; preds = %65, %44
  %54 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  br i1 %54, label %56, label %55

55:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %71

56:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %57 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  store ptr %57, ptr %14, align 8, !tbaa !5
  %58 = load ptr, ptr %14, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.std::pair.457", ptr %58, i32 0, i32 1
  %60 = getelementptr inbounds %"struct.HIR::VisEnt.455", ptr %59, i32 0, i32 1
  %61 = load ptr, ptr %15, align 8, !tbaa !11
  %62 = getelementptr inbounds ptr, ptr %61, i64 21
  %63 = load ptr, ptr %62, align 8
  invoke void %63(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %60)
          to label %64 unwind label %67

64:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %65

65:                                               ; preds = %64
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  br label %53

67:                                               ; preds = %56
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %9, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %80

71:                                               ; preds = %55
  %72 = getelementptr inbounds %"class.HIR::Visitor", ptr %15, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %79

75:                                               ; preds = %71
  %76 = getelementptr inbounds %"class.HIR::Visitor", ptr %15, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  invoke void @_ZN18StaticTraitResolve19clear_impl_genericsEv(ptr noundef nonnull align 8 dereferenceable(424) %77)
          to label %78 unwind label %34

78:                                               ; preds = %75
  br label %79

79:                                               ; preds = %78, %71
  call void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #6
  ret void

80:                                               ; preds = %67, %34
  call void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #6
  br label %81

81:                                               ; preds = %80, %30
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #6
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %9, align 8
  %84 = load i32, ptr %10, align 4
  %85 = insertvalue { ptr, i32 } poison, ptr %83, 0
  %86 = insertvalue { ptr, i32 } %85, i32 %84, 1
  resume { ptr, i32 } %86
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvRSoEEC2IZN3HIR7Visitor11visit_unionENS4_8ItemPathERNS4_5UnionEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { 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 = { 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 #5 = { inlinehint 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 #6 = { 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, !6, i64 8}
!10 = !{!"_ZTSN3HIR7VisitorE", !6, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, 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"

%"class.HIR::ItemPath" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%class.TraceLog = type { ptr, %"class.std::function.179" }
%"class.std::function.179" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.461 = type { ptr }
%"class.__gnu_cxx::__normal_iterator.456" = type { ptr }

@__func__._ZN3HIR7Visitor11visit_unionENS_8ItemPathERNS_5UnionE = external hidden unnamed_addr constant [12 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

declare noundef zeroext i1 @_Z13debug_enabledv() local_unnamed_addr #1

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

declare void @_ZN8TraceLogC1EPKcSt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, ptr noundef) unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN18StaticTraitResolve21set_impl_generics_rawE12MetadataTypeRKN3HIR13GenericParamsE(ptr noundef nonnull align 8 dereferenceable(424), i32 noundef, ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN18StaticTraitResolve19clear_impl_genericsEv(ptr noundef nonnull align 8 dereferenceable(424)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairI8RcStringN3HIR6VisEntINS2_7TypeRefEEEESaIS6_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairI8RcStringN3HIR6VisEntINS2_7TypeRefEEEESaIS6_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3HIR7Visitor11visit_unionENS_8ItemPathERNS_5UnionE(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef byval(%"class.HIR::ItemPath") align 8 %1, ptr noundef nonnull align 8 dereferenceable(184) %2) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.TraceLog, align 8
  %5 = alloca %"class.std::function.179", align 8
  %6 = alloca %class.anon.461, align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.456", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.456", align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #6
  %9 = tail call noundef zeroext i1 @_Z13debug_enabledv()
  %10 = select i1 %9, ptr @__func__._ZN3HIR7Visitor11visit_unionENS_8ItemPathERNS_5UnionE, ptr null
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store ptr %1, ptr %6, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZN3HIR7Visitor11visit_unionENS4_8ItemPathERNS4_5UnionEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  invoke void @_ZN8TraceLogC1EPKcSt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef %10, ptr noundef nonnull %5)
          to label %11 unwind label %15

11:                                               ; preds = %3
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %.not = icmp eq ptr %13, null
  br i1 %.not, label %19, label %14

14:                                               ; preds = %11
  invoke void @_ZN18StaticTraitResolve21set_impl_generics_rawE12MetadataTypeRKN3HIR13GenericParamsE(ptr noundef nonnull align 8 dereferenceable(424) %13, i32 noundef 0, ptr noundef nonnull align 8 dereferenceable(96) %2)
          to label %19 unwind label %17

15:                                               ; preds = %3
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %42

17:                                               ; preds = %39, %19, %14
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %41

19:                                               ; preds = %14, %11
  %20 = load ptr, ptr %0, align 8, !tbaa !11
  %21 = getelementptr inbounds i8, ptr %20, i64 136
  %22 = load ptr, ptr %21, align 8
  invoke void %22(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(96) %2)
          to label %23 unwind label %17

23:                                               ; preds = %19
  %24 = getelementptr inbounds i8, ptr %2, i64 104
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %25 = call ptr @_ZNSt6vectorISt4pairI8RcStringN3HIR6VisEntINS2_7TypeRefEEEESaIS6_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #6
  store ptr %25, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %26 = call ptr @_ZNSt6vectorISt4pairI8RcStringN3HIR6VisEntINS2_7TypeRefEEEESaIS6_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #6
  store ptr %26, ptr %8, align 8
  %27 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br i1 %27, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %34, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %28 = load ptr, ptr %12, align 8, !tbaa !9
  %.not12 = icmp eq ptr %28, null
  br i1 %.not12, label %40, label %39

.lr.ph:                                           ; preds = %23, %34
  %29 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %30 = getelementptr inbounds i8, ptr %29, i64 24
  %31 = load ptr, ptr %0, align 8, !tbaa !11
  %32 = getelementptr inbounds i8, ptr %31, i64 168
  %33 = load ptr, ptr %32, align 8
  invoke void %33(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %34 unwind label %37

34:                                               ; preds = %.lr.ph
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %36 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairI8RcStringN3HIR6VisEntINS3_7TypeRefEEEESt6vectorIS7_SaIS7_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br i1 %36, label %.lr.ph, label %._crit_edge

37:                                               ; preds = %.lr.ph
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %41

39:                                               ; preds = %._crit_edge
  invoke void @_ZN18StaticTraitResolve19clear_impl_genericsEv(ptr noundef nonnull align 8 dereferenceable(424) %28)
          to label %40 unwind label %17

40:                                               ; preds = %39, %._crit_edge
  call void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  ret void

41:                                               ; preds = %37, %17
  %.pn = phi { ptr, i32 } [ %38, %37 ], [ %18, %17 ]
  call void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #6
  br label %42

42:                                               ; preds = %41, %15
  %.pn.pn = phi { ptr, i32 } [ %.pn, %41 ], [ %16, %15 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvRSoEEC2IZN3HIR7Visitor11visit_unionENS4_8ItemPathERNS4_5UnionEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { 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 = { 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 #5 = { inlinehint 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 #6 = { 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, !6, i64 8}
!10 = !{!"_ZTSN3HIR7VisitorE", !6, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass