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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.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.203 = type { ptr, ptr }
%class.anon.204 = type { ptr, ptr }
%"struct.HMTypeInferrence::ResolvePlaceholders" = type { %"class.HIR::ResolvePlaceholders", ptr }
%"class.HIR::ResolvePlaceholders" = 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.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 }

@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@_ZTISt13runtime_error = external constant ptr

; 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 void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

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

declare ptr @__cxa_allocate_exception(i64)

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

declare void @__cxa_free_exception(ptr)

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

declare void @__cxa_throw(ptr, ptr, ptr)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK15TraitResolution10compare_ppERK4SpanRKN3HIR10PathParamsES6_(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3) #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.Span, align 8
  %11 = alloca %"class.std::function", align 8
  %12 = alloca %class.anon.203, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %struct.Span, align 8
  %16 = alloca %"class.std::function", align 8
  %17 = alloca %class.anon.204, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"struct.HMTypeInferrence::ResolvePlaceholders", align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8
  br label %26

26:                                               ; preds = %4
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.HIR::PathParams", ptr %27, i32 0, i32 1
  %29 = call noundef i64 @_ZNK10ThinVectorIN3HIR7TypeRefEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %28)
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.HIR::PathParams", ptr %30, i32 0, i32 1
  %32 = call noundef i64 @_ZNK10ThinVectorIN3HIR7TypeRefEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %31)
  %33 = icmp eq i64 %29, %32
  br i1 %33, label %51, label %34

34:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN4SpanC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %35)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %36 = getelementptr inbounds %class.anon.203, ptr %12, i32 0, i32 0
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %37, ptr %36, align 8, !tbaa !5
  %38 = getelementptr inbounds %class.anon.203, ptr %12, i32 0, i32 1
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %39, ptr %38, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZNK15TraitResolution10compare_ppERK4SpanRKN3HIR10PathParamsESB_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef %11)
          to label %40 unwind label %43

40:                                               ; preds = %34
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %41 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef @.str.8)
          to label %42 unwind label %47

42:                                               ; preds = %40
  call void @__cxa_throw(ptr %41, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #7
  unreachable

43:                                               ; preds = %34
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %13, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %14, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %153

47:                                               ; preds = %40
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %13, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %14, align 4
  call void @__cxa_free_exception(ptr %41) #6
  br label %153

51:                                               ; preds = %26
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.HIR::PathParams", ptr %54, i32 0, i32 2
  %56 = call noundef i64 @_ZNK10ThinVectorIN3HIR12ConstGenericEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %55)
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.HIR::PathParams", ptr %57, i32 0, i32 2
  %59 = call noundef i64 @_ZNK10ThinVectorIN3HIR12ConstGenericEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %58)
  %60 = icmp eq i64 %56, %59
  br i1 %60, label %78, label %61

61:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN4SpanC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %62)
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  %63 = getelementptr inbounds %class.anon.204, ptr %17, i32 0, i32 0
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %64, ptr %63, align 8, !tbaa !5
  %65 = getelementptr inbounds %class.anon.204, ptr %17, i32 0, i32 1
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %66, ptr %65, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZNK15TraitResolution10compare_ppERK4SpanRKN3HIR10PathParamsESB_E3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(16) %17) #6
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef %16)
          to label %67 unwind label %70

67:                                               ; preds = %61
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %68 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %68, ptr noundef @.str.8)
          to label %69 unwind label %74

69:                                               ; preds = %67
  call void @__cxa_throw(ptr %68, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #7
  unreachable

70:                                               ; preds = %61
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %13, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %14, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %153

74:                                               ; preds = %67
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %13, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %14, align 4
  call void @__cxa_free_exception(ptr %68) #6
  br label %153

78:                                               ; preds = %53
  br label %79

79:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %80

80:                                               ; preds = %109, %79
  %81 = load i32, ptr %19, align 4, !tbaa !11
  %82 = zext i32 %81 to i64
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds %"struct.HIR::PathParams", ptr %83, i32 0, i32 1
  %85 = call noundef i64 @_ZNK10ThinVectorIN3HIR7TypeRefEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %84)
  %86 = icmp ult i64 %82, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %80
  store i32 6, ptr %20, align 4
  br label %112

88:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.HIR::PathParams", ptr %89, i32 0, i32 1
  %91 = load i32, ptr %19, align 4, !tbaa !11
  %92 = zext i32 %91 to i64
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK10ThinVectorIN3HIR7TypeRefEEixEm(ptr noundef nonnull align 8 dereferenceable(8) %90, i64 noundef %92)
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.HIR::PathParams", ptr %95, i32 0, i32 1
  %97 = load i32, ptr %19, align 4, !tbaa !11
  %98 = zext i32 %97 to i64
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK10ThinVectorIN3HIR7TypeRefEEixEm(ptr noundef nonnull align 8 dereferenceable(8) %96, i64 noundef %98)
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #6
  %100 = getelementptr inbounds %class.TraitResolution, ptr %25, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !13
  call void @_ZNK16HMTypeInferrence22callback_resolve_inferEv(ptr dead_on_unwind writable sret(%"struct.HMTypeInferrence::ResolvePlaceholders") align 8 %22, ptr noundef nonnull align 8 dereferenceable(49) %101)
  %102 = call noundef i32 @_ZNK3HIR7TypeRef25compare_with_placeholdersERK4SpanRKS0_RKNS_19ResolvePlaceholdersE(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef nonnull align 8 dereferenceable(8) %22)
  store i32 %102, ptr %21, align 4, !tbaa !9
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3HIRaNERNS_7CompareERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %21)
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  %104 = load i32, ptr %18, align 4, !tbaa !9
  %105 = icmp eq i32 %104, 2
  br i1 %105, label %106, label %108

106:                                              ; preds = %88
  %107 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %107, ptr %5, align 4
  store i32 1, ptr %20, align 4
  br label %112

108:                                              ; preds = %88
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %19, align 4, !tbaa !11
  %111 = add i32 %110, 1
  store i32 %111, ptr %19, align 4, !tbaa !11
  br label %80, !llvm.loop !37

112:                                              ; preds = %106, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %113 = load i32, ptr %20, align 4
  switch i32 %113, label %151 [
    i32 6, label %114
  ]

114:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !11
  br label %115

115:                                              ; preds = %144, %114
  %116 = load i32, ptr %23, align 4, !tbaa !11
  %117 = zext i32 %116 to i64
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.HIR::PathParams", ptr %118, i32 0, i32 2
  %120 = call noundef i64 @_ZNK10ThinVectorIN3HIR12ConstGenericEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %119)
  %121 = icmp ult i64 %117, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %115
  store i32 9, ptr %20, align 4
  br label %147

123:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = getelementptr inbounds %"struct.HIR::PathParams", ptr %125, i32 0, i32 2
  %127 = load i32, ptr %23, align 4, !tbaa !11
  %128 = zext i32 %127 to i64
  %129 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK10ThinVectorIN3HIR12ConstGenericEEixEm(ptr noundef nonnull align 8 dereferenceable(8) %126, i64 noundef %128)
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %"struct.HIR::PathParams", ptr %130, i32 0, i32 2
  %132 = load i32, ptr %23, align 4, !tbaa !11
  %133 = zext i32 %132 to i64
  %134 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK10ThinVectorIN3HIR12ConstGenericEEixEm(ptr noundef nonnull align 8 dereferenceable(8) %131, i64 noundef %133)
  %135 = getelementptr inbounds %class.TraitResolution, ptr %25, i32 0, i32 2
  %136 = load ptr, ptr %135, align 8, !tbaa !13
  %137 = call noundef i32 @_ZN12_GLOBAL__N_113compare_valueERK4SpanRKN3HIR12ConstGenericES6_RK16HMTypeInferrence(ptr noundef nonnull align 8 dereferenceable(8) %124, ptr noundef nonnull align 8 dereferenceable(24) %129, ptr noundef nonnull align 8 dereferenceable(24) %134, ptr noundef nonnull align 8 dereferenceable(49) %136)
  store i32 %137, ptr %24, align 4, !tbaa !9
  %138 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3HIRaNERNS_7CompareERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %24)
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  %139 = load i32, ptr %18, align 4, !tbaa !9
  %140 = icmp eq i32 %139, 2
  br i1 %140, label %141, label %143

141:                                              ; preds = %123
  %142 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %142, ptr %5, align 4
  store i32 1, ptr %20, align 4
  br label %147

143:                                              ; preds = %123
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %23, align 4, !tbaa !11
  %146 = add i32 %145, 1
  store i32 %146, ptr %23, align 4, !tbaa !11
  br label %115, !llvm.loop !39

147:                                              ; preds = %141, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  %148 = load i32, ptr %20, align 4
  switch i32 %148, label %151 [
    i32 9, label %149
  ]

149:                                              ; preds = %147
  %150 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %150, ptr %5, align 4
  store i32 1, ptr %20, align 4
  br label %151

151:                                              ; preds = %149, %147, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  %152 = load i32, ptr %5, align 4
  ret i32 %152

153:                                              ; preds = %74, %70, %47, %43
  %154 = load ptr, ptr %13, align 8
  %155 = load i32, ptr %14, align 4
  %156 = insertvalue { ptr, i32 } poison, ptr %154, 0
  %157 = insertvalue { ptr, i32 } %156, i32 %155, 1
  resume { ptr, i32 } %157
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(4) ptr @_ZN3HIRaNERNS_7CompareERKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

declare noundef i32 @_ZNK3HIR7TypeRef25compare_with_placeholdersERK4SpanRKS0_RKNS_19ResolvePlaceholdersE(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)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16HMTypeInferrence22callback_resolve_inferEv(ptr dead_on_unwind noalias writable sret(%"struct.HMTypeInferrence::ResolvePlaceholders") align 8, ptr noundef nonnull align 8 dereferenceable(49)) #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_113compare_valueERK4SpanRKN3HIR12ConstGenericES6_RK16HMTypeInferrence(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(49)) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #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 = { 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 #3 = { 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 #4 = { 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 #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 }
attributes #7 = { 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 = !{!"_ZTSN3HIR7CompareE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 224}
!14 = !{!"_ZTS15TraitResolution", !15, i64 0, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !33, i64 256}
!15 = !{!"_ZTS18TraitResolveCommon", !6, i64 0, !6, i64 8, !6, i64 16, !16, i64 24, !25, i64 72, !31, i64 104, !31, i64 112, !31, i64 120, !31, i64 128, !31, i64 136, !31, i64 144, !31, i64 152, !31, i64 160, !31, i64 168, !31, i64 176, !31, i64 184, !31, i64 192, !31, i64 200, !31, i64 208}
!16 = !{!"_ZTSSt3mapIN3HIR7TypeRefEN18TraitResolveCommon14CachedEqualityESt4lessIS1_ESaISt4pairIKS1_S3_EEE", !17, i64 0}
!17 = !{!"_ZTSSt8_Rb_treeIN3HIR7TypeRefESt4pairIKS1_N18TraitResolveCommon14CachedEqualityEESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE", !18, i64 0}
!18 = !{!"_ZTSNSt8_Rb_treeIN3HIR7TypeRefESt4pairIKS1_N18TraitResolveCommon14CachedEqualityEESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE13_Rb_tree_implISA_Lb1EEE", !19, i64 0, !21, i64 8}
!19 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN3HIR7TypeRefEEE", !20, i64 0}
!20 = !{!"_ZTSSt4lessIN3HIR7TypeRefEE"}
!21 = !{!"_ZTSSt15_Rb_tree_header", !22, i64 0, !24, i64 32}
!22 = !{!"_ZTSSt18_Rb_tree_node_base", !23, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!23 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = !{!"_ZTS11RangeVecMapISt4pairIN3HIR7TypeRefENS1_11GenericPathEEN18TraitResolveCommon11CachedBoundENS5_14CachedBoundCmpEE", !26, i64 0, !30, i64 24}
!26 = !{!"_ZTSSt6vectorISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!"_ZTSN18TraitResolveCommon14CachedBoundCmpE"}
!31 = !{!"_ZTSN3HIR10SimplePathE", !32, i64 0}
!32 = !{!"_ZTS10ThinVectorI8RcStringE", !6, i64 0}
!33 = !{!"_ZTSSt6vectorISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.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.203 = type { ptr, ptr }
%class.anon.204 = type { ptr, ptr }
%"struct.HMTypeInferrence::ResolvePlaceholders" = type { %"class.HIR::ResolvePlaceholders", ptr }
%"class.HIR::ResolvePlaceholders" = type { ptr }

@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@_ZTISt13runtime_error = external constant ptr

; 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 void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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

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 #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK15TraitResolution10compare_ppERK4SpanRKN3HIR10PathParamsES6_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(280) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.Span, align 8
  %6 = alloca %"class.std::function", align 8
  %7 = alloca %class.anon.203, align 8
  %8 = alloca %struct.Span, align 8
  %9 = alloca %"class.std::function", align 8
  %10 = alloca %class.anon.204, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.HMTypeInferrence::ResolvePlaceholders", align 8
  %14 = alloca i32, align 4
  %15 = getelementptr inbounds i8, ptr %2, i64 8
  %16 = tail call noundef i64 @_ZNK10ThinVectorIN3HIR7TypeRefEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
  %17 = getelementptr inbounds i8, ptr %3, i64 8
  %18 = tail call noundef i64 @_ZNK10ThinVectorIN3HIR7TypeRefEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
  %19 = icmp eq i64 %16, %18
  br i1 %19, label %29, label %20

20:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @_ZN4SpanC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  store ptr %2, ptr %7, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %3, ptr %21, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZNK15TraitResolution10compare_ppERK4SpanRKN3HIR10PathParamsESB_E3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %6)
          to label %22 unwind label %25

22:                                               ; preds = %20
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %23 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull @.str.8)
          to label %24 unwind label %27

24:                                               ; preds = %22
  call void @__cxa_throw(ptr nonnull %23, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #7
  unreachable

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

27:                                               ; preds = %22
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %23) #6
  br label %75

29:                                               ; preds = %4
  %30 = getelementptr inbounds i8, ptr %2, i64 16
  %31 = tail call noundef i64 @_ZNK10ThinVectorIN3HIR12ConstGenericEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %30)
  %32 = getelementptr inbounds i8, ptr %3, i64 16
  %33 = tail call noundef i64 @_ZNK10ThinVectorIN3HIR12ConstGenericEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %32)
  %34 = icmp eq i64 %31, %33
  br i1 %34, label %44, label %35

35:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @_ZN4SpanC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  store ptr %2, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %10, i64 8
  store ptr %3, ptr %36, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZNK15TraitResolution10compare_ppERK4SpanRKN3HIR10PathParamsESB_E3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull %9)
          to label %37 unwind label %40

37:                                               ; preds = %35
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %38 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull @.str.8)
          to label %39 unwind label %42

39:                                               ; preds = %37
  call void @__cxa_throw(ptr nonnull %38, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #7
  unreachable

40:                                               ; preds = %35
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %75

42:                                               ; preds = %37
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %38) #6
  br label %75

44:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  %45 = tail call noundef i64 @_ZNK10ThinVectorIN3HIR7TypeRefEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
  %.not44.not = icmp eq i64 %45, 0
  br i1 %.not44.not, label %.critedge.preheader, label %.lr.ph

.lr.ph:                                           ; preds = %44
  %46 = getelementptr inbounds i8, ptr %0, i64 224
  br label %53

47:                                               ; preds = %53
  %48 = add i32 %.03345, 1
  %49 = zext i32 %48 to i64
  %50 = call noundef i64 @_ZNK10ThinVectorIN3HIR7TypeRefEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
  %.not = icmp ugt i64 %50, %49
  br i1 %.not, label %53, label %.critedge.preheader, !llvm.loop !11

.critedge.preheader:                              ; preds = %47, %44
  %51 = call noundef i64 @_ZNK10ThinVectorIN3HIR12ConstGenericEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %30)
  %.not4346.not = icmp eq i64 %51, 0
  br i1 %.not4346.not, label %._crit_edge.thread, label %.lr.ph49

.lr.ph49:                                         ; preds = %.critedge.preheader
  %52 = getelementptr inbounds i8, ptr %0, i64 224
  br label %65

53:                                               ; preds = %.lr.ph, %47
  %54 = phi i64 [ 0, %.lr.ph ], [ %49, %47 ]
  %.03345 = phi i32 [ 0, %.lr.ph ], [ %48, %47 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK10ThinVectorIN3HIR7TypeRefEEixEm(ptr noundef nonnull align 8 dereferenceable(8) %15, i64 noundef %54)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK10ThinVectorIN3HIR7TypeRefEEixEm(ptr noundef nonnull align 8 dereferenceable(8) %17, i64 noundef %54)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  %57 = load ptr, ptr %46, align 8, !tbaa !13
  call void @_ZNK16HMTypeInferrence22callback_resolve_inferEv(ptr dead_on_unwind nonnull writable sret(%"struct.HMTypeInferrence::ResolvePlaceholders") align 8 %13, ptr noundef nonnull align 8 dereferenceable(49) %57)
  %58 = call noundef i32 @_ZNK3HIR7TypeRef25compare_with_placeholdersERK4SpanRKS0_RKNS_19ResolvePlaceholdersE(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull align 8 dereferenceable(8) %13)
  store i32 %58, ptr %12, align 4, !tbaa !9
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3HIRaNERNS_7CompareERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  %60 = load i32, ptr %11, align 4, !tbaa !9
  %61 = icmp eq i32 %60, 2
  br i1 %61, label %.loopexit, label %47

.critedge:                                        ; preds = %65
  %62 = add i32 %.047, 1
  %63 = zext i32 %62 to i64
  %64 = call noundef i64 @_ZNK10ThinVectorIN3HIR12ConstGenericEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %30)
  %.not43 = icmp ugt i64 %64, %63
  br i1 %.not43, label %65, label %._crit_edge.thread, !llvm.loop !37

65:                                               ; preds = %.lr.ph49, %.critedge
  %66 = phi i64 [ 0, %.lr.ph49 ], [ %63, %.critedge ]
  %.047 = phi i32 [ 0, %.lr.ph49 ], [ %62, %.critedge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  %67 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK10ThinVectorIN3HIR12ConstGenericEEixEm(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 noundef %66)
  %68 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK10ThinVectorIN3HIR12ConstGenericEEixEm(ptr noundef nonnull align 8 dereferenceable(8) %32, i64 noundef %66)
  %69 = load ptr, ptr %52, align 8, !tbaa !13
  %70 = call noundef i32 @_ZN12_GLOBAL__N_113compare_valueERK4SpanRKN3HIR12ConstGenericES6_RK16HMTypeInferrence(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 8 dereferenceable(24) %68, ptr noundef nonnull align 8 dereferenceable(49) %69)
  store i32 %70, ptr %14, align 4, !tbaa !9
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3HIRaNERNS_7CompareERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  %72 = load i32, ptr %11, align 4, !tbaa !9
  %73 = icmp eq i32 %72, 2
  br i1 %73, label %.loopexit, label %.critedge

._crit_edge.thread:                               ; preds = %.critedge, %.critedge.preheader
  %74 = load i32, ptr %11, align 4
  br label %.loopexit

.loopexit:                                        ; preds = %53, %65, %._crit_edge.thread
  %.2 = phi i32 [ %74, %._crit_edge.thread ], [ 2, %65 ], [ 2, %53 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  ret i32 %.2

75:                                               ; preds = %42, %40, %27, %25
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %41, %40 ], [ %28, %27 ], [ %26, %25 ]
  resume { ptr, i32 } %.pn
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(4) ptr @_ZN3HIRaNERNS_7CompareERKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

declare noundef i32 @_ZNK3HIR7TypeRef25compare_with_placeholdersERK4SpanRKS0_RKNS_19ResolvePlaceholdersE(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 #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16HMTypeInferrence22callback_resolve_inferEv(ptr dead_on_unwind noalias writable sret(%"struct.HMTypeInferrence::ResolvePlaceholders") align 8, ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_113compare_valueERK4SpanRKN3HIR12ConstGenericES6_RK16HMTypeInferrence(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { 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 #3 = { 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 #4 = { 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 #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 }
attributes #7 = { 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 = !{!"_ZTSN3HIR7CompareE", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !6, i64 224}
!14 = !{!"_ZTS15TraitResolution", !15, i64 0, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !33, i64 256}
!15 = !{!"_ZTS18TraitResolveCommon", !6, i64 0, !6, i64 8, !6, i64 16, !16, i64 24, !25, i64 72, !31, i64 104, !31, i64 112, !31, i64 120, !31, i64 128, !31, i64 136, !31, i64 144, !31, i64 152, !31, i64 160, !31, i64 168, !31, i64 176, !31, i64 184, !31, i64 192, !31, i64 200, !31, i64 208}
!16 = !{!"_ZTSSt3mapIN3HIR7TypeRefEN18TraitResolveCommon14CachedEqualityESt4lessIS1_ESaISt4pairIKS1_S3_EEE", !17, i64 0}
!17 = !{!"_ZTSSt8_Rb_treeIN3HIR7TypeRefESt4pairIKS1_N18TraitResolveCommon14CachedEqualityEESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE", !18, i64 0}
!18 = !{!"_ZTSNSt8_Rb_treeIN3HIR7TypeRefESt4pairIKS1_N18TraitResolveCommon14CachedEqualityEESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE13_Rb_tree_implISA_Lb1EEE", !19, i64 0, !21, i64 8}
!19 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN3HIR7TypeRefEEE", !20, i64 0}
!20 = !{!"_ZTSSt4lessIN3HIR7TypeRefEE"}
!21 = !{!"_ZTSSt15_Rb_tree_header", !22, i64 0, !24, i64 32}
!22 = !{!"_ZTSSt18_Rb_tree_node_base", !23, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!23 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = !{!"_ZTS11RangeVecMapISt4pairIN3HIR7TypeRefENS1_11GenericPathEEN18TraitResolveCommon11CachedBoundENS5_14CachedBoundCmpEE", !26, i64 0, !30, i64 24}
!26 = !{!"_ZTSSt6vectorISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrISt4pairIS1_IN3HIR7TypeRefENS2_11GenericPathEEN18TraitResolveCommon11CachedBoundEESt14default_deleteIS8_EESaISB_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!"_ZTSN18TraitResolveCommon14CachedBoundCmpE"}
!31 = !{!"_ZTSN3HIR10SimplePathE", !32, i64 0}
!32 = !{!"_ZTS10ThinVectorI8RcStringE", !6, i64 0}
!33 = !{!"_ZTSSt6vectorISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseISt10unique_ptrIN3HIR7TypeRefESt14default_deleteIS2_EESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = distinct !{!37, !12}


; Effective O3 passes: ADCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass