; LLVM IR from thepowersgang/mrustc :: src/hir_typeck/impl_ref.ll (ZNK7ImplRef16has_magic_paramsEv)

; 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.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 = type { i8 }
%struct.ImplRef = type { %"class.ImplRef::Data" }
%"class.ImplRef::Data" = type { i32, %"union.ImplRef::Data::DataUnion" }
%"union.ImplRef::Data::DataUnion" = type { %"struct.ImplRef::Data::Data_Bounded" }
%"struct.ImplRef::Data::Data_Bounded" = type { %"class.HIR::GenericParams", %"class.HIR::TypeRef", %"struct.HIR::PathParams", %"class.std::map" }
%"class.HIR::GenericParams" = type { %"class.std::vector", %"class.std::vector.2", %"class.std::vector.7", %"class.std::vector.12" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<HIR::TypeParamDef, std::allocator<HIR::TypeParamDef>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::TypeParamDef, std::allocator<HIR::TypeParamDef>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::TypeParamDef, std::allocator<HIR::TypeParamDef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::TypeParamDef, std::allocator<HIR::TypeParamDef>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.2" = type { %"struct.std::_Vector_base.3" }
%"struct.std::_Vector_base.3" = type { %"struct.std::_Vector_base<HIR::LifetimeDef, std::allocator<HIR::LifetimeDef>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::LifetimeDef, std::allocator<HIR::LifetimeDef>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::LifetimeDef, std::allocator<HIR::LifetimeDef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::LifetimeDef, std::allocator<HIR::LifetimeDef>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<HIR::ValueParamDef, std::allocator<HIR::ValueParamDef>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::ValueParamDef, std::allocator<HIR::ValueParamDef>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::ValueParamDef, std::allocator<HIR::ValueParamDef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::ValueParamDef, std::allocator<HIR::ValueParamDef>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<HIR::GenericBound, std::allocator<HIR::GenericBound>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::GenericBound, std::allocator<HIR::GenericBound>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::GenericBound, std::allocator<HIR::GenericBound>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::GenericBound, std::allocator<HIR::GenericBound>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.HIR::TypeRef" = type { ptr }
%"struct.HIR::PathParams" = type { %class.ThinVector, %class.ThinVector.0, %class.ThinVector.1 }
%class.ThinVector = type { ptr }
%class.ThinVector.0 = type { ptr }
%class.ThinVector.1 = type { ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<RcString, std::pair<const RcString, HIR::TraitPath::AtyEqual>, std::_Select1st<std::pair<const RcString, HIR::TraitPath::AtyEqual>>, std::less<RcString>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<RcString, std::pair<const RcString, HIR::TraitPath::AtyEqual>, std::_Select1st<std::pair<const RcString, HIR::TraitPath::AtyEqual>>, std::less<RcString>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.ImplRef::Data::Data_TraitImpl" = type { %"struct.HIR::PathParams", ptr, ptr, ptr, %"class.HIR::TypeRef" }
%"class.HIR::ConstGeneric" = type { i32, %"union.HIR::ConstGeneric::DataUnion" }
%"union.HIR::ConstGeneric::DataUnion" = type { %"class.std::unique_ptr", [8 x i8] }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.195" }
%"struct.std::_Head_base.195" = type { ptr }

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7ImplRef16has_magic_paramsEv(ptr noundef nonnull align 8 dereferenceable(184) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.std::function", align 8
  %11 = alloca %class.anon, align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %19 = getelementptr inbounds %struct.ImplRef, ptr %18, i32 0, i32 0
  %20 = call noundef ptr @_ZNK7ImplRef4Data13opt_TraitImplEv(ptr noundef nonnull align 8 dereferenceable(184) %19)
  store ptr %20, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %87

23:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.ImplRef::Data::Data_TraitImpl", ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds %"struct.HIR::PathParams", ptr %25, i32 0, i32 1
  store ptr %26, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = call noundef ptr @_ZNK10ThinVectorIN3HIR7TypeRefEE5beginEv(ptr noundef nonnull align 8 dereferenceable(8) %27)
  store ptr %28, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call noundef ptr @_ZNK10ThinVectorIN3HIR7TypeRefEE3endEv(ptr noundef nonnull align 8 dereferenceable(8) %29)
  store ptr %30, ptr %7, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %50, %23
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = icmp ne ptr %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 2, ptr %8, align 4
  br label %53

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %37, ptr %9, align 8, !tbaa !5
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  call void @"_ZNSt8functionIFbRKN3HIR7TypeRefEEEC2IZNK7ImplRef16has_magic_paramsEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 1 dereferenceable(1) %11) #4
  %39 = invoke noundef zeroext i1 @_Z13visit_ty_withRKN3HIR7TypeRefESt8functionIFbS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef %10)
          to label %40 unwind label %42

40:                                               ; preds = %36
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  br i1 %39, label %41, label %46

41:                                               ; preds = %40
  store i1 true, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %47

42:                                               ; preds = %36
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %12, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %13, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %93

46:                                               ; preds = %40
  store i32 0, ptr %8, align 4
  br label %47

47:                                               ; preds = %46, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %48 = load i32, ptr %8, align 4
  switch i32 %48, label %53 [
    i32 0, label %49
  ]

49:                                               ; preds = %47
  br label %50

50:                                               ; preds = %49
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %"class.HIR::TypeRef", ptr %51, i32 1
  store ptr %52, ptr %6, align 8, !tbaa !5
  br label %31

53:                                               ; preds = %47, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  %54 = load i32, ptr %8, align 4
  switch i32 %54, label %88 [
    i32 2, label %55
  ]

55:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.ImplRef::Data::Data_TraitImpl", ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds %"struct.HIR::PathParams", ptr %57, i32 0, i32 2
  store ptr %58, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %59 = load ptr, ptr %14, align 8, !tbaa !5
  %60 = call noundef ptr @_ZNK10ThinVectorIN3HIR12ConstGenericEE5beginEv(ptr noundef nonnull align 8 dereferenceable(8) %59)
  store ptr %60, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %61 = load ptr, ptr %14, align 8, !tbaa !5
  %62 = call noundef ptr @_ZNK10ThinVectorIN3HIR12ConstGenericEE3endEv(ptr noundef nonnull align 8 dereferenceable(8) %61)
  store ptr %62, ptr %16, align 8, !tbaa !5
  br label %63

63:                                               ; preds = %81, %55
  %64 = load ptr, ptr %15, align 8, !tbaa !5
  %65 = load ptr, ptr %16, align 8, !tbaa !5
  %66 = icmp ne ptr %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 4, ptr %8, align 4
  br label %84

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %69 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %69, ptr %17, align 8, !tbaa !5
  %70 = load ptr, ptr %17, align 8, !tbaa !5
  %71 = call noundef zeroext i1 @_ZNK3HIR12ConstGeneric10is_GenericEv(ptr noundef nonnull align 8 dereferenceable(24) %70)
  br i1 %71, label %72, label %77

72:                                               ; preds = %68
  %73 = load ptr, ptr %17, align 8, !tbaa !5
  %74 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK3HIR12ConstGeneric10as_GenericEv(ptr noundef nonnull align 8 dereferenceable(24) %73)
  %75 = call noundef zeroext i1 @_ZNK3HIR10GenericRef14is_placeholderEv(ptr noundef nonnull align 8 dereferenceable(12) %74)
  br i1 %75, label %76, label %77

76:                                               ; preds = %72
  store i1 true, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %78

77:                                               ; preds = %72, %68
  store i32 0, ptr %8, align 4
  br label %78

78:                                               ; preds = %77, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %79 = load i32, ptr %8, align 4
  switch i32 %79, label %84 [
    i32 0, label %80
  ]

80:                                               ; preds = %78
  br label %81

81:                                               ; preds = %80
  %82 = load ptr, ptr %15, align 8, !tbaa !5
  %83 = getelementptr inbounds %"class.HIR::ConstGeneric", ptr %82, i32 1
  store ptr %83, ptr %15, align 8, !tbaa !5
  br label %63

84:                                               ; preds = %78, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %85 = load i32, ptr %8, align 4
  switch i32 %85, label %88 [
    i32 4, label %86
  ]

86:                                               ; preds = %84
  br label %87

87:                                               ; preds = %86, %1
  store i32 0, ptr %8, align 4
  br label %88

88:                                               ; preds = %87, %84, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %89 = load i32, ptr %8, align 4
  switch i32 %89, label %98 [
    i32 0, label %90
    i32 1, label %91
  ]

90:                                               ; preds = %88
  store i1 false, ptr %2, align 1
  br label %91

91:                                               ; preds = %90, %88
  %92 = load i1, ptr %2, align 1
  ret i1 %92

93:                                               ; preds = %42
  %94 = load ptr, ptr %12, align 8
  %95 = load i32, ptr %13, align 4
  %96 = insertvalue { ptr, i32 } poison, ptr %94, 0
  %97 = insertvalue { ptr, i32 } %96, i32 %95, 1
  resume { ptr, i32 } %97

98:                                               ; preds = %88
  unreachable
}

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

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

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

declare noundef zeroext i1 @_Z13visit_ty_withRKN3HIR7TypeRefESt8functionIFbS2_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; 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.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 = type { i8 }

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7ImplRef16has_magic_paramsEv(ptr noundef nonnull align 8 dereferenceable(184) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::function", align 8
  %3 = alloca %class.anon, align 1
  %4 = tail call noundef ptr @_ZNK7ImplRef4Data13opt_TraitImplEv(ptr noundef nonnull align 8 dereferenceable(184) %0)
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %.thread, label %5

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %4, i64 8
  %7 = tail call noundef ptr @_ZNK10ThinVectorIN3HIR7TypeRefEE5beginEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %8 = tail call noundef ptr @_ZNK10ThinVectorIN3HIR7TypeRefEE3endEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %.not3746 = icmp eq ptr %7, %8
  br i1 %.not3746, label %.critedge, label %.lr.ph

9:                                                ; preds = %12
  %10 = getelementptr inbounds i8, ptr %.02947, i64 8
  %.not37 = icmp eq ptr %10, %8
  br i1 %.not37, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %5, %9
  %.02947 = phi ptr [ %10, %9 ], [ %7, %5 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #4
  call void @"_ZNSt8functionIFbRKN3HIR7TypeRefEEEC2IZNK7ImplRef16has_magic_paramsEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 1 dereferenceable(1) %3) #4
  %11 = invoke noundef zeroext i1 @_Z13visit_ty_withRKN3HIR7TypeRefESt8functionIFbS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %.02947, ptr noundef nonnull %2)
          to label %12 unwind label %13

12:                                               ; preds = %.lr.ph
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #4
  br i1 %11, label %.thread, label %9

13:                                               ; preds = %.lr.ph
  %14 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #4
  resume { ptr, i32 } %14

.critedge:                                        ; preds = %9, %5
  %15 = getelementptr inbounds i8, ptr %4, i64 16
  %16 = call noundef ptr @_ZNK10ThinVectorIN3HIR12ConstGenericEE5beginEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
  %17 = call noundef ptr @_ZNK10ThinVectorIN3HIR12ConstGenericEE3endEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
  %.not3848 = icmp eq ptr %16, %17
  br i1 %.not3848, label %.thread, label %.lr.ph50

.lr.ph50:                                         ; preds = %.critedge, %.critedge40
  %.03049 = phi ptr [ %22, %.critedge40 ], [ %16, %.critedge ]
  %18 = call noundef zeroext i1 @_ZNK3HIR12ConstGeneric10is_GenericEv(ptr noundef nonnull align 8 dereferenceable(24) %.03049)
  br i1 %18, label %19, label %.critedge40

19:                                               ; preds = %.lr.ph50
  %20 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK3HIR12ConstGeneric10as_GenericEv(ptr noundef nonnull align 8 dereferenceable(24) %.03049)
  %21 = call noundef zeroext i1 @_ZNK3HIR10GenericRef14is_placeholderEv(ptr noundef nonnull align 8 dereferenceable(12) %20)
  br i1 %21, label %.thread, label %.critedge40

.critedge40:                                      ; preds = %19, %.lr.ph50
  %22 = getelementptr inbounds i8, ptr %.03049, i64 24
  %.not38 = icmp eq ptr %22, %17
  br i1 %.not38, label %.thread, label %.lr.ph50

.thread:                                          ; preds = %12, %19, %.critedge40, %.critedge, %1
  %23 = phi i1 [ false, %1 ], [ false, %.critedge ], [ true, %19 ], [ false, %.critedge40 ], [ true, %12 ]
  ret i1 %23
}

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

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

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

declare noundef zeroext i1 @_Z13visit_ty_withRKN3HIR7TypeRefESt8functionIFbS2_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}


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