; LLVM IR from thepowersgang/mrustc :: src/mir/mir_builder.ll (ZN10MirBuilder15terminate_scopeERK4Span11ScopeHandleb)

; 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.TraceLog = type { ptr, %"class.std::function" }
%"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.431 = type { ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.Span = type { ptr }
%class.anon.432 = type { ptr }
%class.anon.433 = type { ptr, ptr, ptr }
%class.MirBuilder = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i8, %"class.MIR::RValue", i8, [7 x i8], %class.VarState, %"class.std::vector.26", %"class.std::vector.26", i64, %"class.std::map", %"class.std::vector.42", %"class.std::vector.47", %class.ScopeHandle, %"class.std::vector.52", %"struct.MIR::LValue" }
%"class.MIR::RValue" = type { i32, %"union.MIR::RValue::DataUnion" }
%"union.MIR::RValue::DataUnion" = type { %"struct.MIR::RValue::Data_BinOp" }
%"struct.MIR::RValue::Data_BinOp" = type { %"class.MIR::Param", i32, %"class.MIR::Param" }
%"class.MIR::Param" = type { i32, %"union.MIR::Param::DataUnion" }
%"union.MIR::Param::DataUnion" = type { %"struct.MIR::Param::Data_Borrow" }
%"struct.MIR::Param::Data_Borrow" = type { i32, %"struct.MIR::LValue" }
%class.VarState = type { i32, [4 x i8], %"union.VarState::DataUnion" }
%"union.VarState::DataUnion" = type { i32, [28 x i8] }
%"class.std::vector.26" = type { %"struct.std::_Vector_base.27" }
%"struct.std::_Vector_base.27" = type { %"struct.std::_Vector_base<VarState, std::allocator<VarState>>::_Vector_impl" }
%"struct.std::_Vector_base<VarState, std::allocator<VarState>>::_Vector_impl" = type { %"struct.std::_Vector_base<VarState, std::allocator<VarState>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VarState, std::allocator<VarState>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, unsigned int>, std::_Select1st<std::pair<const unsigned int, unsigned int>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, unsigned int>, std::_Select1st<std::pair<const unsigned int, unsigned int>>, std::less<unsigned int>>::_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.std::vector.42" = type { %"struct.std::_Vector_base.43" }
%"struct.std::_Vector_base.43" = type { %"struct.std::_Vector_base<MirBuilder::ScopeDef, std::allocator<MirBuilder::ScopeDef>>::_Vector_impl" }
%"struct.std::_Vector_base<MirBuilder::ScopeDef, std::allocator<MirBuilder::ScopeDef>>::_Vector_impl" = type { %"struct.std::_Vector_base<MirBuilder::ScopeDef, std::allocator<MirBuilder::ScopeDef>>::_Vector_impl_data" }
%"struct.std::_Vector_base<MirBuilder::ScopeDef, std::allocator<MirBuilder::ScopeDef>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.47" = type { %"struct.std::_Vector_base.48" }
%"struct.std::_Vector_base.48" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.ScopeHandle = type <{ ptr, i32, [4 x i8] }>
%"class.std::vector.52" = type { %"struct.std::_Vector_base.53" }
%"struct.std::_Vector_base.53" = type { %"struct.std::_Vector_base<std::pair<HIR::PatternBinding::Type, MIR::LValue>, std::allocator<std::pair<HIR::PatternBinding::Type, MIR::LValue>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<HIR::PatternBinding::Type, MIR::LValue>, std::allocator<std::pair<HIR::PatternBinding::Type, MIR::LValue>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<HIR::PatternBinding::Type, MIR::LValue>, std::allocator<std::pair<HIR::PatternBinding::Type, MIR::LValue>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<HIR::PatternBinding::Type, MIR::LValue>, std::allocator<std::pair<HIR::PatternBinding::Type, MIR::LValue>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.MIR::LValue" = type { %"class.MIR::LValue::Storage", %"class.std::vector" }
%"class.MIR::LValue::Storage" = type { i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%"struct.MirBuilder::ScopeDef" = type { ptr, i8, %class.ScopeType }
%class.ScopeType = type { i32, %"union.ScopeType::DataUnion" }
%"union.ScopeType::DataUnion" = type { %"struct.ScopeType::Data_Loop" }
%"struct.ScopeType::Data_Loop" = type { %"class.std::map.252", %"class.std::map.252", i8, %struct.SplitEnd, i32, %"class.std::vector.47" }
%"class.std::map.252" = type { %"class.std::_Rb_tree.253" }
%"class.std::_Rb_tree.253" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, VarState>, std::_Select1st<std::pair<const unsigned int, VarState>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, VarState>, std::_Select1st<std::pair<const unsigned int, VarState>>, std::less<unsigned int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%struct.SplitEnd = type { %"class.std::map.252", %"class.std::map.252" }

@g_debug_indent_level = external global i32, align 4
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@__func__._ZN10MirBuilder15terminate_scopeERK4Span11ScopeHandleb = external hidden unnamed_addr constant [16 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [2 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; 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

declare noundef zeroext i1 @_Z13debug_enabledv() #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_Z12debug_outputiPKc(i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10MirBuilder15terminate_scopeERK4Span11ScopeHandleb(ptr noundef nonnull align 8 dereferenceable(440) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, i1 noundef zeroext %3) #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca %class.TraceLog, align 8
  %10 = alloca %"class.std::function", align 8
  %11 = alloca %class.anon.431, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %struct.Span, align 8
  %19 = alloca %"class.std::function", align 8
  %20 = alloca %class.anon.432, align 8
  %21 = alloca %struct.Span, align 8
  %22 = alloca %"class.std::function", align 8
  %23 = alloca %class.anon.433, align 8
  %24 = 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
  %25 = zext i1 %3 to i8
  store i8 %25, ptr %8, align 1, !tbaa !9
  %26 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #7
  %27 = call noundef zeroext i1 @_Z13debug_enabledv()
  %28 = zext i1 %27 to i64
  %29 = select i1 %27, ptr @__func__._ZN10MirBuilder15terminate_scopeERK4Span11ScopeHandleb, ptr null
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  %30 = getelementptr inbounds %class.anon.431, ptr %11, i32 0, i32 0
  store ptr %2, ptr %30, align 8, !tbaa !5
  %31 = getelementptr inbounds %class.anon.431, ptr %11, i32 0, i32 1
  store ptr %8, ptr %31, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZN10MirBuilder15terminate_scopeERK4Span11ScopeHandlebE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  invoke void @_ZN8TraceLogC1EPKcSt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef %29, ptr noundef %10)
          to label %32 unwind label %61

32:                                               ; preds = %4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  %33 = getelementptr inbounds %class.MirBuilder, ptr %26, i32 0, i32 17
  %34 = call noundef zeroext i1 @_ZNKSt6vectorIjSaIjEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #7
  br i1 %34, label %42, label %35

35:                                               ; preds = %32
  %36 = getelementptr inbounds %class.MirBuilder, ptr %26, i32 0, i32 17
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #7
  %38 = load i32, ptr %37, align 4, !tbaa !11
  %39 = getelementptr inbounds %class.ScopeHandle, ptr %2, i32 0, i32 1
  %40 = load i32, ptr %39, align 8, !tbaa !13
  %41 = icmp ne i32 %38, %40
  br i1 %41, label %42, label %149

42:                                               ; preds = %35, %32
  br label %43

43:                                               ; preds = %42
  %44 = invoke noundef zeroext i1 @_Z13debug_enabledv()
          to label %45 unwind label %65

45:                                               ; preds = %43
  br i1 %44, label %46, label %69

46:                                               ; preds = %45
  %47 = load i32, ptr @g_debug_indent_level, align 4, !tbaa !11
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z12debug_outputiPKc(i32 noundef %47, ptr noundef @__func__._ZN10MirBuilder15terminate_scopeERK4Span11ScopeHandleb)
          to label %49 unwind label %65

49:                                               ; preds = %46
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef @.str.44)
          to label %51 unwind label %65

51:                                               ; preds = %49
  %52 = getelementptr inbounds %class.MirBuilder, ptr %26, i32 0, i32 17
  %53 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIjERSoS0_RKSt6vectorIT_SaIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull align 8 dereferenceable(24) %52)
          to label %54 unwind label %65

54:                                               ; preds = %51
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef @.str.45)
          to label %56 unwind label %65

56:                                               ; preds = %54
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef @_ZSt3decRSt8ios_base)
          to label %58 unwind label %65

58:                                               ; preds = %56
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %60 unwind label %65

60:                                               ; preds = %58
  br label %69

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

65:                                               ; preds = %58, %56, %54, %51, %49, %46, %43
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %12, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %13, align 4
  br label %176

69:                                               ; preds = %60, %45
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %72 = getelementptr inbounds %class.MirBuilder, ptr %26, i32 0, i32 17
  %73 = call ptr @_ZNSt6vectorIjSaIjEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %72) #7
  %74 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %73, ptr %74, align 8
  %75 = getelementptr inbounds %class.MirBuilder, ptr %26, i32 0, i32 17
  %76 = call ptr @_ZNSt6vectorIjSaIjEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #7
  %77 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %76, ptr %77, align 8
  %78 = getelementptr inbounds %class.ScopeHandle, ptr %2, i32 0, i32 1
  %79 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8
  %81 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8
  %83 = invoke ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEEjET_S7_S7_RKT0_(ptr %80, ptr %82, ptr noundef nonnull align 4 dereferenceable(4) %78)
          to label %84 unwind label %98

84:                                               ; preds = %71
  %85 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %83, ptr %85, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %86 = getelementptr inbounds %class.MirBuilder, ptr %26, i32 0, i32 17
  %87 = call ptr @_ZNSt6vectorIjSaIjEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %86) #7
  %88 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %87, ptr %88, align 8
  %89 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br i1 %89, label %90, label %117

90:                                               ; preds = %84
  br label %91

91:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN4SpanC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %92)
          to label %93 unwind label %102

93:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %94 = getelementptr inbounds %class.anon.432, ptr %20, i32 0, i32 0
  store ptr %2, ptr %94, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZN10MirBuilder15terminate_scopeERK4Span11ScopeHandlebE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef %19)
          to label %95 unwind label %106

95:                                               ; preds = %93
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %96 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %96, ptr noundef @.str.9)
          to label %97 unwind label %111

97:                                               ; preds = %95
  invoke void @__cxa_throw(ptr %96, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
          to label %183 unwind label %98

98:                                               ; preds = %127, %97, %71
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %12, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %13, align 4
  br label %148

102:                                              ; preds = %91
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %12, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %13, align 4
  br label %110

106:                                              ; preds = %93
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %12, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %13, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br label %110

110:                                              ; preds = %106, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %148

111:                                              ; preds = %95
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %12, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %13, align 4
  call void @__cxa_free_exception(ptr %96) #7
  br label %148

115:                                              ; No predecessors!
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116, %84
  br label %118

118:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN4SpanC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %119)
          to label %120 unwind label %128

120:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #7
  %121 = getelementptr inbounds %class.anon.433, ptr %23, i32 0, i32 0
  store ptr %2, ptr %121, align 8, !tbaa !5
  %122 = getelementptr inbounds %class.anon.433, ptr %23, i32 0, i32 1
  store ptr %26, ptr %122, align 8, !tbaa !15
  %123 = getelementptr inbounds %class.anon.433, ptr %23, i32 0, i32 2
  store ptr %14, ptr %123, align 8, !tbaa !5
  invoke void @"_ZNSt8functionIFvRSoEEC2IZN10MirBuilder15terminate_scopeERK4Span11ScopeHandlebE3$_2vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %124 unwind label %132

124:                                              ; preds = %120
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef %22)
          to label %125 unwind label %136

125:                                              ; preds = %124
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  %126 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %126, ptr noundef @.str.9)
          to label %127 unwind label %142

127:                                              ; preds = %125
  invoke void @__cxa_throw(ptr %126, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
          to label %183 unwind label %98

128:                                              ; preds = %118
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %12, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %13, align 4
  br label %141

132:                                              ; preds = %120
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %12, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %13, align 4
  br label %140

136:                                              ; preds = %124
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %12, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %13, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #7
  br label %140

140:                                              ; preds = %136, %132
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  br label %141

141:                                              ; preds = %140, %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %148

142:                                              ; preds = %125
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %12, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %13, align 4
  call void @__cxa_free_exception(ptr %126) #7
  br label %148

146:                                              ; No predecessors!
  br label %147

147:                                              ; preds = %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %149

148:                                              ; preds = %142, %141, %111, %110, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %176

149:                                              ; preds = %147, %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %150 = getelementptr inbounds %class.MirBuilder, ptr %26, i32 0, i32 16
  %151 = getelementptr inbounds %class.ScopeHandle, ptr %2, i32 0, i32 1
  %152 = load i32, ptr %151, align 8, !tbaa !13
  %153 = zext i32 %152 to i64
  %154 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZNSt6vectorIN10MirBuilder8ScopeDefESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %150, i64 noundef %153)
          to label %155 unwind label %168

155:                                              ; preds = %149
  store ptr %154, ptr %24, align 8, !tbaa !5
  %156 = load i8, ptr %8, align 1, !tbaa !9, !range !17, !noundef !18
  %157 = trunc i8 %156 to i1
  br i1 %157, label %158, label %172

158:                                              ; preds = %155
  %159 = load ptr, ptr %24, align 8, !tbaa !5
  %160 = getelementptr inbounds %"struct.MirBuilder::ScopeDef", ptr %159, i32 0, i32 1
  %161 = load i8, ptr %160, align 8, !tbaa !19, !range !17, !noundef !18
  %162 = trunc i8 %161 to i1
  %163 = zext i1 %162 to i32
  %164 = icmp eq i32 %163, 0
  br i1 %164, label %165, label %172

165:                                              ; preds = %158
  %166 = load ptr, ptr %24, align 8, !tbaa !5
  invoke void @_ZN10MirBuilder17drop_scope_valuesERKNS_8ScopeDefE(ptr noundef nonnull align 8 dereferenceable(440) %26, ptr noundef nonnull align 8 dereferenceable(256) %166)
          to label %167 unwind label %168

167:                                              ; preds = %165
  br label %172

168:                                              ; preds = %172, %165, %149
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %12, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %176

172:                                              ; preds = %167, %158, %155
  %173 = getelementptr inbounds %class.MirBuilder, ptr %26, i32 0, i32 17
  call void @_ZNSt6vectorIjSaIjEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %173) #7
  %174 = load ptr, ptr %24, align 8, !tbaa !5
  invoke void @_ZN10MirBuilder14complete_scopeERNS_8ScopeDefE(ptr noundef nonnull align 8 dereferenceable(440) %26, ptr noundef nonnull align 8 dereferenceable(256) %174)
          to label %175 unwind label %168

175:                                              ; preds = %172
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #7
  ret void

176:                                              ; preds = %168, %148, %65
  call void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #7
  br label %177

177:                                              ; preds = %176, %61
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #7
  br label %178

178:                                              ; preds = %177
  %179 = load ptr, ptr %12, align 8
  %180 = load i32, ptr %13, align 4
  %181 = insertvalue { ptr, i32 } poison, ptr %179, 0
  %182 = insertvalue { ptr, i32 } %181, i32 %180, 1
  resume { ptr, i32 } %182

183:                                              ; preds = %127, %97
  unreachable
}

; Function Attrs: nounwind
declare void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEEjET_S7_S7_RKT0_(ptr, ptr, ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

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

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

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

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 nounwind uwtable
declare hidden void @"_ZNSt8functionIFvRSoEEC2IZN10MirBuilder15terminate_scopeERK4Span11ScopeHandlebE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10MirBuilder17drop_scope_valuesERKNS_8ScopeDefE(ptr noundef nonnull align 8 dereferenceable(440), ptr noundef nonnull align 8 dereferenceable(256)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10MirBuilder14complete_scopeERNS_8ScopeDefE(ptr noundef nonnull align 8 dereferenceable(440), ptr noundef nonnull align 8 dereferenceable(256)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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 #5 = { 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 = { 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 #7 = { nounwind }
attributes #8 = { noreturn }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"_ZTS11ScopeHandle", !6, i64 0, !12, i64 8}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTSZN10MirBuilder15terminate_scopeERK4Span11ScopeHandlebE3$_2", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !10, i64 8}
!20 = !{!"_ZTSN10MirBuilder8ScopeDefE", !6, i64 0, !10, i64 8, !21, i64 16}
!21 = !{!"_ZTS9ScopeType", !22, i64 0, !7, i64 8}
!22 = !{!"_ZTSN9ScopeType3TagE", !7, i64 0}


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

%class.TraceLog = type { ptr, %"class.std::function" }
%"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.431 = type { ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.Span = type { ptr }
%class.anon.432 = type { ptr }
%class.anon.433 = type { ptr, ptr, ptr }

@g_debug_indent_level = external local_unnamed_addr global i32, align 4
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@__func__._ZN10MirBuilder15terminate_scopeERK4Span11ScopeHandleb = external hidden unnamed_addr constant [16 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [2 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; 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

declare noundef zeroext i1 @_Z13debug_enabledv() local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_Z12debug_outputiPKc(i32 noundef, ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10MirBuilder15terminate_scopeERK4Span11ScopeHandleb(ptr noundef nonnull align 8 dereferenceable(440) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, i1 noundef zeroext %3) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i8, align 1
  %6 = alloca %class.TraceLog, align 8
  %7 = alloca %"class.std::function", align 8
  %8 = alloca %class.anon.431, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %struct.Span, align 8
  %12 = alloca %"class.std::function", align 8
  %13 = alloca %class.anon.432, align 8
  %14 = alloca %struct.Span, align 8
  %15 = alloca %"class.std::function", align 8
  %16 = alloca %class.anon.433, align 8
  %17 = zext i1 %3 to i8
  store i8 %17, ptr %5, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #7
  %18 = tail call noundef zeroext i1 @_Z13debug_enabledv()
  %19 = select i1 %18, ptr @__func__._ZN10MirBuilder15terminate_scopeERK4Span11ScopeHandleb, ptr null
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  store ptr %2, ptr %8, align 8, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %8, i64 8
  store ptr %5, ptr %20, align 8, !tbaa !9
  call void @"_ZNSt8functionIFvRSoEEC2IZN10MirBuilder15terminate_scopeERK4Span11ScopeHandlebE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  invoke void @_ZN8TraceLogC1EPKcSt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef %19, ptr noundef nonnull %7)
          to label %21 unwind label %45

21:                                               ; preds = %4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  %22 = getelementptr inbounds i8, ptr %0, i64 344
  %23 = call noundef zeroext i1 @_ZNKSt6vectorIjSaIjEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  br i1 %23, label %29, label %24

24:                                               ; preds = %21
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  %26 = load i32, ptr %25, align 4, !tbaa !11
  %27 = getelementptr inbounds i8, ptr %2, i64 8
  %28 = load i32, ptr %27, align 8, !tbaa !13
  %.not = icmp eq i32 %26, %28
  br i1 %.not, label %89, label %29

29:                                               ; preds = %21, %24
  %30 = invoke noundef zeroext i1 @_Z13debug_enabledv()
          to label %31 unwind label %47

31:                                               ; preds = %29
  br i1 %30, label %32, label %49

32:                                               ; preds = %31
  %33 = load i32, ptr @g_debug_indent_level, align 4, !tbaa !11
  %34 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_Z12debug_outputiPKc(i32 noundef %33, ptr noundef nonnull @__func__._ZN10MirBuilder15terminate_scopeERK4Span11ScopeHandleb)
          to label %35 unwind label %47

35:                                               ; preds = %32
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull @.str.44)
          to label %37 unwind label %47

37:                                               ; preds = %35
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIjERSoS0_RKSt6vectorIT_SaIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %39 unwind label %47

39:                                               ; preds = %37
  %40 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull @.str.45)
          to label %41 unwind label %47

41:                                               ; preds = %39
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef nonnull @_ZSt3decRSt8ios_base)
          to label %43 unwind label %47

43:                                               ; preds = %41
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %49 unwind label %47

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

47:                                               ; preds = %43, %41, %39, %37, %35, %32, %29
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %104

49:                                               ; preds = %43, %31
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %50 = call ptr @_ZNSt6vectorIjSaIjEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  %51 = call ptr @_ZNSt6vectorIjSaIjEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  %52 = getelementptr inbounds i8, ptr %2, i64 8
  %53 = invoke ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEEjET_S7_S7_RKT0_(ptr %50, ptr %51, ptr noundef nonnull align 4 dereferenceable(4) %52)
          to label %54 unwind label %61

54:                                               ; preds = %49
  store ptr %53, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %55 = call ptr @_ZNSt6vectorIjSaIjEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  store ptr %55, ptr %10, align 8
  %56 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br i1 %56, label %57, label %70

57:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  invoke void @_ZN4SpanC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %58 unwind label %63

58:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  store ptr %2, ptr %13, align 8, !tbaa !9
  call void @"_ZNSt8functionIFvRSoEEC2IZN10MirBuilder15terminate_scopeERK4Span11ScopeHandlebE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull %12)
          to label %59 unwind label %65

59:                                               ; preds = %58
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  %60 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef nonnull @.str.9)
          to label %.invoke unwind label %68

61:                                               ; preds = %.invoke, %49
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %88

63:                                               ; preds = %57
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %67

65:                                               ; preds = %58
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br label %67

67:                                               ; preds = %65, %63
  %.pn17 = phi { ptr, i32 } [ %66, %65 ], [ %64, %63 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br label %88

68:                                               ; preds = %59
  %69 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %60) #7
  br label %88

70:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  invoke void @_ZN4SpanC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %71 unwind label %78

71:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #7
  store ptr %2, ptr %16, align 8, !tbaa !9
  %72 = getelementptr inbounds i8, ptr %16, i64 8
  store ptr %0, ptr %72, align 8, !tbaa !15
  %73 = getelementptr inbounds i8, ptr %16, i64 16
  store ptr %9, ptr %73, align 8, !tbaa !9
  invoke void @"_ZNSt8functionIFvRSoEEC2IZN10MirBuilder15terminate_scopeERK4Span11ScopeHandlebE3$_2vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %74 unwind label %80

74:                                               ; preds = %71
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull %15)
          to label %75 unwind label %82

75:                                               ; preds = %74
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  %76 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %76, ptr noundef nonnull @.str.9)
          to label %.invoke unwind label %86

.invoke:                                          ; preds = %59, %75
  %77 = phi ptr [ %76, %75 ], [ %60, %59 ]
  invoke void @__cxa_throw(ptr nonnull %77, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #8
          to label %.cont unwind label %61

.cont:                                            ; preds = %.invoke
  unreachable

78:                                               ; preds = %70
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %85

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

82:                                               ; preds = %74
  %83 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  br label %84

84:                                               ; preds = %82, %80
  %.pn = phi { ptr, i32 } [ %83, %82 ], [ %81, %80 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br label %85

85:                                               ; preds = %84, %78
  %.pn.pn = phi { ptr, i32 } [ %.pn, %84 ], [ %79, %78 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  br label %88

86:                                               ; preds = %75
  %87 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %76) #7
  br label %88

88:                                               ; preds = %86, %85, %68, %67, %61
  %.pn19 = phi { ptr, i32 } [ %62, %61 ], [ %69, %68 ], [ %.pn17, %67 ], [ %87, %86 ], [ %.pn.pn, %85 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %104

89:                                               ; preds = %24
  %90 = getelementptr inbounds i8, ptr %0, i64 320
  %91 = zext i32 %26 to i64
  %92 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZNSt6vectorIN10MirBuilder8ScopeDefESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %90, i64 noundef %91)
          to label %93 unwind label %100

93:                                               ; preds = %89
  %94 = load i8, ptr %5, align 1, !tbaa !5, !range !17, !noundef !18
  %95 = trunc nuw i8 %94 to i1
  %96 = getelementptr inbounds i8, ptr %92, i64 8
  %97 = load i8, ptr %96, align 8, !range !17
  %98 = icmp eq i8 %97, 0
  %or.cond = select i1 %95, i1 %98, i1 false
  br i1 %or.cond, label %99, label %102

99:                                               ; preds = %93
  invoke void @_ZN10MirBuilder17drop_scope_valuesERKNS_8ScopeDefE(ptr noundef nonnull align 8 dereferenceable(440) %0, ptr noundef nonnull align 8 dereferenceable(256) %92)
          to label %102 unwind label %100

100:                                              ; preds = %102, %99, %89
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %104

102:                                              ; preds = %99, %93
  call void @_ZNSt6vectorIjSaIjEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  invoke void @_ZN10MirBuilder14complete_scopeERNS_8ScopeDefE(ptr noundef nonnull align 8 dereferenceable(440) %0, ptr noundef nonnull align 8 dereferenceable(256) %92)
          to label %103 unwind label %100

103:                                              ; preds = %102
  call void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #7
  ret void

104:                                              ; preds = %100, %88, %47
  %.pn19.pn = phi { ptr, i32 } [ %.pn19, %88 ], [ %48, %47 ], [ %101, %100 ]
  call void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #7
  br label %105

105:                                              ; preds = %104, %45
  %.pn19.pn.pn = phi { ptr, i32 } [ %.pn19.pn, %104 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #7
  resume { ptr, i32 } %.pn19.pn.pn
}

; Function Attrs: nounwind
declare void @_ZN8TraceLogD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEEjET_S7_S7_RKT0_(ptr, ptr, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

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

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

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

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 nounwind uwtable
declare hidden void @"_ZNSt8functionIFvRSoEEC2IZN10MirBuilder15terminate_scopeERK4Span11ScopeHandlebE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10MirBuilder17drop_scope_valuesERKNS_8ScopeDefE(ptr noundef nonnull align 8 dereferenceable(440), ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10MirBuilder14complete_scopeERNS_8ScopeDefE(ptr noundef nonnull align 8 dereferenceable(440), ptr noundef nonnull align 8 dereferenceable(256)) 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 #5 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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 #5 = { 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 = { 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 #7 = { nounwind }
attributes #8 = { noreturn }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"_ZTS11ScopeHandle", !10, i64 0, !12, i64 8}
!15 = !{!16, !10, i64 8}
!16 = !{!"_ZTSZN10MirBuilder15terminate_scopeERK4Span11ScopeHandlebE3$_2", !10, i64 0, !10, i64 8, !10, i64 16}
!17 = !{i8 0, i8 2}
!18 = !{}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass