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

; 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.VarState = type { i32, [4 x i8], %"union.VarState::DataUnion" }
%"union.VarState::DataUnion" = type { i32, [28 x i8] }
%"class.std::map.582" = type { %"class.std::_Rb_tree.583" }
%"class.std::_Rb_tree.583" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, MirBuilder::SavedActiveLocal>, std::_Select1st<std::pair<const unsigned int, MirBuilder::SavedActiveLocal>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, MirBuilder::SavedActiveLocal>, std::_Select1st<std::pair<const unsigned int, MirBuilder::SavedActiveLocal>>, 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 }
%"struct.std::pair.591" = type { i32, [4 x i8], %"class.MirBuilder::SavedActiveLocal" }
%"class.MirBuilder::SavedActiveLocal" = type { %class.VarState }
%"struct.std::pair.587" = type <{ %"struct.std::_Rb_tree_iterator.589", i8, [7 x i8] }>
%"struct.std::_Rb_tree_iterator.589" = type { 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.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" }
%"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 }

@.str.6 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [78 x i8], align 1
@__PRETTY_FUNCTION__._ZNK10MirBuilder17get_active_localsEv = external hidden unnamed_addr constant [91 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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8VarState5cloneEv(ptr dead_on_unwind noalias writable sret(%class.VarState) align 8, ptr noundef nonnull align 8 dereferenceable(40)) #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10MirBuilder17get_active_localsEv(ptr dead_on_unwind noalias writable sret(%"class.std::map.582") align 8 %0, ptr noundef nonnull align 8 dereferenceable(440) %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair.591", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.MirBuilder::SavedActiveLocal", align 8
  %15 = alloca %class.VarState, align 8
  %16 = alloca %"struct.std::pair.587", align 8
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %4, align 8
  store i1 false, ptr %5, align 1
  call void @_ZNSt3mapIjN10MirBuilder16SavedActiveLocalESt4lessIjESaISt4pairIKjS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %22

22:                                               ; preds = %136, %2
  %23 = load i64, ptr %6, align 8, !tbaa !9
  %24 = getelementptr inbounds %class.MirBuilder, ptr %21, i32 0, i32 13
  %25 = call noundef i64 @_ZNKSt6vectorI8VarStateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  %26 = icmp ult i64 %23, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %22
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %139

28:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  store i8 1, ptr %8, align 1, !tbaa !11
  br label %29

29:                                               ; preds = %134, %28
  %30 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %31 = trunc i8 %30 to i1
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  br label %135

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %34 = getelementptr inbounds %class.MirBuilder, ptr %21, i32 0, i32 13
  %35 = load i64, ptr %6, align 8, !tbaa !9
  %36 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNKSt6vectorI8VarStateSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %35) #5
  store ptr %36, ptr %9, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %131, %33
  %38 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %39 = trunc i8 %38 to i1
  br i1 %39, label %41, label %40

40:                                               ; preds = %37
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %133

41:                                               ; preds = %37
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = invoke noundef i32 @_ZNK8VarState3tagEv(ptr noundef nonnull align 8 dereferenceable(40) %42)
          to label %44 unwind label %45

44:                                               ; preds = %41
  switch i32 %43, label %50 [
    i32 0, label %49
    i32 1, label %84
    i32 3, label %107
  ]

45:                                               ; preds = %41
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %10, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %11, align 4
  br label %132

49:                                               ; preds = %44
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.7, i32 noundef 2304, ptr noundef @__PRETTY_FUNCTION__._ZNK10MirBuilder17get_active_localsEv) #6
  unreachable

50:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %51 = load i64, ptr %6, align 8, !tbaa !9
  %52 = trunc i64 %51 to i32
  store i32 %52, ptr %13, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #5
  %53 = getelementptr inbounds %class.MirBuilder, ptr %21, i32 0, i32 13
  %54 = load i64, ptr %6, align 8, !tbaa !9
  %55 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNKSt6vectorI8VarStateSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %54) #5
  invoke void @_ZNK8VarState5cloneEv(ptr dead_on_unwind writable sret(%class.VarState) align 8 %15, ptr noundef nonnull align 8 dereferenceable(40) %55)
          to label %56 unwind label %65

56:                                               ; preds = %50
  invoke void @_ZN10MirBuilder16SavedActiveLocalC2E8VarState(ptr noundef nonnull align 8 dereferenceable(40) %14, ptr noundef %15)
          to label %57 unwind label %69

57:                                               ; preds = %56
  invoke void @_ZSt9make_pairIjN10MirBuilder16SavedActiveLocalEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind writable sret(%"struct.std::pair.591") align 8 %12, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 8 dereferenceable(40) %14)
          to label %58 unwind label %73

58:                                               ; preds = %57
  %59 = invoke { ptr, i8 } @_ZNSt3mapIjN10MirBuilder16SavedActiveLocalESt4lessIjESaISt4pairIKjS1_EEE6insertIS4_IjS1_EEENSt9enable_ifIXsr16is_constructibleIS6_T_EE5valueES4_ISt17_Rb_tree_iteratorIS6_EbEE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %12)
          to label %60 unwind label %77

60:                                               ; preds = %58
  %61 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 0
  %62 = extractvalue { ptr, i8 } %59, 0
  store ptr %62, ptr %61, align 8
  %63 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 1
  %64 = extractvalue { ptr, i8 } %59, 1
  store i8 %64, ptr %63, align 8
  call void @_ZNSt4pairIjN10MirBuilder16SavedActiveLocalEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @_ZN10MirBuilder16SavedActiveLocalD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %14) #5
  call void @_ZN8VarStateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #5
  br label %130

65:                                               ; preds = %50
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %10, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %11, align 4
  br label %83

69:                                               ; preds = %56
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %10, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %11, align 4
  br label %82

73:                                               ; preds = %57
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %10, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %11, align 4
  br label %81

77:                                               ; preds = %58
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %10, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %11, align 4
  call void @_ZNSt4pairIjN10MirBuilder16SavedActiveLocalEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  br label %81

81:                                               ; preds = %77, %73
  call void @_ZN10MirBuilder16SavedActiveLocalD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %14) #5
  br label %82

82:                                               ; preds = %81, %69
  call void @_ZN8VarStateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #5
  br label %83

83:                                               ; preds = %82, %65
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #5
  br label %132

84:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  store i8 1, ptr %17, align 1, !tbaa !11
  br label %85

85:                                               ; preds = %105, %84
  %86 = load i8, ptr %17, align 1, !tbaa !11, !range !13, !noundef !14
  %87 = trunc i8 %86 to i1
  br i1 %87, label %89, label %88

88:                                               ; preds = %85
  store i32 12, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  br label %106

89:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8VarState10as_InvalidEv(ptr noundef nonnull align 8 dereferenceable(40) %90)
          to label %92 unwind label %98

92:                                               ; preds = %89
  store ptr %91, ptr %18, align 8, !tbaa !5
  br label %93

93:                                               ; preds = %103, %92
  %94 = load ptr, ptr %18, align 8, !tbaa !5
  %95 = load i8, ptr %17, align 1, !tbaa !11, !range !13, !noundef !14
  %96 = trunc i8 %95 to i1
  br i1 %96, label %102, label %97

97:                                               ; preds = %93
  store i32 15, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %104

98:                                               ; preds = %89
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %10, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  br label %132

102:                                              ; preds = %93
  br label %103

103:                                              ; preds = %102
  store i8 0, ptr %17, align 1, !tbaa !11
  br label %93, !llvm.loop !17

104:                                              ; preds = %97
  br label %105

105:                                              ; preds = %104
  store i8 0, ptr %17, align 1, !tbaa !11
  br label %85, !llvm.loop !19

106:                                              ; preds = %88
  br label %130

107:                                              ; preds = %44
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #5
  store i8 1, ptr %19, align 1, !tbaa !11
  br label %108

108:                                              ; preds = %128, %107
  %109 = load i8, ptr %19, align 1, !tbaa !11, !range !13, !noundef !14
  %110 = trunc i8 %109 to i1
  br i1 %110, label %112, label %111

111:                                              ; preds = %108
  store i32 18, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  br label %129

112:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZNK8VarState11as_MovedOutEv(ptr noundef nonnull align 8 dereferenceable(40) %113)
          to label %115 unwind label %121

115:                                              ; preds = %112
  store ptr %114, ptr %20, align 8, !tbaa !5
  br label %116

116:                                              ; preds = %126, %115
  %117 = load ptr, ptr %20, align 8, !tbaa !5
  %118 = load i8, ptr %19, align 1, !tbaa !11, !range !13, !noundef !14
  %119 = trunc i8 %118 to i1
  br i1 %119, label %125, label %120

120:                                              ; preds = %116
  store i32 21, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %127

121:                                              ; preds = %112
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %10, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  br label %132

125:                                              ; preds = %116
  br label %126

126:                                              ; preds = %125
  store i8 0, ptr %19, align 1, !tbaa !11
  br label %116, !llvm.loop !20

127:                                              ; preds = %120
  br label %128

128:                                              ; preds = %127
  store i8 0, ptr %19, align 1, !tbaa !11
  br label %108, !llvm.loop !21

129:                                              ; preds = %111
  br label %130

130:                                              ; preds = %129, %106, %60
  br label %131

131:                                              ; preds = %130
  store i8 0, ptr %8, align 1, !tbaa !11
  br label %37, !llvm.loop !22

132:                                              ; preds = %121, %98, %83, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @_ZNSt3mapIjN10MirBuilder16SavedActiveLocalESt4lessIjESaISt4pairIKjS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  br label %143

133:                                              ; preds = %40
  br label %134

134:                                              ; preds = %133
  store i8 0, ptr %8, align 1, !tbaa !11
  br label %29, !llvm.loop !23

135:                                              ; preds = %32
  br label %136

136:                                              ; preds = %135
  %137 = load i64, ptr %6, align 8, !tbaa !9
  %138 = add i64 %137, 1
  store i64 %138, ptr %6, align 8, !tbaa !9
  br label %22, !llvm.loop !24

139:                                              ; preds = %27
  store i1 true, ptr %5, align 1
  store i32 1, ptr %7, align 4
  %140 = load i1, ptr %5, align 1
  br i1 %140, label %142, label %141

141:                                              ; preds = %139
  call void @_ZNSt3mapIjN10MirBuilder16SavedActiveLocalESt4lessIjESaISt4pairIKjS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  br label %142

142:                                              ; preds = %141, %139
  ret void

143:                                              ; preds = %132
  %144 = load ptr, ptr %10, align 8
  %145 = load i32, ptr %11, align 4
  %146 = insertvalue { ptr, i32 } poison, ptr %144, 0
  %147 = insertvalue { ptr, i32 } %146, i32 %145, 1
  resume { ptr, i32 } %147
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3mapIjN10MirBuilder16SavedActiveLocalESt4lessIjESaISt4pairIKjS1_EEE6insertIS4_IjS1_EEENSt9enable_ifIXsr16is_constructibleIS6_T_EE5valueES4_ISt17_Rb_tree_iteratorIS6_EbEE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIjN10MirBuilder16SavedActiveLocalEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.591") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(40)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10MirBuilder16SavedActiveLocalC2E8VarState(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) unnamed_addr #1 align 2

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
!23 = distinct !{!23, !18}
!24 = distinct !{!24, !18}


; 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.VarState = type { i32, [4 x i8], %"union.VarState::DataUnion" }
%"union.VarState::DataUnion" = type { i32, [28 x i8] }
%"class.std::map.582" = type { %"class.std::_Rb_tree.583" }
%"class.std::_Rb_tree.583" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, MirBuilder::SavedActiveLocal>, std::_Select1st<std::pair<const unsigned int, MirBuilder::SavedActiveLocal>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, MirBuilder::SavedActiveLocal>, std::_Select1st<std::pair<const unsigned int, MirBuilder::SavedActiveLocal>>, 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 }
%"struct.std::pair.591" = type { i32, [4 x i8], %"class.MirBuilder::SavedActiveLocal" }
%"class.MirBuilder::SavedActiveLocal" = type { %class.VarState }

@.str.6 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [78 x i8], align 1
@__PRETTY_FUNCTION__._ZNK10MirBuilder17get_active_localsEv = external hidden unnamed_addr constant [91 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8VarStateD2Ev(ptr noundef nonnull align 8 dereferenceable(40)) 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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI8VarStateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8VarState5cloneEv(ptr dead_on_unwind noalias writable sret(%class.VarState) align 8, ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10MirBuilder17get_active_localsEv(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::map.582") align 8 %0, ptr noundef nonnull align 8 dereferenceable(440) %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
.split118:
  %2 = alloca %"struct.std::pair.591", align 8
  %3 = alloca i32, align 4
  %4 = alloca %"class.MirBuilder::SavedActiveLocal", align 8
  %5 = alloca %class.VarState, align 8
  tail call void @_ZNSt3mapIjN10MirBuilder16SavedActiveLocalESt4lessIjESaISt4pairIKjS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  %6 = getelementptr inbounds i8, ptr %1, i64 240
  %7 = tail call noundef i64 @_ZNKSt6vectorI8VarStateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %.not = icmp eq i64 %7, 0
  br i1 %.not, label %._crit_edge, label %.preheader35

.preheader35:                                     ; preds = %.split118, %..loopexit34_crit_edge
  %.019119 = phi i64 [ %24, %..loopexit34_crit_edge ], [ 0, %.split118 ]
  %8 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNKSt6vectorI8VarStateSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.019119) #5
  %9 = call noundef i32 @_ZNK8VarState3tagEv(ptr noundef nonnull align 8 dereferenceable(40) %8)
  switch i32 %9, label %12 [
    i32 0, label %.split53
    i32 1, label %.preheader
    i32 3, label %.preheader32
  ]

.preheader32:                                     ; preds = %.preheader35
  %10 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK8VarState11as_MovedOutEv(ptr noundef nonnull align 8 dereferenceable(40) %8)
  br label %..loopexit34_crit_edge

.preheader:                                       ; preds = %.preheader35
  %11 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8VarState10as_InvalidEv(ptr noundef nonnull align 8 dereferenceable(40) %8)
  br label %..loopexit34_crit_edge

.split53:                                         ; preds = %.preheader35
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7, i32 noundef 2304, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK10MirBuilder17get_active_localsEv) #6
  unreachable

12:                                               ; preds = %.preheader35
  %13 = trunc i64 %.019119 to i32
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 %13, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #5
  %14 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNKSt6vectorI8VarStateSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.019119) #5
  invoke void @_ZNK8VarState5cloneEv(ptr dead_on_unwind nonnull writable sret(%class.VarState) align 8 %5, ptr noundef nonnull align 8 dereferenceable(40) %14)
          to label %15 unwind label %.split55.split

15:                                               ; preds = %12
  call void @_ZN10MirBuilder16SavedActiveLocalC2E8VarState(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull %5)
  invoke void @_ZSt9make_pairIjN10MirBuilder16SavedActiveLocalEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.591") align 8 %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 8 dereferenceable(40) %4)
          to label %16 unwind label %.split57.split

16:                                               ; preds = %15
  %17 = invoke { ptr, i8 } @_ZNSt3mapIjN10MirBuilder16SavedActiveLocalESt4lessIjESaISt4pairIKjS1_EEE6insertIS4_IjS1_EEENSt9enable_ifIXsr16is_constructibleIS6_T_EE5valueES4_ISt17_Rb_tree_iteratorIS6_EbEE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %2)
          to label %18 unwind label %.split60.split

18:                                               ; preds = %16
  call void @_ZNSt4pairIjN10MirBuilder16SavedActiveLocalEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  call void @_ZN10MirBuilder16SavedActiveLocalD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #5
  call void @_ZN8VarStateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #5
  br label %..loopexit34_crit_edge

.split55.split:                                   ; preds = %12
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %23

.split57.split:                                   ; preds = %15
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %22

.split60.split:                                   ; preds = %16
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt4pairIjN10MirBuilder16SavedActiveLocalEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  br label %22

22:                                               ; preds = %.split60.split, %.split57.split
  %.pn = phi { ptr, i32 } [ %21, %.split60.split ], [ %20, %.split57.split ]
  call void @_ZN10MirBuilder16SavedActiveLocalD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #5
  call void @_ZN8VarStateD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #5
  br label %23

23:                                               ; preds = %22, %.split55.split
  %.pn.pn = phi { ptr, i32 } [ %.pn, %22 ], [ %19, %.split55.split ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #5
  call void @_ZNSt3mapIjN10MirBuilder16SavedActiveLocalESt4lessIjESaISt4pairIKjS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  resume { ptr, i32 } %.pn.pn

..loopexit34_crit_edge:                           ; preds = %.preheader32, %.preheader, %18
  %24 = add nuw i64 %.019119, 1
  %25 = call noundef i64 @_ZNKSt6vectorI8VarStateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %26 = icmp ult i64 %24, %25
  br i1 %26, label %.preheader35, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %..loopexit34_crit_edge, %.split118
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3mapIjN10MirBuilder16SavedActiveLocalESt4lessIjESaISt4pairIKjS1_EEE6insertIS4_IjS1_EEENSt9enable_ifIXsr16is_constructibleIS6_T_EE5valueES4_ISt17_Rb_tree_iteratorIS6_EbEE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIjN10MirBuilder16SavedActiveLocalEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.591") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10MirBuilder16SavedActiveLocalC2E8VarState(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) unnamed_addr #1 align 2

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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