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

; 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.463 = type { ptr }
%"class.__gnu_cxx::__normal_iterator.464" = type { ptr }
%"class.HIR::Visitor" = type { ptr, ptr }
%"class.HIR::Function" = type { i8, %"struct.HIR::Linkage", i32, %"class.HIR::TypeRef", %class.RcString, i8, i8, %"class.HIR::GenericParams", %"class.std::vector.338", i8, %"class.HIR::TypeRef", %"class.HIR::ExprPtr", %"struct.HIR::Function::Markings" }
%"struct.HIR::Linkage" = type { i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }
%"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] }
%class.RcString = type { ptr }
%"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.338" = type { %"struct.std::_Vector_base.339" }
%"struct.std::_Vector_base.339" = type { %"struct.std::_Vector_base<std::pair<HIR::Pattern, HIR::TypeRef>, std::allocator<std::pair<HIR::Pattern, HIR::TypeRef>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<HIR::Pattern, HIR::TypeRef>, std::allocator<std::pair<HIR::Pattern, HIR::TypeRef>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<HIR::Pattern, HIR::TypeRef>, std::allocator<std::pair<HIR::Pattern, HIR::TypeRef>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<HIR::Pattern, HIR::TypeRef>, std::allocator<std::pair<HIR::Pattern, HIR::TypeRef>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.HIR::TypeRef" = type { ptr }
%"class.HIR::ExprPtr" = type { %"class.HIR::ExprPtrInner", %"class.std::vector.314", %"class.std::vector.314", %"class.MIR::FunctionPointer", %"class.HIR::ExprStatePtr" }
%"class.HIR::ExprPtrInner" = type { ptr }
%"class.std::vector.314" = type { %"struct.std::_Vector_base.315" }
%"struct.std::_Vector_base.315" = type { %"struct.std::_Vector_base<HIR::TypeRef, std::allocator<HIR::TypeRef>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::TypeRef, std::allocator<HIR::TypeRef>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::TypeRef, std::allocator<HIR::TypeRef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::TypeRef, std::allocator<HIR::TypeRef>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.MIR::FunctionPointer" = type { ptr }
%"class.HIR::ExprStatePtr" = type { ptr }
%"struct.HIR::Function::Markings" = type { %"class.std::vector.343", i8, i32 }
%"class.std::vector.343" = type { %"struct.std::_Vector_base.344" }
%"struct.std::_Vector_base.344" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair.465" = type { %"struct.HIR::Pattern", %"class.HIR::TypeRef" }
%"struct.HIR::Pattern" = type <{ %"class.std::vector.467", %"class.HIR::Pattern::Data", i32, [4 x i8] }>
%"class.std::vector.467" = type { %"struct.std::_Vector_base.468" }
%"struct.std::_Vector_base.468" = type { %"struct.std::_Vector_base<HIR::PatternBinding, std::allocator<HIR::PatternBinding>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::PatternBinding, std::allocator<HIR::PatternBinding>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::PatternBinding, std::allocator<HIR::PatternBinding>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::PatternBinding, std::allocator<HIR::PatternBinding>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.HIR::Pattern::Data" = type { i32, %"union.HIR::Pattern::Data::DataUnion" }
%"union.HIR::Pattern::Data::DataUnion" = type { %"struct.HIR::Pattern::Data::Data_PathValue", [64 x i8] }
%"struct.HIR::Pattern::Data::Data_PathValue" = type { %"class.HIR::Path", %"class.HIR::Pattern::PathBinding" }
%"class.HIR::Path" = type { %"class.HIR::Path::Data" }
%"class.HIR::Path::Data" = type { i32, %"union.HIR::Path::Data::DataUnion" }
%"union.HIR::Path::Data::DataUnion" = type { %"struct.HIR::Path::Data::Data_UfcsKnown" }
%"struct.HIR::Path::Data::Data_UfcsKnown" = type { %"class.HIR::TypeRef", %"class.HIR::GenericPath", %class.RcString, %"struct.HIR::PathParams", %"class.std::unique_ptr.428" }
%"class.HIR::GenericPath" = type { %"struct.HIR::SimplePath", %"struct.HIR::PathParams" }
%"struct.HIR::SimplePath" = type { %class.ThinVector }
%class.ThinVector = type { ptr }
%"struct.HIR::PathParams" = type { %class.ThinVector.388, %class.ThinVector.389, %class.ThinVector.390 }
%class.ThinVector.388 = type { ptr }
%class.ThinVector.389 = type { ptr }
%class.ThinVector.390 = type { ptr }
%"class.std::unique_ptr.428" = type { %"struct.std::__uniq_ptr_data.429" }
%"struct.std::__uniq_ptr_data.429" = type { %"class.std::__uniq_ptr_impl.430" }
%"class.std::__uniq_ptr_impl.430" = type { %"class.std::tuple.431" }
%"class.std::tuple.431" = type { %"struct.std::_Tuple_impl.432" }
%"struct.std::_Tuple_impl.432" = type { %"struct.std::_Head_base.435" }
%"struct.std::_Head_base.435" = type { ptr }
%"class.HIR::Pattern::PathBinding" = type { i32, %"union.HIR::Pattern::PathBinding::DataUnion" }
%"union.HIR::Pattern::PathBinding::DataUnion" = type { %"struct.HIR::Pattern::PathBinding::Data_Enum" }
%"struct.HIR::Pattern::PathBinding::Data_Enum" = type { ptr, i32 }

@__func__._ZN3HIR7Visitor14visit_functionENS_8ItemPathERNS_8FunctionE = external hidden unnamed_addr constant [15 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
define dso_local void @_ZN3HIR7Visitor14visit_functionENS_8ItemPathERNS_8FunctionE(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef byval(%"class.HIR::ItemPath") align 8 %1, ptr noundef nonnull align 8 dereferenceable(352) %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.463, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.464", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.464", 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__._ZN3HIR7Visitor14visit_functionENS_8ItemPathERNS_8FunctionE, ptr null
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %19 = getelementptr inbounds %class.anon.463, ptr %8, i32 0, i32 0
  store ptr %1, ptr %19, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZN3HIR7Visitor14visit_functionENS4_8ItemPathERNS4_8FunctionEE3$_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::Function", ptr %27, i32 0, i32 7
  invoke void @_ZN18StaticTraitResolve21set_item_generics_rawERKN3HIR13GenericParamsE(ptr noundef nonnull align 8 dereferenceable(424) %26, 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 %98

34:                                               ; preds = %92, %82, %76, %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 %97

38:                                               ; preds = %29, %20
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.HIR::Function", ptr %39, i32 0, i32 7
  %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::Function", ptr %45, i32 0, i32 8
  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 @_ZNSt6vectorISt4pairIN3HIR7PatternENS1_7TypeRefEESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #6
  %49 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.464", 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 @_ZNSt6vectorISt4pairIN3HIR7PatternENS1_7TypeRefEESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #6
  %52 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.464", ptr %13, i32 0, i32 0
  store ptr %51, ptr %52, align 8
  br label %53

53:                                               ; preds = %70, %44
  %54 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(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 %76

56:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %57 = call noundef nonnull align 8 dereferenceable(224) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_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.465", ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %15, align 8, !tbaa !11
  %61 = getelementptr inbounds ptr, ptr %60, i64 19
  %62 = load ptr, ptr %61, align 8
  invoke void %62(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(212) %59)
          to label %63 unwind label %72

63:                                               ; preds = %56
  %64 = load ptr, ptr %14, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.std::pair.465", ptr %64, i32 0, i32 1
  %66 = load ptr, ptr %15, align 8, !tbaa !11
  %67 = getelementptr inbounds ptr, ptr %66, i64 21
  %68 = load ptr, ptr %67, align 8
  invoke void %68(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %65)
          to label %69 unwind label %72

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

70:                                               ; preds = %69
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  br label %53

72:                                               ; preds = %63, %56
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %9, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, 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 %97

76:                                               ; preds = %55
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %"class.HIR::Function", ptr %77, i32 0, i32 10
  %79 = load ptr, ptr %15, align 8, !tbaa !11
  %80 = getelementptr inbounds ptr, ptr %79, i64 21
  %81 = load ptr, ptr %80, align 8
  invoke void %81(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %78)
          to label %82 unwind label %34

82:                                               ; preds = %76
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.HIR::Function", ptr %83, i32 0, i32 11
  %85 = load ptr, ptr %15, align 8, !tbaa !11
  %86 = getelementptr inbounds ptr, ptr %85, i64 27
  %87 = load ptr, ptr %86, align 8
  invoke void %87(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(72) %84)
          to label %88 unwind label %34

88:                                               ; preds = %82
  %89 = getelementptr inbounds %"class.HIR::Visitor", ptr %15, i32 0, i32 1
  %90 = load ptr, ptr %89, align 8, !tbaa !9
  %91 = icmp ne ptr %90, null
  br i1 %91, label %92, label %96

92:                                               ; preds = %88
  %93 = getelementptr inbounds %"class.HIR::Visitor", ptr %15, i32 0, i32 1
  %94 = load ptr, ptr %93, align 8, !tbaa !9
  invoke void @_ZN18StaticTraitResolve19clear_item_genericsEv(ptr noundef nonnull align 8 dereferenceable(424) %94)
          to label %95 unwind label %34

95:                                               ; preds = %92
  br label %96

96:                                               ; preds = %95, %88
  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

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

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

99:                                               ; preds = %98
  %100 = load ptr, ptr %9, align 8
  %101 = load i32, ptr %10, align 4
  %102 = insertvalue { ptr, i32 } poison, ptr %100, 0
  %103 = insertvalue { ptr, i32 } %102, i32 %101, 1
  resume { ptr, i32 } %103
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIN3HIR7PatternENS1_7TypeRefEESaIS4_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_cxxneIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(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(224) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_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_iteratorIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN18StaticTraitResolve19clear_item_genericsEv(ptr noundef nonnull align 8 dereferenceable(424)) #4 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.463 = type { ptr }
%"class.__gnu_cxx::__normal_iterator.464" = type { ptr }

@__func__._ZN3HIR7Visitor14visit_functionENS_8ItemPathERNS_8FunctionE = external hidden unnamed_addr constant [15 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
define dso_local void @_ZN3HIR7Visitor14visit_functionENS_8ItemPathERNS_8FunctionE(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef byval(%"class.HIR::ItemPath") align 8 %1, ptr noundef nonnull align 8 dereferenceable(352) %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.463, align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.464", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.464", 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__._ZN3HIR7Visitor14visit_functionENS_8ItemPathERNS_8FunctionE, 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 @"_ZNSt8functionIFvRSoEEC2IZN3HIR7Visitor14visit_functionENS4_8ItemPathERNS4_8FunctionEE3$_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 %16

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 %20, label %14

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %2, i64 112
  invoke void @_ZN18StaticTraitResolve21set_item_generics_rawERKN3HIR13GenericParamsE(ptr noundef nonnull align 8 dereferenceable(424) %13, ptr noundef nonnull align 8 dereferenceable(96) %15)
          to label %20 unwind label %18

16:                                               ; preds = %3
  %17 = 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 %58

18:                                               ; preds = %55, %48, %._crit_edge, %20, %14
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %57

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

25:                                               ; preds = %20
  %26 = getelementptr inbounds i8, ptr %2, i64 208
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %27 = call ptr @_ZNSt6vectorISt4pairIN3HIR7PatternENS1_7TypeRefEESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #6
  store ptr %27, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %28 = call ptr @_ZNSt6vectorISt4pairIN3HIR7PatternENS1_7TypeRefEESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #6
  store ptr %28, ptr %8, align 8
  %29 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br i1 %29, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %43, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %30 = getelementptr inbounds i8, ptr %2, i64 240
  %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 %48 unwind label %18

.lr.ph:                                           ; preds = %25, %43
  %34 = call noundef nonnull align 8 dereferenceable(224) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %35 = load ptr, ptr %0, align 8, !tbaa !11
  %36 = getelementptr inbounds i8, ptr %35, i64 152
  %37 = load ptr, ptr %36, align 8
  invoke void %37(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(212) %34)
          to label %38 unwind label %46

38:                                               ; preds = %.lr.ph
  %39 = getelementptr inbounds i8, ptr %34, i64 216
  %40 = load ptr, ptr %0, align 8, !tbaa !11
  %41 = getelementptr inbounds i8, ptr %40, i64 168
  %42 = load ptr, ptr %41, align 8
  invoke void %42(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %39)
          to label %43 unwind label %46

43:                                               ; preds = %38
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %45 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br i1 %45, label %.lr.ph, label %._crit_edge

46:                                               ; preds = %38, %.lr.ph
  %47 = 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 %57

48:                                               ; preds = %._crit_edge
  %49 = getelementptr inbounds i8, ptr %2, i64 248
  %50 = load ptr, ptr %0, align 8, !tbaa !11
  %51 = getelementptr inbounds i8, ptr %50, i64 216
  %52 = load ptr, ptr %51, align 8
  invoke void %52(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(72) %49)
          to label %53 unwind label %18

53:                                               ; preds = %48
  %54 = load ptr, ptr %12, align 8, !tbaa !9
  %.not15 = icmp eq ptr %54, null
  br i1 %.not15, label %56, label %55

55:                                               ; preds = %53
  invoke void @_ZN18StaticTraitResolve19clear_item_genericsEv(ptr noundef nonnull align 8 dereferenceable(424) %54)
          to label %56 unwind label %18

56:                                               ; preds = %55, %53
  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

57:                                               ; preds = %46, %18
  %.pn = phi { ptr, i32 } [ %47, %46 ], [ %19, %18 ]
  call void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #6
  br label %58

58:                                               ; preds = %57, %16
  %.pn.pn = phi { ptr, i32 } [ %.pn, %57 ], [ %17, %16 ]
  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 @"_ZNSt8functionIFvRSoEEC2IZN3HIR7Visitor14visit_functionENS4_8ItemPathERNS4_8FunctionEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIN3HIR7PatternENS1_7TypeRefEESaIS4_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_cxxneIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(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(224) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_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_iteratorIPSt4pairIN3HIR7PatternENS2_7TypeRefEESt6vectorIS5_SaIS5_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN18StaticTraitResolve19clear_item_genericsEv(ptr noundef nonnull align 8 dereferenceable(424)) local_unnamed_addr #4 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