; LLVM IR from thepowersgang/mrustc :: src/mir/helpers.ll (ZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEj)

; 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.271 = type { ptr, ptr }
%class.anon.303 = type { ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.MIR::LValue" = type { %"class.MIR::LValue::Storage", %"class.std::vector.14" }
%"class.MIR::LValue::Storage" = type { i64 }
%"class.std::vector.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = type { %"struct.std::_Vector_base<MIR::LValue::Wrapper, std::allocator<MIR::LValue::Wrapper>>::_Vector_impl" }
%"struct.std::_Vector_base<MIR::LValue::Wrapper, std::allocator<MIR::LValue::Wrapper>>::_Vector_impl" = type { %"struct.std::_Vector_base<MIR::LValue::Wrapper, std::allocator<MIR::LValue::Wrapper>>::_Vector_impl_data" }
%"struct.std::_Vector_base<MIR::LValue::Wrapper, std::allocator<MIR::LValue::Wrapper>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.MIR::TypeResolve" = type { i32, ptr, ptr, ptr, %struct.FmtLambda, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct.FmtLambda = type { %"class.std::function" }
%"struct.std::pair" = type { %"struct.HIR::Pattern", %"class.HIR::TypeRef" }
%"struct.HIR::Pattern" = type <{ %"class.std::vector.272", %"class.HIR::Pattern::Data", i32, [4 x i8] }>
%"class.std::vector.272" = type { %"struct.std::_Vector_base.273" }
%"struct.std::_Vector_base.273" = type { %"struct.std::_Vector_base<HIR::PatternBinding, std::allocator<HIR::PatternBinding>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::PatternBinding, std::allocator<HIR::PatternBinding>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::PatternBinding, std::allocator<HIR::PatternBinding>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::PatternBinding, std::allocator<HIR::PatternBinding>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.HIR::Pattern::Data" = type { i32, %"union.HIR::Pattern::Data::DataUnion" }
%"union.HIR::Pattern::Data::DataUnion" = type { %"struct.HIR::Pattern::Data::Data_PathValue", [64 x i8] }
%"struct.HIR::Pattern::Data::Data_PathValue" = type { %"class.HIR::Path", %"class.HIR::Pattern::PathBinding" }
%"class.HIR::Path" = type { %"class.HIR::Path::Data" }
%"class.HIR::Path::Data" = type { i32, %"union.HIR::Path::Data::DataUnion" }
%"union.HIR::Path::Data::DataUnion" = type { %"struct.HIR::Path::Data::Data_UfcsKnown" }
%"struct.HIR::Path::Data::Data_UfcsKnown" = type { %"class.HIR::TypeRef", %"class.HIR::GenericPath", %class.RcString, %"struct.HIR::PathParams", %"class.std::unique_ptr" }
%"class.HIR::GenericPath" = type { %"struct.HIR::SimplePath", %"struct.HIR::PathParams" }
%"struct.HIR::SimplePath" = type { %class.ThinVector }
%class.ThinVector = type { ptr }
%class.RcString = type { ptr }
%"struct.HIR::PathParams" = type { %class.ThinVector.41, %class.ThinVector.42, %class.ThinVector.43 }
%class.ThinVector.41 = type { ptr }
%class.ThinVector.42 = type { ptr }
%class.ThinVector.43 = type { ptr }
%"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.45" }
%"struct.std::_Head_base.45" = type { ptr }
%"class.HIR::Pattern::PathBinding" = type { i32, %"union.HIR::Pattern::PathBinding::DataUnion" }
%"union.HIR::Pattern::PathBinding::DataUnion" = type { %"struct.HIR::Pattern::PathBinding::Data_Enum" }
%"struct.HIR::Pattern::PathBinding::Data_Enum" = type { ptr, i32 }
%"class.HIR::TypeRef" = type { ptr }
%"class.MIR::Function" = type { %"class.std::vector", %"class.std::vector.0", %"class.std::vector.4", %"class.MIR::EnumCachePtr" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<HIR::TypeRef, std::allocator<HIR::TypeRef>>::_Vector_impl" }
%"struct.std::_Vector_base<HIR::TypeRef, std::allocator<HIR::TypeRef>>::_Vector_impl" = type { %"struct.std::_Vector_base<HIR::TypeRef, std::allocator<HIR::TypeRef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HIR::TypeRef, std::allocator<HIR::TypeRef>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<MIR::BasicBlock, std::allocator<MIR::BasicBlock>>::_Vector_impl" }
%"struct.std::_Vector_base<MIR::BasicBlock, std::allocator<MIR::BasicBlock>>::_Vector_impl" = type { %"struct.std::_Vector_base<MIR::BasicBlock, std::allocator<MIR::BasicBlock>>::_Vector_impl_data" }
%"struct.std::_Vector_base<MIR::BasicBlock, std::allocator<MIR::BasicBlock>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.MIR::EnumCachePtr" = type { ptr }
%"class.MIR::LValue::Wrapper" = type { i32 }

@.str.6 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [74 x i8], align 1
@__PRETTY_FUNCTION__._ZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEj = external hidden unnamed_addr constant [117 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [24 x i8], align 1

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEj(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef %3) #1 align 2 personality ptr @__gxx_personality_v0 {
  %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 i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::function", align 8
  %13 = alloca %class.anon.271, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::function", align 8
  %18 = alloca %class.anon.303, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %26 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.MIR::LValue", ptr %27, i32 0, i32 0
  %29 = call noundef i32 @_ZNK3MIR6LValue7Storage3tagEv(ptr noundef nonnull align 8 dereferenceable(8) %28)
  switch i32 %29, label %125 [
    i32 4, label %30
    i32 3, label %31
    i32 0, label %46
    i32 1, label %75
    i32 2, label %117
  ]

30:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.7, i32 noundef 92, ptr noundef @__PRETTY_FUNCTION__._ZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEj) #6
  unreachable

31:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.MIR::LValue", ptr %32, i32 0, i32 0
  %34 = call noundef signext i8 @_ZNK3MIR6LValue7Storage9as_ReturnEv(ptr noundef nonnull align 8 dereferenceable(8) %33)
  store i8 %34, ptr %10, align 1, !tbaa !11
  %35 = getelementptr inbounds %"class.MIR::TypeResolve", ptr %26, i32 0, i32 8
  %36 = load ptr, ptr %35, align 8, !tbaa !12
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %41

38:                                               ; preds = %31
  %39 = getelementptr inbounds %"class.MIR::TypeResolve", ptr %26, i32 0, i32 8
  %40 = load ptr, ptr %39, align 8, !tbaa !12
  br label %44

41:                                               ; preds = %31
  %42 = getelementptr inbounds %"class.MIR::TypeResolve", ptr %26, i32 0, i32 5
  %43 = load ptr, ptr %42, align 8, !tbaa !17
  br label %44

44:                                               ; preds = %41, %38
  %45 = phi ptr [ %40, %38 ], [ %43, %41 ]
  store ptr %45, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  br label %125

46:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.MIR::LValue", ptr %47, i32 0, i32 0
  %49 = call noundef i32 @_ZNK3MIR6LValue7Storage11as_ArgumentEv(ptr noundef nonnull align 8 dereferenceable(8) %48)
  store i32 %49, ptr %11, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %46
  %51 = load i32, ptr %11, align 4, !tbaa !9
  %52 = zext i32 %51 to i64
  %53 = getelementptr inbounds %"class.MIR::TypeResolve", ptr %26, i32 0, i32 6
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  %55 = call noundef i64 @_ZNKSt6vectorISt4pairIN3HIR7PatternENS1_7TypeRefEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #5
  %56 = icmp ult i64 %52, %55
  br i1 %56, label %66, label %57

57:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  %58 = getelementptr inbounds %class.anon.271, ptr %13, i32 0, i32 0
  store ptr %26, ptr %58, align 8, !tbaa !19
  %59 = getelementptr inbounds %class.anon.271, ptr %13, i32 0, i32 1
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %60, ptr %59, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS4_6LValueEjE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(16) %13) #5
  invoke void @_ZNK3MIR11TypeResolve9print_bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(120) %26, ptr noundef %12)
          to label %61 unwind label %62

61:                                               ; preds = %57
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  br label %66

62:                                               ; preds = %57
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %14, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %15, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %189

66:                                               ; preds = %61, %50
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67
  %69 = getelementptr inbounds %"class.MIR::TypeResolve", ptr %26, i32 0, i32 6
  %70 = load ptr, ptr %69, align 8, !tbaa !18
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = zext i32 %71 to i64
  %73 = call noundef nonnull align 8 dereferenceable(224) ptr @_ZNKSt6vectorISt4pairIN3HIR7PatternENS1_7TypeRefEESaIS4_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef %72)
  %74 = getelementptr inbounds %"struct.std::pair", ptr %73, i32 0, i32 1
  store ptr %74, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %125

75:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.MIR::LValue", ptr %76, i32 0, i32 0
  %78 = call noundef i32 @_ZNK3MIR6LValue7Storage8as_LocalEv(ptr noundef nonnull align 8 dereferenceable(8) %77)
  store i32 %78, ptr %16, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %75
  %80 = load i32, ptr %16, align 4, !tbaa !9
  %81 = zext i32 %80 to i64
  %82 = getelementptr inbounds %"class.MIR::TypeResolve", ptr %26, i32 0, i32 7
  %83 = load ptr, ptr %82, align 8, !tbaa !21
  %84 = getelementptr inbounds %"class.MIR::Function", ptr %83, i32 0, i32 0
  %85 = call noundef i64 @_ZNKSt6vectorIN3HIR7TypeRefESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %84) #5
  %86 = icmp ult i64 %81, %85
  br i1 %86, label %96, label %87

87:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  %88 = getelementptr inbounds %class.anon.303, ptr %18, i32 0, i32 0
  store ptr %26, ptr %88, align 8, !tbaa !22
  %89 = getelementptr inbounds %class.anon.303, ptr %18, i32 0, i32 1
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %90, ptr %89, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS4_6LValueEjE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(16) %18) #5
  invoke void @_ZNK3MIR11TypeResolve9print_bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(120) %26, ptr noundef %17)
          to label %91 unwind label %92

91:                                               ; preds = %87
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  br label %96

92:                                               ; preds = %87
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %14, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %15, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %189

96:                                               ; preds = %91, %79
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  %99 = getelementptr inbounds %"class.MIR::TypeResolve", ptr %26, i32 0, i32 9
  %100 = load ptr, ptr %99, align 8, !tbaa !24
  %101 = icmp ne ptr %100, null
  br i1 %101, label %102, label %108

102:                                              ; preds = %98
  %103 = getelementptr inbounds %"class.MIR::TypeResolve", ptr %26, i32 0, i32 9
  %104 = load ptr, ptr %103, align 8, !tbaa !24
  %105 = load i32, ptr %16, align 4, !tbaa !9
  %106 = zext i32 %105 to i64
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIN3HIR7TypeRefESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef %106)
  br label %115

108:                                              ; preds = %98
  %109 = getelementptr inbounds %"class.MIR::TypeResolve", ptr %26, i32 0, i32 7
  %110 = load ptr, ptr %109, align 8, !tbaa !21
  %111 = getelementptr inbounds %"class.MIR::Function", ptr %110, i32 0, i32 0
  %112 = load i32, ptr %16, align 4, !tbaa !9
  %113 = zext i32 %112 to i64
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIN3HIR7TypeRefESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %111, i64 noundef %113)
  br label %115

115:                                              ; preds = %108, %102
  %116 = phi ptr [ %107, %102 ], [ %114, %108 ]
  store ptr %116, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %125

117:                                              ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.MIR::LValue", ptr %118, i32 0, i32 0
  %120 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNK3MIR6LValue7Storage9as_StaticEv(ptr noundef nonnull align 8 dereferenceable(8) %119)
  store ptr %120, ptr %19, align 8, !tbaa !5
  %121 = load ptr, ptr %19, align 8, !tbaa !5
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = load ptr, ptr %19, align 8, !tbaa !5
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3MIR11TypeResolve15get_static_typeERN3HIR7TypeRefERKNS1_4PathE(ptr noundef nonnull align 8 dereferenceable(120) %26, ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef nonnull align 8 dereferenceable(88) %123)
  store ptr %124, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %125

125:                                              ; preds = %117, %115, %68, %44, %4
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = getelementptr inbounds %"struct.MIR::LValue", ptr %126, i32 0, i32 1
  %128 = call noundef i64 @_ZNKSt6vectorIN3MIR6LValue7WrapperESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %127) #5
  %129 = icmp ugt i64 %128, 0
  br i1 %129, label %130, label %180

130:                                              ; preds = %125
  %131 = load i32, ptr %8, align 4, !tbaa !9
  %132 = zext i32 %131 to i64
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = getelementptr inbounds %"struct.MIR::LValue", ptr %133, i32 0, i32 1
  %135 = call noundef i64 @_ZNKSt6vectorIN3MIR6LValue7WrapperESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %134) #5
  %136 = icmp ule i64 %132, %135
  br i1 %136, label %137, label %138

137:                                              ; preds = %130
  br label %140

138:                                              ; preds = %130
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.7, i32 noundef 95, ptr noundef @__PRETTY_FUNCTION__._ZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEj) #6
  unreachable

139:                                              ; No predecessors!
  br label %140

140:                                              ; preds = %139, %137
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %"struct.MIR::LValue", ptr %141, i32 0, i32 1
  %143 = call noundef ptr @_ZNKSt6vectorIN3MIR6LValue7WrapperESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %142) #5
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = getelementptr inbounds %"struct.MIR::LValue", ptr %144, i32 0, i32 1
  %146 = call noundef i64 @_ZNKSt6vectorIN3MIR6LValue7WrapperESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %145) #5
  %147 = load i32, ptr %8, align 4, !tbaa !9
  %148 = zext i32 %147 to i64
  %149 = sub i64 %146, %148
  %150 = getelementptr inbounds %"class.MIR::LValue::Wrapper", ptr %143, i64 %149
  store ptr %150, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = getelementptr inbounds %"struct.MIR::LValue", ptr %151, i32 0, i32 1
  store ptr %152, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %153 = load ptr, ptr %21, align 8, !tbaa !5
  %154 = call ptr @_ZNKSt6vectorIN3MIR6LValue7WrapperESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %153) #5
  %155 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %154, ptr %155, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %156 = load ptr, ptr %21, align 8, !tbaa !5
  %157 = call ptr @_ZNKSt6vectorIN3MIR6LValue7WrapperESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %156) #5
  %158 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %157, ptr %158, align 8
  br label %159

159:                                              ; preds = %176, %140
  %160 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN3MIR6LValue7WrapperESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  br i1 %160, label %162, label %161

161:                                              ; preds = %159
  store i32 7, ptr %24, align 4
  br label %178

162:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN3MIR6LValue7WrapperESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  store ptr %163, ptr %25, align 8, !tbaa !5
  %164 = load ptr, ptr %25, align 8, !tbaa !5
  %165 = load ptr, ptr %20, align 8, !tbaa !5
  %166 = icmp eq ptr %164, %165
  br i1 %166, label %167, label %168

167:                                              ; preds = %162
  store i32 7, ptr %24, align 4
  br label %173

168:                                              ; preds = %162
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  %170 = load ptr, ptr %25, align 8, !tbaa !5
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  %172 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3MIR11TypeResolve18get_unwrapped_typeERN3HIR7TypeRefERKNS_6LValue7WrapperERKS2_(ptr noundef nonnull align 8 dereferenceable(120) %26, ptr noundef nonnull align 8 dereferenceable(8) %169, ptr noundef nonnull align 4 dereferenceable(4) %170, ptr noundef nonnull align 8 dereferenceable(8) %171)
  store ptr %172, ptr %9, align 8, !tbaa !5
  store i32 0, ptr %24, align 4
  br label %173

173:                                              ; preds = %168, %167
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  %174 = load i32, ptr %24, align 4
  switch i32 %174, label %178 [
    i32 0, label %175
  ]

175:                                              ; preds = %173
  br label %176

176:                                              ; preds = %175
  %177 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN3MIR6LValue7WrapperESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  br label %159

178:                                              ; preds = %173, %161
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %179

179:                                              ; preds = %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %187

180:                                              ; preds = %125
  %181 = load i32, ptr %8, align 4, !tbaa !9
  %182 = icmp eq i32 %181, 0
  br i1 %182, label %183, label %184

183:                                              ; preds = %180
  br label %186

184:                                              ; preds = %180
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.7, i32 noundef 106, ptr noundef @__PRETTY_FUNCTION__._ZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEj) #6
  unreachable

185:                                              ; No predecessors!
  br label %186

186:                                              ; preds = %185, %183
  br label %187

187:                                              ; preds = %186, %179
  %188 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 1, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret ptr %188

189:                                              ; preds = %92, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %190

190:                                              ; preds = %189
  %191 = load ptr, ptr %14, align 8
  %192 = load i32, ptr %15, align 4
  %193 = insertvalue { ptr, i32 } poison, ptr %191, 0
  %194 = insertvalue { ptr, i32 } %193, i32 %192, 1
  resume { ptr, i32 } %194
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(224) ptr @_ZNKSt6vectorISt4pairIN3HIR7PatternENS1_7TypeRefEESaIS4_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN3MIR6LValue7WrapperESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #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

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 = { noreturn 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 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 = { 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 #5 = { nounwind }
attributes #6 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 88}
!13 = !{!"_ZTSN3MIR11TypeResolveE", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !14, i64 32, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !10, i64 112, !10, i64 116}
!14 = !{!"_ZTS9FmtLambda", !15, i64 0}
!15 = !{!"_ZTSSt8functionIFvRSoEE", !16, i64 0, !6, i64 24}
!16 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!17 = !{!13, !6, i64 64}
!18 = !{!13, !6, i64 72}
!19 = !{!20, !6, i64 0}
!20 = !{!"_ZTSZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEjE3$_0", !6, i64 0, !6, i64 8}
!21 = !{!13, !6, i64 80}
!22 = !{!23, !6, i64 0}
!23 = !{!"_ZTSZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEjE3$_1", !6, i64 0, !6, i64 8}
!24 = !{!13, !6, i64 96}


; 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.271 = type { ptr, ptr }
%class.anon.303 = type { ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.MIR::LValue::Wrapper" = type { i32 }

@.str.6 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [74 x i8], align 1
@__PRETTY_FUNCTION__._ZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEj = external hidden unnamed_addr constant [117 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [24 x i8], align 1

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEj(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef %3) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::function", align 8
  %6 = alloca %class.anon.271, align 8
  %7 = alloca %"class.std::function", align 8
  %8 = alloca %class.anon.303, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = tail call noundef i32 @_ZNK3MIR6LValue7Storage3tagEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  switch i32 %11, label %59 [
    i32 4, label %12
    i32 3, label %13
    i32 0, label %20
    i32 1, label %36
    i32 2, label %56
  ]

12:                                               ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7, i32 noundef 92, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEj) #5
  unreachable

13:                                               ; preds = %4
  %14 = tail call noundef signext i8 @_ZNK3MIR6LValue7Storage9as_ReturnEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %15 = getelementptr inbounds i8, ptr %0, i64 88
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %.not42 = icmp eq ptr %16, null
  %17 = getelementptr inbounds i8, ptr %0, i64 64
  %18 = load ptr, ptr %17, align 8
  %19 = select i1 %.not42, ptr %18, ptr %16
  br label %59

20:                                               ; preds = %4
  %21 = tail call noundef i32 @_ZNK3MIR6LValue7Storage11as_ArgumentEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %22 = zext i32 %21 to i64
  %23 = getelementptr inbounds i8, ptr %0, i64 72
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  %25 = tail call noundef i64 @_ZNKSt6vectorISt4pairIN3HIR7PatternENS1_7TypeRefEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #6
  %26 = icmp ugt i64 %25, %22
  br i1 %26, label %32, label %27

27:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  store ptr %0, ptr %6, align 8, !tbaa !15
  %28 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %2, ptr %28, align 8, !tbaa !17
  call void @"_ZNSt8functionIFvRSoEEC2IZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS4_6LValueEjE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  invoke void @_ZNK3MIR11TypeResolve9print_bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull %5)
          to label %29 unwind label %30

29:                                               ; preds = %27
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  br label %32

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

32:                                               ; preds = %29, %20
  %33 = load ptr, ptr %23, align 8, !tbaa !14
  %34 = call noundef nonnull align 8 dereferenceable(224) ptr @_ZNKSt6vectorISt4pairIN3HIR7PatternENS1_7TypeRefEESaIS4_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %22)
  %35 = getelementptr inbounds i8, ptr %34, i64 216
  br label %59

36:                                               ; preds = %4
  %37 = tail call noundef i32 @_ZNK3MIR6LValue7Storage8as_LocalEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds i8, ptr %0, i64 80
  %40 = load ptr, ptr %39, align 8, !tbaa !18
  %41 = tail call noundef i64 @_ZNKSt6vectorIN3HIR7TypeRefESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #6
  %42 = icmp ugt i64 %41, %38
  br i1 %42, label %48, label %43

43:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  store ptr %0, ptr %8, align 8, !tbaa !19
  %44 = getelementptr inbounds i8, ptr %8, i64 8
  store ptr %2, ptr %44, align 8, !tbaa !17
  call void @"_ZNSt8functionIFvRSoEEC2IZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS4_6LValueEjE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  invoke void @_ZNK3MIR11TypeResolve9print_bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull %7)
          to label %45 unwind label %46

45:                                               ; preds = %43
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  br label %48

46:                                               ; preds = %43
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  br label %83

48:                                               ; preds = %45, %36
  %49 = getelementptr inbounds i8, ptr %0, i64 96
  %50 = load ptr, ptr %49, align 8, !tbaa !21
  %.not = icmp eq ptr %50, null
  br i1 %.not, label %53, label %51

51:                                               ; preds = %48
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIN3HIR7TypeRefESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %38)
  br label %59

53:                                               ; preds = %48
  %54 = load ptr, ptr %39, align 8, !tbaa !18
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIN3HIR7TypeRefESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %54, i64 noundef %38)
  br label %59

56:                                               ; preds = %4
  %57 = tail call noundef nonnull align 8 dereferenceable(88) ptr @_ZNK3MIR6LValue7Storage9as_StaticEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3MIR11TypeResolve15get_static_typeERN3HIR7TypeRefERKNS1_4PathE(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(88) %57)
  br label %59

59:                                               ; preds = %51, %53, %56, %32, %13, %4
  %.0 = phi ptr [ null, %4 ], [ %58, %56 ], [ %35, %32 ], [ %19, %13 ], [ %52, %51 ], [ %55, %53 ]
  %60 = getelementptr inbounds i8, ptr %2, i64 8
  %61 = call noundef i64 @_ZNKSt6vectorIN3MIR6LValue7WrapperESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #6
  %.not43 = icmp eq i64 %61, 0
  br i1 %.not43, label %79, label %62

62:                                               ; preds = %59
  %63 = zext i32 %3 to i64
  %64 = call noundef i64 @_ZNKSt6vectorIN3MIR6LValue7WrapperESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #6
  %.not44 = icmp ult i64 %64, %63
  br i1 %.not44, label %65, label %66

65:                                               ; preds = %62
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.7, i32 noundef 95, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEj) #5
  unreachable

66:                                               ; preds = %62
  %67 = call noundef ptr @_ZNKSt6vectorIN3MIR6LValue7WrapperESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #6
  %68 = call noundef i64 @_ZNKSt6vectorIN3MIR6LValue7WrapperESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #6
  %69 = sub i64 %68, %63
  %70 = getelementptr inbounds %"class.MIR::LValue::Wrapper", ptr %67, i64 %69
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %71 = call ptr @_ZNKSt6vectorIN3MIR6LValue7WrapperESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #6
  store ptr %71, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %72 = call ptr @_ZNKSt6vectorIN3MIR6LValue7WrapperESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #6
  store ptr %72, ptr %10, align 8
  %73 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN3MIR6LValue7WrapperESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %73, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %66, %75
  %.147 = phi ptr [ %76, %75 ], [ %.0, %66 ]
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN3MIR6LValue7WrapperESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %.not45 = icmp eq ptr %74, %70
  br i1 %.not45, label %.thread, label %75

75:                                               ; preds = %.lr.ph
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3MIR11TypeResolve18get_unwrapped_typeERN3HIR7TypeRefERKNS_6LValue7WrapperERKS2_(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %74, ptr noundef nonnull align 8 dereferenceable(8) %.147)
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN3MIR6LValue7WrapperESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %78 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN3MIR6LValue7WrapperESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %78, label %.lr.ph, label %.thread

.thread:                                          ; preds = %75, %.lr.ph, %66
  %.1.lcssa = phi ptr [ %.0, %66 ], [ %.147, %.lr.ph ], [ %76, %75 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %82

79:                                               ; preds = %59
  %80 = icmp eq i32 %3, 0
  br i1 %80, label %82, label %81

81:                                               ; preds = %79
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.7, i32 noundef 106, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEj) #5
  unreachable

82:                                               ; preds = %79, %.thread
  %.4 = phi ptr [ %.1.lcssa, %.thread ], [ %.0, %79 ]
  ret ptr %.4

83:                                               ; preds = %46, %30
  %.pn = phi { ptr, i32 } [ %47, %46 ], [ %31, %30 ]
  resume { ptr, i32 } %.pn
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(224) ptr @_ZNKSt6vectorISt4pairIN3HIR7PatternENS1_7TypeRefEESaIS4_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN3MIR6LValue7WrapperESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) 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

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 = { noreturn 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 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 = { 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 #5 = { noreturn nounwind }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 88}
!6 = !{!"_ZTSN3MIR11TypeResolveE", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !11, i64 32, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !7, i64 112, !7, i64 116}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTS9FmtLambda", !12, i64 0}
!12 = !{!"_ZTSSt8functionIFvRSoEE", !13, i64 0, !10, i64 24}
!13 = !{!"_ZTSSt14_Function_base", !8, i64 0, !10, i64 16}
!14 = !{!6, !10, i64 72}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTSZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEjE3$_0", !10, i64 0, !10, i64 8}
!17 = !{!10, !10, i64 0}
!18 = !{!6, !10, i64 80}
!19 = !{!20, !10, i64 0}
!20 = !{!"_ZTSZNK3MIR11TypeResolve15get_lvalue_typeERN3HIR7TypeRefERKNS_6LValueEjE3$_1", !10, i64 0, !10, i64 8}
!21 = !{!6, !10, i64 96}


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