; LLVM IR from thepowersgang/mrustc :: src/macro_rules/eval.ll (ZN18MacroPatternStream12if_succeededEv)

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

%struct.Span = type { ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.60 = type { ptr }
%class.anon.61 = type { ptr, ptr }
%class.MacroPatternStream = type { ptr, i64, i8, i8, %"class.std::vector.33", ptr, i64, %"class.std::vector", %"class.std::vector", %"class.std::map", i8, ptr }
%"class.std::vector.33" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, std::map<std::vector<unsigned int>, unsigned int>>, std::_Select1st<std::pair<const unsigned int, std::map<std::vector<unsigned int>, unsigned int>>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, std::map<std::vector<unsigned int>, unsigned int>>, std::_Select1st<std::pair<const unsigned int, std::map<std::vector<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 }
%"struct.SimplePatEnt::Data_If" = type { i8, i64, %"class.std::vector.43" }
%"class.std::vector.43" = type { %"struct.std::_Vector_base.44" }
%"struct.std::_Vector_base.44" = type { %"struct.std::_Vector_base<SimplePatIfCheck, std::allocator<SimplePatIfCheck>>::_Vector_impl" }
%"struct.std::_Vector_base<SimplePatIfCheck, std::allocator<SimplePatIfCheck>>::_Vector_impl" = type { %"struct.std::_Vector_base<SimplePatIfCheck, std::allocator<SimplePatIfCheck>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SimplePatIfCheck, std::allocator<SimplePatIfCheck>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.4 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__._ZN18MacroPatternStream12if_succeededEv = external hidden unnamed_addr constant [40 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [16 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

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

; 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 #3

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)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN18MacroPatternStream12if_succeededEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #5 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.Span, align 8
  %5 = alloca %"class.std::function", align 8
  %6 = alloca %class.anon.60, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %struct.Span, align 8
  %11 = alloca %"class.std::function", align 8
  %12 = alloca %class.anon.61, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  %14 = getelementptr inbounds %class.MacroPatternStream, ptr %13, i32 0, i32 1
  %15 = load i64, ptr %14, align 8, !tbaa !9
  %16 = icmp ugt i64 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %1
  br label %20

18:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.4, i32 noundef 414, ptr noundef @__PRETTY_FUNCTION__._ZN18MacroPatternStream12if_succeededEv) #6
  unreachable

19:                                               ; No predecessors!
  br label %20

20:                                               ; preds = %19, %17
  %21 = getelementptr inbounds %class.MacroPatternStream, ptr %13, i32 0, i32 1
  %22 = load i64, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds %class.MacroPatternStream, ptr %13, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8, !tbaa !32
  %25 = call noundef i64 @_ZNKSt6vectorI12SimplePatEntSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #7
  %26 = icmp ule i64 %22, %25
  br i1 %26, label %27, label %28

27:                                               ; preds = %20
  br label %30

28:                                               ; preds = %20
  call void @__assert_fail(ptr noundef @.str.20, ptr noundef @.str.4, i32 noundef 415, ptr noundef @__PRETTY_FUNCTION__._ZN18MacroPatternStream12if_succeededEv) #6
  unreachable

29:                                               ; No predecessors!
  br label %30

30:                                               ; preds = %29, %27
  %31 = getelementptr inbounds %class.MacroPatternStream, ptr %13, i32 0, i32 2
  %32 = load i8, ptr %31, align 8, !tbaa !33, !range !34, !noundef !35
  %33 = trunc i8 %32 to i1
  br i1 %33, label %34, label %35

34:                                               ; preds = %30
  br label %37

35:                                               ; preds = %30
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.4, i32 noundef 416, ptr noundef @__PRETTY_FUNCTION__._ZN18MacroPatternStream12if_succeededEv) #6
  unreachable

36:                                               ; No predecessors!
  br label %37

37:                                               ; preds = %36, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %38 = getelementptr inbounds %class.MacroPatternStream, ptr %13, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !32
  %40 = getelementptr inbounds %class.MacroPatternStream, ptr %13, i32 0, i32 1
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = sub i64 %41, 1
  %43 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI12SimplePatEntSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %42) #7
  store ptr %43, ptr %3, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %37
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = call noundef zeroext i1 @_ZNK12SimplePatEnt5is_IfEv(ptr noundef nonnull align 8 dereferenceable(96) %45)
  br i1 %46, label %61, label %47

47:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  call void @_ZN4SpanC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %48 = getelementptr inbounds %class.anon.60, ptr %6, i32 0, i32 0
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %49, ptr %48, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvRSoEEC2IZN18MacroPatternStream12if_succeededEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef %5)
          to label %50 unwind label %53

50:                                               ; preds = %47
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  %51 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef @.str.8)
          to label %52 unwind label %57

52:                                               ; preds = %50
  call void @__cxa_throw(ptr %51, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
  unreachable

53:                                               ; preds = %47
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %7, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %8, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %98

57:                                               ; preds = %50
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %7, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %8, align 4
  call void @__cxa_free_exception(ptr %51) #7
  br label %98

61:                                               ; preds = %44
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK12SimplePatEnt5as_IfEv(ptr noundef nonnull align 8 dereferenceable(96) %64)
  store ptr %65, ptr %9, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %63
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %"struct.SimplePatEnt::Data_If", ptr %67, i32 0, i32 1
  %69 = load i64, ptr %68, align 8, !tbaa !36
  %70 = getelementptr inbounds %class.MacroPatternStream, ptr %13, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !32
  %72 = call noundef i64 @_ZNKSt6vectorI12SimplePatEntSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #7
  %73 = icmp ult i64 %69, %72
  br i1 %73, label %89, label %74

74:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @_ZN4SpanC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  %75 = getelementptr inbounds %class.anon.61, ptr %12, i32 0, i32 0
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %76, ptr %75, align 8, !tbaa !5
  %77 = getelementptr inbounds %class.anon.61, ptr %12, i32 0, i32 1
  store ptr %13, ptr %77, align 8, !tbaa !42
  call void @"_ZNSt8functionIFvRSoEEC2IZN18MacroPatternStream12if_succeededEvE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef %11)
          to label %78 unwind label %81

78:                                               ; preds = %74
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  %79 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %79, ptr noundef @.str.8)
          to label %80 unwind label %85

80:                                               ; preds = %78
  call void @__cxa_throw(ptr %79, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
  unreachable

81:                                               ; preds = %74
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %7, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %8, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %97

85:                                               ; preds = %78
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %7, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %8, align 4
  call void @__cxa_free_exception(ptr %79) #7
  br label %97

89:                                               ; preds = %66
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.SimplePatEnt::Data_If", ptr %92, i32 0, i32 1
  %94 = load i64, ptr %93, align 8, !tbaa !36
  %95 = getelementptr inbounds %class.MacroPatternStream, ptr %13, i32 0, i32 1
  store i64 %94, ptr %95, align 8, !tbaa !9
  %96 = getelementptr inbounds %class.MacroPatternStream, ptr %13, i32 0, i32 3
  store i8 1, ptr %96, align 1, !tbaa !44
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  ret void

97:                                               ; preds = %85, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %98

98:                                               ; preds = %97, %57, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %99

99:                                               ; preds = %98
  %100 = load ptr, ptr %7, align 8
  %101 = load i32, ptr %8, align 4
  %102 = insertvalue { ptr, i32 } poison, ptr %100, 0
  %103 = insertvalue { ptr, i32 } %102, i32 %101, 1
  resume { ptr, i32 } %103
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "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 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 = { noreturn nounwind }
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, !11, i64 8}
!10 = !{!"_ZTS18MacroPatternStream", !6, i64 0, !11, i64 8, !12, i64 16, !12, i64 17, !13, i64 24, !6, i64 64, !11, i64 72, !20, i64 80, !20, i64 104, !24, i64 128, !12, i64 176, !6, i64 184}
!11 = !{!"long", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTSSt6vectorIbSaIbEE", !14, i64 0}
!14 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !15, i64 0}
!15 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !17, i64 0, !17, i64 16, !6, i64 32}
!17 = !{!"_ZTSSt13_Bit_iterator", !18, i64 0}
!18 = !{!"_ZTSSt18_Bit_iterator_base", !6, i64 0, !19, i64 8}
!19 = !{!"int", !7, i64 0}
!20 = !{!"_ZTSSt6vectorIjSaIjEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!"_ZTSSt3mapIjS_ISt6vectorIjSaIjEEjSt4lessIS2_ESaISt4pairIKS2_jEEES3_IjESaIS5_IKjS9_EEE", !25, i64 0}
!25 = !{!"_ZTSSt8_Rb_treeIjSt4pairIKjSt3mapISt6vectorIjSaIjEEjSt4lessIS5_ESaIS0_IKS5_jEEEESt10_Select1stISC_ES6_IjESaISC_EE", !26, i64 0}
!26 = !{!"_ZTSNSt8_Rb_treeIjSt4pairIKjSt3mapISt6vectorIjSaIjEEjSt4lessIS5_ESaIS0_IKS5_jEEEESt10_Select1stISC_ES6_IjESaISC_EE13_Rb_tree_implISF_Lb1EEE", !27, i64 0, !29, i64 8}
!27 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIjEE", !28, i64 0}
!28 = !{!"_ZTSSt4lessIjE"}
!29 = !{!"_ZTSSt15_Rb_tree_header", !30, i64 0, !11, i64 32}
!30 = !{!"_ZTSSt18_Rb_tree_node_base", !31, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!31 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!32 = !{!10, !6, i64 0}
!33 = !{!10, !12, i64 16}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!37, !11, i64 8}
!37 = !{!"_ZTSN12SimplePatEnt7Data_IfE", !12, i64 0, !11, i64 8, !38, i64 16}
!38 = !{!"_ZTSSt6vectorI16SimplePatIfCheckSaIS0_EE", !39, i64 0}
!39 = !{!"_ZTSSt12_Vector_baseI16SimplePatIfCheckSaIS0_EE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseI16SimplePatIfCheckSaIS0_EE12_Vector_implE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseI16SimplePatIfCheckSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!42 = !{!43, !6, i64 8}
!43 = !{!"_ZTSZN18MacroPatternStream12if_succeededEvE3$_1", !6, i64 0, !6, i64 8}
!44 = !{!10, !12, i64 17}


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

%struct.Span = type { ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.60 = type { ptr }
%class.anon.61 = type { ptr, ptr }

@.str.4 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__._ZN18MacroPatternStream12if_succeededEv = external hidden unnamed_addr constant [40 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [16 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

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

; 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 #3

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN18MacroPatternStream12if_succeededEv(ptr noundef nonnull align 8 dereferenceable(192) %0) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %struct.Span, align 8
  %3 = alloca %"class.std::function", align 8
  %4 = alloca %class.anon.60, align 8
  %5 = alloca %struct.Span, align 8
  %6 = alloca %"class.std::function", align 8
  %7 = alloca %class.anon.61, align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %10, label %11

10:                                               ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.4, i32 noundef 414, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN18MacroPatternStream12if_succeededEv) #6
  unreachable

11:                                               ; preds = %1
  %12 = load ptr, ptr %0, align 8, !tbaa !31
  %13 = tail call noundef i64 @_ZNKSt6vectorI12SimplePatEntSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  %.not11 = icmp ugt i64 %9, %13
  br i1 %.not11, label %14, label %15

14:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.20, ptr noundef nonnull @.str.4, i32 noundef 415, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN18MacroPatternStream12if_succeededEv) #6
  unreachable

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = load i8, ptr %16, align 8, !tbaa !32, !range !33, !noundef !34
  %18 = trunc nuw i8 %17 to i1
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  tail call void @__assert_fail(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.4, i32 noundef 416, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN18MacroPatternStream12if_succeededEv) #6
  unreachable

20:                                               ; preds = %15
  %21 = load ptr, ptr %0, align 8, !tbaa !31
  %22 = load i64, ptr %8, align 8, !tbaa !5
  %23 = add i64 %22, -1
  %24 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNKSt6vectorI12SimplePatEntSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %23) #7
  %25 = tail call noundef zeroext i1 @_ZNK12SimplePatEnt5is_IfEv(ptr noundef nonnull align 8 dereferenceable(96) %24)
  br i1 %25, label %34, label %26

26:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @_ZN4SpanC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store ptr %24, ptr %4, align 8, !tbaa !35
  call void @"_ZNSt8functionIFvRSoEEC2IZN18MacroPatternStream12if_succeededEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull %3)
          to label %27 unwind label %30

27:                                               ; preds = %26
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %28 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull @.str.8)
          to label %29 unwind label %32

29:                                               ; preds = %27
  call void @__cxa_throw(ptr nonnull %28, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #8
  unreachable

30:                                               ; preds = %26
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %53

32:                                               ; preds = %27
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %28) #7
  br label %53

34:                                               ; preds = %20
  %35 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK12SimplePatEnt5as_IfEv(ptr noundef nonnull align 8 dereferenceable(96) %24)
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = load i64, ptr %36, align 8, !tbaa !36
  %38 = load ptr, ptr %0, align 8, !tbaa !31
  %39 = tail call noundef i64 @_ZNKSt6vectorI12SimplePatEntSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %38) #7
  %40 = icmp ult i64 %37, %39
  br i1 %40, label %50, label %41

41:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @_ZN4SpanC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  store ptr %35, ptr %7, align 8, !tbaa !35
  %42 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %0, ptr %42, align 8, !tbaa !42
  call void @"_ZNSt8functionIFvRSoEEC2IZN18MacroPatternStream12if_succeededEvE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  invoke void @_ZNK4Span3bugESt8functionIFvRSoEE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %6)
          to label %43 unwind label %46

43:                                               ; preds = %41
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @_ZN4SpanD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %44 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull @.str.8)
          to label %45 unwind label %48

45:                                               ; preds = %43
  call void @__cxa_throw(ptr nonnull %44, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #8
  unreachable

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

48:                                               ; preds = %43
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %44) #7
  br label %53

50:                                               ; preds = %34
  %51 = load i64, ptr %36, align 8, !tbaa !36
  store i64 %51, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %0, i64 17
  store i8 1, ptr %52, align 1, !tbaa !44
  ret void

53:                                               ; preds = %46, %48, %32, %30
  %.pn.pn = phi { ptr, i32 } [ %33, %32 ], [ %31, %30 ], [ %49, %48 ], [ %47, %46 ]
  resume { ptr, i32 } %.pn.pn
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "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 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 = { noreturn nounwind }
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, !10, i64 8}
!6 = !{!"_ZTS18MacroPatternStream", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 17, !12, i64 24, !7, i64 64, !10, i64 72, !19, i64 80, !19, i64 104, !23, i64 128, !11, i64 176, !7, i64 184}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTSSt6vectorIbSaIbEE", !13, i64 0}
!13 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !14, i64 0}
!14 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !16, i64 0, !16, i64 16, !7, i64 32}
!16 = !{!"_ZTSSt13_Bit_iterator", !17, i64 0}
!17 = !{!"_ZTSSt18_Bit_iterator_base", !7, i64 0, !18, i64 8}
!18 = !{!"int", !8, i64 0}
!19 = !{!"_ZTSSt6vectorIjSaIjEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!23 = !{!"_ZTSSt3mapIjS_ISt6vectorIjSaIjEEjSt4lessIS2_ESaISt4pairIKS2_jEEES3_IjESaIS5_IKjS9_EEE", !24, i64 0}
!24 = !{!"_ZTSSt8_Rb_treeIjSt4pairIKjSt3mapISt6vectorIjSaIjEEjSt4lessIS5_ESaIS0_IKS5_jEEEESt10_Select1stISC_ES6_IjESaISC_EE", !25, i64 0}
!25 = !{!"_ZTSNSt8_Rb_treeIjSt4pairIKjSt3mapISt6vectorIjSaIjEEjSt4lessIS5_ESaIS0_IKS5_jEEEESt10_Select1stISC_ES6_IjESaISC_EE13_Rb_tree_implISF_Lb1EEE", !26, i64 0, !28, i64 8}
!26 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIjEE", !27, i64 0}
!27 = !{!"_ZTSSt4lessIjE"}
!28 = !{!"_ZTSSt15_Rb_tree_header", !29, i64 0, !10, i64 32}
!29 = !{!"_ZTSSt18_Rb_tree_node_base", !30, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!30 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!31 = !{!6, !7, i64 0}
!32 = !{!6, !11, i64 16}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!7, !7, i64 0}
!36 = !{!37, !10, i64 8}
!37 = !{!"_ZTSN12SimplePatEnt7Data_IfE", !11, i64 0, !10, i64 8, !38, i64 16}
!38 = !{!"_ZTSSt6vectorI16SimplePatIfCheckSaIS0_EE", !39, i64 0}
!39 = !{!"_ZTSSt12_Vector_baseI16SimplePatIfCheckSaIS0_EE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseI16SimplePatIfCheckSaIS0_EE12_Vector_implE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseI16SimplePatIfCheckSaIS0_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!42 = !{!43, !7, i64 8}
!43 = !{!"_ZTSZN18MacroPatternStream12if_succeededEvE3$_1", !7, i64 0, !7, i64 8}
!44 = !{!6, !11, i64 17}


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