; LLVM IR from thepowersgang/mrustc :: src/hir_typeck (helpers)

; 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::TypeRef" = type { ptr }
%struct.Span = type { ptr }
%"class.std::function" = 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.683 = type { ptr, ptr, ptr }
%class.TraitResolution = type { %struct.TraitResolveCommon, ptr, ptr, ptr, ptr, ptr, %"class.std::vector.216" }
%struct.TraitResolveCommon = type { ptr, ptr, ptr, %"class.std::map.205", %class.RangeVecMap, %"struct.HIR::SimplePath", %"struct.HIR::SimplePath", %"struct.HIR::SimplePath", %"struct.HIR::SimplePath", %"struct.HIR::SimplePath", %"struct.HIR::SimplePath", %"struct.HIR::SimplePath", %"struct.HIR::SimplePath", %"struct.HIR::SimplePath", %"struct.HIR::SimplePath", %"struct.HIR::SimplePath", %"struct.HIR::SimplePath", %"struct.HIR::SimplePath", %"struct.HIR::SimplePath" }
%"class.std::map.205" = type { %"class.std::_Rb_tree.206" }
%"class.std::_Rb_tree.206" = type { %"struct.std::_Rb_tree<HIR::TypeRef, std::pair<const HIR::TypeRef, TraitResolveCommon::CachedEquality>, std::_Select1st<std::pair<const HIR::TypeRef, TraitResolveCommon::CachedEquality>>, std::less<HIR::TypeRef>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<HIR::TypeRef, std::pair<const HIR::TypeRef, TraitResolveCommon::CachedEquality>, std::_Select1st<std::pair<const HIR::TypeRef, TraitResolveCommon::CachedEquality>>, std::less<HIR::TypeRef>>::_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 }
%class.RangeVecMap = type <{ %"class.std::vector.211", [8 x i8] }>
%"class.std::vector.211" = type { %"struct.std::_Vector_base.212" }
%"struct.std::_Vector_base.212" = type { %"struct.std::_Vector_base<std::unique_ptr<std::pair<std::pair<HIR::TypeRef, HIR::GenericPath>, TraitResolveCommon::CachedBound>>, std::allocator<std::unique_ptr<std::pair<std::pair<HIR::TypeRef, HIR::GenericPath>, TraitResolveCommon::CachedBound>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unique_ptr<std::pair<std::pair<HIR::TypeRef, HIR::GenericPath>, TraitResolveCommon::CachedBound>>, std::allocator<std::unique_ptr<std::pair<std::pair<HIR::TypeRef, HIR::GenericPath>, TraitResolveCommon::CachedBound>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unique_ptr<std::pair<std::pair<HIR::TypeRef, HIR::GenericPath>, TraitResolveCommon::CachedBound>>, std::allocator<std::unique_ptr<std::pair<std::pair<HIR::TypeRef, HIR::GenericPath>, TraitResolveCommon::CachedBound>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unique_ptr<std::pair<std::pair<HIR::TypeRef, HIR::GenericPath>, TraitResolveCommon::CachedBound>>, std::allocator<std::unique_ptr<std::pair<std::pair<HIR::TypeRef, HIR::GenericPath>, TraitResolveCommon::CachedBound>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.HIR::SimplePath" = type { %class.ThinVector }
%class.ThinVector = type { ptr }
%"class.std::vector.216" = type { %"struct.std::_Vector_base.217" }
%"struct.std::_Vector_base.217" = type { %"struct.std::_Vector_base<std::unique_ptr<HIR::TypeRef>, std::allocator<std::unique_ptr<HIR::TypeRef>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unique_ptr<HIR::TypeRef>, std::allocator<std::unique_ptr<HIR::TypeRef>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unique_ptr<HIR::TypeRef>, std::allocator<std::unique_ptr<HIR::TypeRef>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unique_ptr<HIR::TypeRef>, std::allocator<std::unique_ptr<HIR::TypeRef>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.HIR::TypeData::Data_Borrow" = type { %"struct.HIR::LifetimeRef", i32, %"class.HIR::TypeRef" }
%"struct.HIR::LifetimeRef" = type { i32 }
%"struct.HIR::TypeData_Path" = type { %"class.HIR::Path", %"class.HIR::TypePathBinding", %"class.std::unique_ptr.29" }
%"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.29" }
%"class.HIR::GenericPath" = type { %"struct.HIR::SimplePath", %"struct.HIR::PathParams" }
%class.RcString = type { ptr }
%"struct.HIR::PathParams" = type { %class.ThinVector.26, %class.ThinVector.27, %class.ThinVector.28 }
%class.ThinVector.26 = type { ptr }
%class.ThinVector.27 = type { ptr }
%class.ThinVector.28 = type { ptr }
%"class.HIR::TypePathBinding" = type { i32, %"union.HIR::TypePathBinding::DataUnion" }
%"union.HIR::TypePathBinding::DataUnion" = type { ptr }
%"class.std::unique_ptr.29" = type { %"struct.std::__uniq_ptr_data.30" }
%"struct.std::__uniq_ptr_data.30" = type { %"class.std::__uniq_ptr_impl.31" }
%"class.std::__uniq_ptr_impl.31" = type { %"class.std::tuple.32" }
%"class.std::tuple.32" = type { %"struct.std::_Tuple_impl.33" }
%"struct.std::_Tuple_impl.33" = type { %"struct.std::_Head_base.36" }
%"struct.std::_Head_base.36" = type { ptr }

@_ZTISt13runtime_error = external constant ptr
@.str.70 = external hidden unnamed_addr constant [24 x i8], align 1
@__func__._ZNK15TraitResolution20autoderef_find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS4_ = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16HMTypeInferrence4dumpEv(ptr noundef nonnull align 8 dereferenceable(49)) #0 align 2

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

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) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3HIR8TypeData8is_InferEv(ptr noundef nonnull align 8 dereferenceable(184)) #3 align 2

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

declare void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

; Function Attrs: nounwind
declare void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #4

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK16HMTypeInferrence8get_typeERKN3HIR7TypeRefE(ptr noundef nonnull align 8 dereferenceable(49), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

declare void @_ZN4SpanC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3HIR8TypeData7is_PathEv(ptr noundef nonnull align 8 dereferenceable(184)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3HIR15TypePathBinding10is_UnboundEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3HIR7TypeRefC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK15TraitResolution9autoderefERK4SpanRKN3HIR7TypeRefERS4_(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK15TraitResolution20autoderef_find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS4_(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #0 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.HIR::TypeRef", align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca %struct.Span, align 8
  %23 = alloca %"class.std::function", align 8
  %24 = alloca %class.anon.683, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %25 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @_ZN3HIR7TypeRefC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %26, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %27 = getelementptr inbounds %class.TraitResolution, ptr %25, i32 0, i32 2
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK16HMTypeInferrence8get_typeERKN3HIR7TypeRefE(ptr noundef nonnull align 8 dereferenceable(49) %28, ptr noundef nonnull align 8 dereferenceable(8) %29)
          to label %31 unwind label %43

31:                                               ; preds = %5
  %32 = invoke noundef nonnull align 8 dereferenceable(184) ptr @_ZNK3HIR7TypeRef4dataEv(ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %33 unwind label %43

33:                                               ; preds = %31
  %34 = invoke noundef ptr @_ZNK3HIR8TypeData10opt_BorrowEv(ptr noundef nonnull align 8 dereferenceable(184) %32)
          to label %35 unwind label %43

35:                                               ; preds = %33
  store ptr %34, ptr %15, align 8, !tbaa !5
  %36 = load ptr, ptr %15, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %47

38:                                               ; preds = %35
  %39 = load ptr, ptr %15, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.HIR::TypeData::Data_Borrow", ptr %39, i32 0, i32 2
  store ptr %40, ptr %14, align 8, !tbaa !5
  %41 = load i32, ptr %12, align 4, !tbaa !9
  %42 = add i32 %41, 1
  store i32 %42, ptr %12, align 4, !tbaa !9
  br label %47

43:                                               ; preds = %33, %31, %5
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %16, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %181

47:                                               ; preds = %38, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %48

48:                                               ; preds = %99, %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %49 = getelementptr inbounds %class.TraitResolution, ptr %25, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !11
  %51 = load ptr, ptr %14, align 8, !tbaa !5
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK16HMTypeInferrence8get_typeERKN3HIR7TypeRefE(ptr noundef nonnull align 8 dereferenceable(49) %50, ptr noundef nonnull align 8 dereferenceable(8) %51)
          to label %53 unwind label %60

53:                                               ; preds = %48
  store ptr %52, ptr %18, align 8, !tbaa !5
  %54 = load ptr, ptr %18, align 8, !tbaa !5
  %55 = invoke noundef nonnull align 8 dereferenceable(184) ptr @_ZNK3HIR7TypeRef4dataEv(ptr noundef nonnull align 8 dereferenceable(8) %54)
          to label %56 unwind label %60

56:                                               ; preds = %53
  %57 = invoke noundef zeroext i1 @_ZNK3HIR8TypeData8is_InferEv(ptr noundef nonnull align 8 dereferenceable(184) %55)
          to label %58 unwind label %60

58:                                               ; preds = %56
  br i1 %57, label %59, label %64

59:                                               ; preds = %58
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %96

60:                                               ; preds = %89, %80, %75, %73, %70, %67, %64, %56, %53, %48
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %16, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %181

64:                                               ; preds = %58
  %65 = load ptr, ptr %18, align 8, !tbaa !5
  %66 = invoke noundef nonnull align 8 dereferenceable(184) ptr @_ZNK3HIR7TypeRef4dataEv(ptr noundef nonnull align 8 dereferenceable(8) %65)
          to label %67 unwind label %60

67:                                               ; preds = %64
  %68 = invoke noundef zeroext i1 @_ZNK3HIR8TypeData7is_PathEv(ptr noundef nonnull align 8 dereferenceable(184) %66)
          to label %69 unwind label %60

69:                                               ; preds = %67
  br i1 %68, label %70, label %80

70:                                               ; preds = %69
  %71 = load ptr, ptr %18, align 8, !tbaa !5
  %72 = invoke noundef nonnull align 8 dereferenceable(184) ptr @_ZNK3HIR7TypeRef4dataEv(ptr noundef nonnull align 8 dereferenceable(8) %71)
          to label %73 unwind label %60

73:                                               ; preds = %70
  %74 = invoke noundef nonnull align 8 dereferenceable(112) ptr @_ZNK3HIR8TypeData7as_PathEv(ptr noundef nonnull align 8 dereferenceable(184) %72)
          to label %75 unwind label %60

75:                                               ; preds = %73
  %76 = getelementptr inbounds %"struct.HIR::TypeData_Path", ptr %74, i32 0, i32 1
  %77 = invoke noundef zeroext i1 @_ZNK3HIR15TypePathBinding10is_UnboundEv(ptr noundef nonnull align 8 dereferenceable(16) %76)
          to label %78 unwind label %60

78:                                               ; preds = %75
  br i1 %77, label %79, label %80

79:                                               ; preds = %78
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %96

80:                                               ; preds = %78, %69
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = load ptr, ptr %18, align 8, !tbaa !5
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = invoke noundef zeroext i1 @_ZNK15TraitResolution10find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS4_(ptr noundef nonnull align 8 dereferenceable(280) %25, ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef nonnull align 8 dereferenceable(8) %83, ptr noundef nonnull align 8 dereferenceable(8) %84)
          to label %86 unwind label %60

86:                                               ; preds = %80
  br i1 %85, label %87, label %89

87:                                               ; preds = %86
  %88 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %88, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %96

89:                                               ; preds = %86
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = add i32 %90, 1
  store i32 %91, ptr %12, align 4, !tbaa !9
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = load ptr, ptr %18, align 8, !tbaa !5
  %94 = invoke noundef ptr @_ZNK15TraitResolution9autoderefERK4SpanRKN3HIR7TypeRefERS4_(ptr noundef nonnull align 8 dereferenceable(280) %25, ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %95 unwind label %60

95:                                               ; preds = %89
  store ptr %94, ptr %14, align 8, !tbaa !5
  store i32 0, ptr %19, align 4
  br label %96

96:                                               ; preds = %95, %87, %79, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %97 = load i32, ptr %19, align 4
  switch i32 %97, label %179 [
    i32 0, label %98
  ]

98:                                               ; preds = %96
  br label %99

99:                                               ; preds = %98
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  %101 = icmp ne ptr %100, null
  br i1 %101, label %48, label %102, !llvm.loop !35

102:                                              ; preds = %99
  %103 = getelementptr inbounds %class.TraitResolution, ptr %25, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !11
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK16HMTypeInferrence8get_typeERKN3HIR7TypeRefE(ptr noundef nonnull align 8 dereferenceable(49) %104, ptr noundef nonnull align 8 dereferenceable(8) %105)
          to label %107 unwind label %126

107:                                              ; preds = %102
  %108 = invoke noundef nonnull align 8 dereferenceable(184) ptr @_ZNK3HIR7TypeRef4dataEv(ptr noundef nonnull align 8 dereferenceable(8) %106)
          to label %109 unwind label %126

109:                                              ; preds = %107
  %110 = invoke noundef ptr @_ZNK3HIR8TypeData10opt_BorrowEv(ptr noundef nonnull align 8 dereferenceable(184) %108)
          to label %111 unwind label %126

111:                                              ; preds = %109
  %112 = icmp ne ptr %110, null
  br i1 %112, label %113, label %138

113:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %114 = getelementptr inbounds %class.TraitResolution, ptr %25, i32 0, i32 2
  %115 = load ptr, ptr %114, align 8, !tbaa !11
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK16HMTypeInferrence8get_typeERKN3HIR7TypeRefE(ptr noundef nonnull align 8 dereferenceable(49) %115, ptr noundef nonnull align 8 dereferenceable(8) %116)
          to label %118 unwind label %130

118:                                              ; preds = %113
  store ptr %117, ptr %20, align 8, !tbaa !5
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = load ptr, ptr %20, align 8, !tbaa !5
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = invoke noundef zeroext i1 @_ZNK15TraitResolution10find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS4_(ptr noundef nonnull align 8 dereferenceable(280) %25, ptr noundef nonnull align 8 dereferenceable(8) %119, ptr noundef nonnull align 8 dereferenceable(8) %120, ptr noundef nonnull align 8 dereferenceable(8) %121, ptr noundef nonnull align 8 dereferenceable(8) %122)
          to label %124 unwind label %130

124:                                              ; preds = %118
  br i1 %123, label %125, label %134

125:                                              ; preds = %124
  store i32 0, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %135

126:                                              ; preds = %138, %109, %107, %102
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %16, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %17, align 4
  br label %181

130:                                              ; preds = %118, %113
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %16, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %181

134:                                              ; preds = %124
  store i32 0, ptr %19, align 4
  br label %135

135:                                              ; preds = %134, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  %136 = load i32, ptr %19, align 4
  switch i32 %136, label %179 [
    i32 0, label %137
  ]

137:                                              ; preds = %135
  br label %138

138:                                              ; preds = %137, %111
  %139 = getelementptr inbounds %class.TraitResolution, ptr %25, i32 0, i32 2
  %140 = load ptr, ptr %139, align 8, !tbaa !11
  invoke void @_ZNK16HMTypeInferrence4dumpEv(ptr noundef nonnull align 8 dereferenceable(49) %140)
          to label %141 unwind label %126

141:                                              ; preds = %138
  br label %142

142:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  store ptr @__func__._ZNK15TraitResolution20autoderef_find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS4_, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN4SpanC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %143)
          to label %144 unwind label %154

144:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #7
  %145 = getelementptr inbounds %class.anon.683, ptr %24, i32 0, i32 0
  store ptr %21, ptr %145, align 8, !tbaa !5
  %146 = getelementptr inbounds %class.anon.683, ptr %24, i32 0, i32 1
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %147, ptr %146, align 8, !tbaa !5
  %148 = getelementptr inbounds %class.anon.683, ptr %24, i32 0, i32 2
  %149 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %149, ptr %148, align 8, !tbaa !5
  invoke void @"_ZNSt8functionIFvRSoEEC2IZNK15TraitResolution20autoderef_find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS9_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %150 unwind label %158

150:                                              ; preds = %144
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef %23)
          to label %151 unwind label %162

151:                                              ; preds = %150
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  %152 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %152, ptr noundef @.str.70)
          to label %153 unwind label %168

153:                                              ; preds = %151
  invoke void @__cxa_throw(ptr %152, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
          to label %187 unwind label %172

154:                                              ; preds = %142
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %16, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %17, align 4
  br label %167

158:                                              ; preds = %144
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %16, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %17, align 4
  br label %166

162:                                              ; preds = %150
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %16, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %17, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #7
  br label %166

166:                                              ; preds = %162, %158
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  br label %167

167:                                              ; preds = %166, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %176

168:                                              ; preds = %151
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %16, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %17, align 4
  call void @__cxa_free_exception(ptr %152) #7
  br label %176

172:                                              ; preds = %153
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %16, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %17, align 4
  br label %176

176:                                              ; preds = %172, %168, %167
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %181

177:                                              ; No predecessors!
  br label %178

178:                                              ; preds = %177
  unreachable

179:                                              ; preds = %135, %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZN3HIR7TypeRefD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  %180 = load i32, ptr %6, align 4
  ret i32 %180

181:                                              ; preds = %176, %130, %126, %60, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZN3HIR7TypeRefD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %182

182:                                              ; preds = %181
  %183 = load ptr, ptr %16, align 8
  %184 = load i32, ptr %17, align 4
  %185 = insertvalue { ptr, i32 } poison, ptr %183, 0
  %186 = insertvalue { ptr, i32 } %185, i32 %184, 1
  resume { ptr, i32 } %186

187:                                              ; preds = %153
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK15TraitResolution10find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS4_(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 "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 = { inlinehint 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 #7 = { nounwind }
attributes #8 = { noreturn }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 224}
!12 = !{!"_ZTS15TraitResolution", !13, i64 0, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !31, i64 256}
!13 = !{!"_ZTS18TraitResolveCommon", !6, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !23, i64 72, !29, i64 104, !29, i64 112, !29, i64 120, !29, i64 128, !29, i64 136, !29, i64 144, !29, i64 152, !29, i64 160, !29, i64 168, !29, i64 176, !29, i64 184, !29, i64 192, !29, i64 200, !29, i64 208}
!14 = !{!"_ZTSSt3mapIN3HIR7TypeRefEN18TraitResolveCommon14CachedEqualityESt4lessIS1_ESaISt4pairIKS1_S3_EEE", !15, i64 0}
!15 = !{!"_ZTSSt8_Rb_treeIN3HIR7TypeRefESt4pairIKS1_N18TraitResolveCommon14CachedEqualityEESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE", !16, i64 0}
!16 = !{!"_ZTSNSt8_Rb_treeIN3HIR7TypeRefESt4pairIKS1_N18TraitResolveCommon14CachedEqualityEESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE13_Rb_tree_implISA_Lb1EEE", !17, i64 0, !19, i64 8}
!17 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN3HIR7TypeRefEEE", !18, i64 0}
!18 = !{!"_ZTSSt4lessIN3HIR7TypeRefEE"}
!19 = !{!"_ZTSSt15_Rb_tree_header", !20, i64 0, !22, i64 32}
!20 = !{!"_ZTSSt18_Rb_tree_node_base", !21, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!21 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTS11RangeVecMapISt4pairIN3HIR7TypeRefENS1_11GenericPathEEN18TraitResolveCommon11CachedBoundENS5_14CachedBoundCmpEE", !24, i64 0, !28, i64 24}
!24 = !{!"_ZTSSt6vectorISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!"_ZTSN18TraitResolveCommon14CachedBoundCmpE"}
!29 = !{!"_ZTSN3HIR10SimplePathE", !30, i64 0}
!30 = !{!"_ZTS10ThinVectorI8RcStringE", !6, i64 0}
!31 = !{!"_ZTSSt6vectorISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}


; 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::TypeRef" = type { ptr }
%struct.Span = type { ptr }
%"class.std::function" = 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.683 = type { ptr, ptr, ptr }

@_ZTISt13runtime_error = external constant ptr
@.str.70 = external hidden unnamed_addr constant [24 x i8], align 1
@__func__._ZNK15TraitResolution20autoderef_find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS4_ = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16HMTypeInferrence4dumpEv(ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #0 align 2

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

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) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3HIR8TypeData8is_InferEv(ptr noundef nonnull align 8 dereferenceable(184)) local_unnamed_addr #3 align 2

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

declare void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #4

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK16HMTypeInferrence8get_typeERKN3HIR7TypeRefE(ptr noundef nonnull align 8 dereferenceable(49), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

declare void @_ZN4SpanC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3HIR8TypeData7is_PathEv(ptr noundef nonnull align 8 dereferenceable(184)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3HIR15TypePathBinding10is_UnboundEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3HIR7TypeRefC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK15TraitResolution9autoderefERK4SpanRKN3HIR7TypeRefERS4_(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK15TraitResolution20autoderef_find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS4_(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.HIR::TypeRef", align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct.Span, align 8
  %9 = alloca %"class.std::function", align 8
  %10 = alloca %class.anon.683, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @_ZN3HIR7TypeRefC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %11 = getelementptr inbounds i8, ptr %0, i64 224
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK16HMTypeInferrence8get_typeERKN3HIR7TypeRefE(ptr noundef nonnull align 8 dereferenceable(49) %12, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %14 unwind label %18

14:                                               ; preds = %5
  %15 = call noundef nonnull align 8 dereferenceable(184) ptr @_ZNK3HIR7TypeRef4dataEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
  %16 = call noundef ptr @_ZNK3HIR8TypeData10opt_BorrowEv(ptr noundef nonnull align 8 dereferenceable(184) %15)
  %.not = icmp ne ptr %16, null
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %spec.select = select i1 %.not, ptr %17, ptr %2
  %spec.select57 = zext i1 %.not to i32
  br label %20

18:                                               ; preds = %5
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %82

20:                                               ; preds = %41, %14
  %.147 = phi ptr [ %spec.select, %14 ], [ %40, %41 ]
  %.136 = phi i32 [ %spec.select57, %14 ], [ %42, %41 ]
  %21 = load ptr, ptr %11, align 8, !tbaa !5
  %22 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK16HMTypeInferrence8get_typeERKN3HIR7TypeRefE(ptr noundef nonnull align 8 dereferenceable(49) %21, ptr noundef nonnull align 8 dereferenceable(8) %.147)
          to label %23 unwind label %26

23:                                               ; preds = %20
  %24 = call noundef nonnull align 8 dereferenceable(184) ptr @_ZNK3HIR7TypeRef4dataEv(ptr noundef nonnull align 8 dereferenceable(8) %22)
  %25 = call noundef zeroext i1 @_ZNK3HIR8TypeData8is_InferEv(ptr noundef nonnull align 8 dereferenceable(184) %24)
  br i1 %25, label %.thread, label %28

26:                                               ; preds = %39, %36, %20
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %82

28:                                               ; preds = %23
  %29 = call noundef nonnull align 8 dereferenceable(184) ptr @_ZNK3HIR7TypeRef4dataEv(ptr noundef nonnull align 8 dereferenceable(8) %22)
  %30 = call noundef zeroext i1 @_ZNK3HIR8TypeData7is_PathEv(ptr noundef nonnull align 8 dereferenceable(184) %29)
  br i1 %30, label %31, label %36

31:                                               ; preds = %28
  %32 = call noundef nonnull align 8 dereferenceable(184) ptr @_ZNK3HIR7TypeRef4dataEv(ptr noundef nonnull align 8 dereferenceable(8) %22)
  %33 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNK3HIR8TypeData7as_PathEv(ptr noundef nonnull align 8 dereferenceable(184) %32)
  %34 = getelementptr inbounds i8, ptr %33, i64 88
  %35 = call noundef zeroext i1 @_ZNK3HIR15TypePathBinding10is_UnboundEv(ptr noundef nonnull align 8 dereferenceable(16) %34)
  br i1 %35, label %.thread, label %36

36:                                               ; preds = %31, %28
  %37 = invoke noundef zeroext i1 @_ZNK15TraitResolution10find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS4_(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %38 unwind label %26

38:                                               ; preds = %36
  br i1 %37, label %.thread, label %39

39:                                               ; preds = %38
  %40 = invoke noundef ptr @_ZNK15TraitResolution9autoderefERK4SpanRKN3HIR7TypeRefERS4_(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %41 unwind label %26

41:                                               ; preds = %39
  %42 = add i32 %.136, 1
  %.not50 = icmp eq ptr %40, null
  br i1 %.not50, label %43, label %20, !llvm.loop !32

43:                                               ; preds = %41
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK16HMTypeInferrence8get_typeERKN3HIR7TypeRefE(ptr noundef nonnull align 8 dereferenceable(49) %44, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %46 unwind label %55

46:                                               ; preds = %43
  %47 = call noundef nonnull align 8 dereferenceable(184) ptr @_ZNK3HIR7TypeRef4dataEv(ptr noundef nonnull align 8 dereferenceable(8) %45)
  %48 = call noundef ptr @_ZNK3HIR8TypeData10opt_BorrowEv(ptr noundef nonnull align 8 dereferenceable(184) %47)
  %.not51 = icmp eq ptr %48, null
  br i1 %.not51, label %59, label %49

49:                                               ; preds = %46
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK16HMTypeInferrence8get_typeERKN3HIR7TypeRefE(ptr noundef nonnull align 8 dereferenceable(49) %50, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %52 unwind label %57

52:                                               ; preds = %49
  %53 = invoke noundef zeroext i1 @_ZNK15TraitResolution10find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS4_(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %54 unwind label %57

54:                                               ; preds = %52
  br i1 %53, label %.thread, label %59

55:                                               ; preds = %59, %43
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %82

57:                                               ; preds = %52, %49
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %82

59:                                               ; preds = %54, %46
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZNK16HMTypeInferrence4dumpEv(ptr noundef nonnull align 8 dereferenceable(49) %60)
          to label %61 unwind label %55

61:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  store ptr @__func__._ZNK15TraitResolution20autoderef_find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS4_, ptr %7, align 8, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  invoke void @_ZN4SpanC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %62 unwind label %69

62:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  store ptr %7, ptr %10, align 8, !tbaa !34
  %63 = getelementptr inbounds i8, ptr %10, i64 8
  store ptr %2, ptr %63, align 8, !tbaa !34
  %64 = getelementptr inbounds i8, ptr %10, i64 16
  store ptr %3, ptr %64, align 8, !tbaa !34
  invoke void @"_ZNSt8functionIFvRSoEEC2IZNK15TraitResolution20autoderef_find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS9_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %65 unwind label %71

65:                                               ; preds = %62
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull %9)
          to label %66 unwind label %73

66:                                               ; preds = %65
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %67 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %67, ptr noundef nonnull @.str.70)
          to label %68 unwind label %77

68:                                               ; preds = %66
  invoke void @__cxa_throw(ptr nonnull %67, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #8
          to label %83 unwind label %79

69:                                               ; preds = %61
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %76

71:                                               ; preds = %62
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %75

73:                                               ; preds = %65
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  br label %75

75:                                               ; preds = %73, %71
  %.pn = phi { ptr, i32 } [ %74, %73 ], [ %72, %71 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br label %76

76:                                               ; preds = %75, %69
  %.pn.pn = phi { ptr, i32 } [ %.pn, %75 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %81

77:                                               ; preds = %66
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %67) #7
  br label %81

79:                                               ; preds = %68
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %81

81:                                               ; preds = %79, %77, %76
  %.pn54 = phi { ptr, i32 } [ %80, %79 ], [ %78, %77 ], [ %.pn.pn, %76 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %82

.thread:                                          ; preds = %38, %31, %23, %54
  %.3 = phi i32 [ 0, %54 ], [ -1, %23 ], [ -1, %31 ], [ %.136, %38 ]
  call void @_ZN3HIR7TypeRefD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  ret i32 %.3

82:                                               ; preds = %81, %57, %55, %26, %18
  %.pn54.pn = phi { ptr, i32 } [ %.pn54, %81 ], [ %56, %55 ], [ %58, %57 ], [ %27, %26 ], [ %19, %18 ]
  call void @_ZN3HIR7TypeRefD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  resume { ptr, i32 } %.pn54.pn

83:                                               ; preds = %68
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK15TraitResolution10find_fieldERK4SpanRKN3HIR7TypeRefERK8RcStringRS4_(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 "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 = { inlinehint 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 #7 = { nounwind }
attributes #8 = { noreturn }

!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, !8, i64 224}
!6 = !{!"_ZTS15TraitResolution", !7, i64 0, !8, i64 216, !8, i64 224, !8, i64 232, !8, i64 240, !8, i64 248, !28, i64 256}
!7 = !{!"_ZTS18TraitResolveCommon", !8, i64 0, !8, i64 8, !8, i64 16, !11, i64 24, !20, i64 72, !26, i64 104, !26, i64 112, !26, i64 120, !26, i64 128, !26, i64 136, !26, i64 144, !26, i64 152, !26, i64 160, !26, i64 168, !26, i64 176, !26, i64 184, !26, i64 192, !26, i64 200, !26, i64 208}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSSt3mapIN3HIR7TypeRefEN18TraitResolveCommon14CachedEqualityESt4lessIS1_ESaISt4pairIKS1_S3_EEE", !12, i64 0}
!12 = !{!"_ZTSSt8_Rb_treeIN3HIR7TypeRefESt4pairIKS1_N18TraitResolveCommon14CachedEqualityEESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE", !13, i64 0}
!13 = !{!"_ZTSNSt8_Rb_treeIN3HIR7TypeRefESt4pairIKS1_N18TraitResolveCommon14CachedEqualityEESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE13_Rb_tree_implISA_Lb1EEE", !14, i64 0, !16, i64 8}
!14 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN3HIR7TypeRefEEE", !15, i64 0}
!15 = !{!"_ZTSSt4lessIN3HIR7TypeRefEE"}
!16 = !{!"_ZTSSt15_Rb_tree_header", !17, i64 0, !19, i64 32}
!17 = !{!"_ZTSSt18_Rb_tree_node_base", !18, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!18 = !{!"_ZTSSt14_Rb_tree_color", !9, i64 0}
!19 = !{!"long", !9, i64 0}
!20 = !{!"_ZTS11RangeVecMapISt4pairIN3HIR7TypeRefENS1_11GenericPathEEN18TraitResolveCommon11CachedBoundENS5_14CachedBoundCmpEE", !21, i64 0, !25, i64 24}
!21 = !{!"_ZTSSt6vectorISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!25 = !{!"_ZTSN18TraitResolveCommon14CachedBoundCmpE"}
!26 = !{!"_ZTSN3HIR10SimplePathE", !27, i64 0}
!27 = !{!"_ZTS10ThinVectorI8RcStringE", !8, i64 0}
!28 = !{!"_ZTSSt6vectorISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!8, !8, i64 0}


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