; LLVM IR from ShahjalalShohag/code-library :: Geometry/All Pair Segment Intersection.ll (Z16any_intersectionRKSt6vectorI3segSaIS0_EE)

; 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.std::pair" = type { i32, i32 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<event, std::allocator<event>>::_Vector_impl" }
%"struct.std::_Vector_base<event, std::allocator<event>>::_Vector_impl" = type { %"struct.std::_Vector_base<event, std::allocator<event>>::_Vector_impl_data" }
%"struct.std::_Vector_base<event, std::allocator<event>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.event = type <{ x86_fp80, i32, i32, [8 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<seg, seg, std::_Identity<seg>, std::less<seg>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<seg, seg, std::_Identity<seg>, std::less<seg>>::_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.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<std::_Rb_tree_const_iterator<seg>, std::allocator<std::_Rb_tree_const_iterator<seg>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::_Rb_tree_const_iterator<seg>, std::allocator<std::_Rb_tree_const_iterator<seg>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::_Rb_tree_const_iterator<seg>, std::allocator<std::_Rb_tree_const_iterator<seg>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::_Rb_tree_const_iterator<seg>, std::allocator<std::_Rb_tree_const_iterator<seg>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%struct.seg = type <{ %struct.PT, %struct.PT, i32, [12 x i8] }>
%struct.PT = type { x86_fp80, x86_fp80 }

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZSt3maxIeERKT_S2_S2_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZSt3minIeERKT_S2_S2_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z9intersectRK3segS1_(ptr noundef nonnull align 16 dereferenceable(68), ptr noundef nonnull align 16 dereferenceable(68)) #2

; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z16any_intersectionRKSt6vectorI3segSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24) %0) #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.std::pair", align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector.0", align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.event, align 16
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %struct.event, align 16
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.std::set", align 8
  %14 = alloca %"class.std::vector.8", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %24 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %25 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %26 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %27 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %28 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %29 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %30 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %31 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %32 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %33 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %34 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %35 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %36 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = call noundef i64 @_ZNKSt6vectorI3segSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #7
  %43 = trunc i64 %42 to i32
  store i32 %43, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #7
  call void @_ZNSt6vectorI5eventSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %86, %1
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = load i32, ptr %4, align 4, !tbaa !9
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %98

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #7
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = load i32, ptr %6, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %52) #7
  %54 = getelementptr inbounds %struct.seg, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds %struct.PT, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %58) #7
  %60 = getelementptr inbounds %struct.seg, ptr %59, i32 0, i32 1
  %61 = getelementptr inbounds %struct.PT, ptr %60, i32 0, i32 0
  %62 = invoke noundef nonnull align 16 dereferenceable(16) ptr @_ZSt3minIeERKT_S2_S2_(ptr noundef nonnull align 16 dereferenceable(16) %55, ptr noundef nonnull align 16 dereferenceable(16) %61)
          to label %63 unwind label %89

63:                                               ; preds = %49
  %64 = load x86_fp80, ptr %62, align 16, !tbaa !11
  %65 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @_ZN5eventC2Eeii(ptr noundef nonnull align 16 dereferenceable(24) %7, x86_fp80 noundef %64, i32 noundef 1, i32 noundef %65)
          to label %66 unwind label %89

66:                                               ; preds = %63
  invoke void @_ZNSt6vectorI5eventSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 16 dereferenceable(24) %7)
          to label %67 unwind label %89

67:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #7
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = load i32, ptr %6, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %70) #7
  %72 = getelementptr inbounds %struct.seg, ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds %struct.PT, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = load i32, ptr %6, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %74, i64 noundef %76) #7
  %78 = getelementptr inbounds %struct.seg, ptr %77, i32 0, i32 1
  %79 = getelementptr inbounds %struct.PT, ptr %78, i32 0, i32 0
  %80 = invoke noundef nonnull align 16 dereferenceable(16) ptr @_ZSt3maxIeERKT_S2_S2_(ptr noundef nonnull align 16 dereferenceable(16) %73, ptr noundef nonnull align 16 dereferenceable(16) %79)
          to label %81 unwind label %93

81:                                               ; preds = %67
  %82 = load x86_fp80, ptr %80, align 16, !tbaa !11
  %83 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @_ZN5eventC2Eeii(ptr noundef nonnull align 16 dereferenceable(24) %10, x86_fp80 noundef %82, i32 noundef -1, i32 noundef %83)
          to label %84 unwind label %93

84:                                               ; preds = %81
  invoke void @_ZNSt6vectorI5eventSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 16 dereferenceable(24) %10)
          to label %85 unwind label %93

85:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #7
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %6, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %6, align 4, !tbaa !9
  br label %44, !llvm.loop !13

89:                                               ; preds = %66, %63, %49
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %8, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  br label %97

93:                                               ; preds = %84, %81, %67
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %8, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #7
  br label %97

97:                                               ; preds = %93, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %346

98:                                               ; preds = %48
  %99 = call ptr @_ZNSt6vectorI5eventSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %100 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %99, ptr %100, align 8
  %101 = call ptr @_ZNSt6vectorI5eventSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %102 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %101, ptr %102, align 8
  %103 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8
  %105 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP5eventSt6vectorIS2_SaIS2_EEEEEvT_S8_(ptr %104, ptr %106)
          to label %107 unwind label %119

107:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 48, ptr %13) #7
  call void @_ZNSt3setI3segSt4lessIS0_ESaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #7
  call void @_ZNSt6vectorISt23_Rb_tree_const_iteratorI3segESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  %108 = load ptr, ptr %3, align 8, !tbaa !5
  %109 = call noundef i64 @_ZNKSt6vectorI3segSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %108) #7
  %110 = trunc i64 %109 to i32
  %111 = sext i32 %110 to i64
  invoke void @_ZNSt6vectorISt23_Rb_tree_const_iteratorI3segESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %111)
          to label %112 unwind label %123

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %319, %112
  %114 = load i32, ptr %15, align 4, !tbaa !9
  %115 = call noundef i64 @_ZNKSt6vectorI5eventSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %116 = trunc i64 %115 to i32
  %117 = icmp slt i32 %114, %116
  br i1 %117, label %127, label %118

118:                                              ; preds = %113
  store i32 5, ptr %16, align 4
  br label %327

119:                                              ; preds = %98
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %8, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %9, align 4
  br label %346

123:                                              ; preds = %326, %107
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %8, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %9, align 4
  br label %345

127:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %128 = load i32, ptr %15, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = call noundef nonnull align 16 dereferenceable(24) ptr @_ZNSt6vectorI5eventSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %129) #7
  %131 = getelementptr inbounds %struct.event, ptr %130, i32 0, i32 2
  %132 = load i32, ptr %131, align 4, !tbaa !15
  store i32 %132, ptr %17, align 4, !tbaa !9
  %133 = load i32, ptr %15, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = call noundef nonnull align 16 dereferenceable(24) ptr @_ZNSt6vectorI5eventSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %134) #7
  %136 = getelementptr inbounds %struct.event, ptr %135, i32 0, i32 1
  %137 = load i32, ptr %136, align 16, !tbaa !17
  %138 = icmp eq i32 %137, 1
  br i1 %138, label %139, label %239

139:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = load i32, ptr %17, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %140, i64 noundef %142) #7
  %144 = invoke ptr @_ZNSt3setI3segSt4lessIS0_ESaIS0_EE11lower_boundERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 16 dereferenceable(68) %143)
          to label %145 unwind label %178

145:                                              ; preds = %139
  %146 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  store ptr %144, ptr %146, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %147 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %148 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %147, ptr %148, align 8
  %149 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br i1 %149, label %150, label %153

150:                                              ; preds = %145
  %151 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %152 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %151, ptr %152, align 8
  br label %159

153:                                              ; preds = %145
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %18, i64 8, i1 false), !tbaa.struct !18
  %154 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8
  %156 = invoke ptr @_ZSt4prevISt23_Rb_tree_const_iteratorI3segEET_S3_NSt15iterator_traitsIS3_E15difference_typeE(ptr %155, i64 noundef 1)
          to label %157 unwind label %182

157:                                              ; preds = %153
  %158 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %156, ptr %158, align 8
  br label %159

159:                                              ; preds = %157, %150
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %160 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %161 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %160, ptr %161, align 8
  %162 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  br i1 %162, label %163, label %171

163:                                              ; preds = %159
  %164 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = load i32, ptr %17, align 4, !tbaa !9
  %167 = sext i32 %166 to i64
  %168 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %165, i64 noundef %167) #7
  %169 = invoke noundef zeroext i1 @_Z9intersectRK3segS1_(ptr noundef nonnull align 16 dereferenceable(68) %164, ptr noundef nonnull align 16 dereferenceable(68) %168)
          to label %170 unwind label %186

170:                                              ; preds = %163
  br label %171

171:                                              ; preds = %170, %159
  %172 = phi i1 [ false, %159 ], [ %169, %170 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br i1 %172, label %173, label %194

173:                                              ; preds = %171
  %174 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %175 = getelementptr inbounds %struct.seg, ptr %174, i32 0, i32 2
  %176 = invoke i64 @_ZSt9make_pairIRKiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4) %175, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %177 unwind label %190

177:                                              ; preds = %173
  store i64 %176, ptr %2, align 4
  store i32 1, ptr %16, align 4
  br label %230

178:                                              ; preds = %139
  %179 = landingpad { ptr, i32 }
          catch ptr null
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %8, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %9, align 4
  br label %238

182:                                              ; preds = %153
  %183 = landingpad { ptr, i32 }
          catch ptr null
  %184 = extractvalue { ptr, i32 } %183, 0
  store ptr %184, ptr %8, align 8
  %185 = extractvalue { ptr, i32 } %183, 1
  store i32 %185, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %237

186:                                              ; preds = %163
  %187 = landingpad { ptr, i32 }
          catch ptr null
  %188 = extractvalue { ptr, i32 } %187, 0
  store ptr %188, ptr %8, align 8
  %189 = extractvalue { ptr, i32 } %187, 1
  store i32 %189, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %237

190:                                              ; preds = %208, %173
  %191 = landingpad { ptr, i32 }
          catch ptr null
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %8, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %9, align 4
  br label %237

194:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %195 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %196 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %23, i32 0, i32 0
  store ptr %195, ptr %196, align 8
  %197 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %23) #7
  br i1 %197, label %198, label %206

198:                                              ; preds = %194
  %199 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  %200 = load ptr, ptr %3, align 8, !tbaa !5
  %201 = load i32, ptr %17, align 4, !tbaa !9
  %202 = sext i32 %201 to i64
  %203 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %200, i64 noundef %202) #7
  %204 = invoke noundef zeroext i1 @_Z9intersectRK3segS1_(ptr noundef nonnull align 16 dereferenceable(68) %199, ptr noundef nonnull align 16 dereferenceable(68) %203)
          to label %205 unwind label %213

205:                                              ; preds = %198
  br label %206

206:                                              ; preds = %205, %194
  %207 = phi i1 [ false, %194 ], [ %204, %205 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br i1 %207, label %208, label %217

208:                                              ; preds = %206
  %209 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  %210 = getelementptr inbounds %struct.seg, ptr %209, i32 0, i32 2
  %211 = invoke i64 @_ZSt9make_pairIRKiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4) %210, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %212 unwind label %190

212:                                              ; preds = %208
  store i64 %211, ptr %2, align 4
  store i32 1, ptr %16, align 4
  br label %230

213:                                              ; preds = %198
  %214 = landingpad { ptr, i32 }
          catch ptr null
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %8, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %237

217:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %18, i64 8, i1 false), !tbaa.struct !18
  %218 = load ptr, ptr %3, align 8, !tbaa !5
  %219 = load i32, ptr %17, align 4, !tbaa !9
  %220 = sext i32 %219 to i64
  %221 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %218, i64 noundef %220) #7
  %222 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %25, i32 0, i32 0
  %223 = load ptr, ptr %222, align 8
  %224 = invoke ptr @_ZNSt3setI3segSt4lessIS0_ESaIS0_EE6insertESt23_Rb_tree_const_iteratorIS0_ERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr %223, ptr noundef nonnull align 16 dereferenceable(68) %221)
          to label %225 unwind label %233

225:                                              ; preds = %217
  %226 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %24, i32 0, i32 0
  store ptr %224, ptr %226, align 8
  %227 = load i32, ptr %17, align 4, !tbaa !9
  %228 = sext i32 %227 to i64
  %229 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorISt23_Rb_tree_const_iteratorI3segESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %228) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %229, ptr align 8 %24, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  store i32 0, ptr %16, align 4
  br label %230

230:                                              ; preds = %225, %212, %177
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %231 = load i32, ptr %16, align 4
  switch i32 %231, label %316 [
    i32 0, label %232
  ]

232:                                              ; preds = %230
  br label %315

233:                                              ; preds = %217
  %234 = landingpad { ptr, i32 }
          catch ptr null
  %235 = extractvalue { ptr, i32 } %234, 0
  store ptr %235, ptr %8, align 8
  %236 = extractvalue { ptr, i32 } %234, 1
  store i32 %236, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %237

237:                                              ; preds = %233, %213, %190, %186, %182
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %238

238:                                              ; preds = %237, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %322

239:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %240 = load i32, ptr %17, align 4, !tbaa !9
  %241 = sext i32 %240 to i64
  %242 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorISt23_Rb_tree_const_iteratorI3segESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %241) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %242, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %243 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %244 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %27, i32 0, i32 0
  store ptr %243, ptr %244, align 8
  %245 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br i1 %245, label %246, label %247

246:                                              ; preds = %239
  store i32 7, ptr %16, align 4
  br label %310

247:                                              ; preds = %239
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %26, i64 8, i1 false), !tbaa.struct !18
  %248 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %29, i32 0, i32 0
  %249 = load ptr, ptr %248, align 8
  %250 = invoke ptr @_ZSt4nextISt23_Rb_tree_const_iteratorI3segEET_S3_NSt15iterator_traitsIS3_E15difference_typeE(ptr %249, i64 noundef 1)
          to label %251 unwind label %287

251:                                              ; preds = %247
  %252 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %28, i32 0, i32 0
  store ptr %250, ptr %252, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %253 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %254 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %31, i32 0, i32 0
  store ptr %253, ptr %254, align 8
  %255 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %31) #7
  br i1 %255, label %256, label %259

256:                                              ; preds = %251
  %257 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %258 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %30, i32 0, i32 0
  store ptr %257, ptr %258, align 8
  br label %265

259:                                              ; preds = %251
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %32, ptr align 8 %26, i64 8, i1 false), !tbaa.struct !18
  %260 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %32, i32 0, i32 0
  %261 = load ptr, ptr %260, align 8
  %262 = invoke ptr @_ZSt4prevISt23_Rb_tree_const_iteratorI3segEET_S3_NSt15iterator_traitsIS3_E15difference_typeE(ptr %261, i64 noundef 1)
          to label %263 unwind label %291

263:                                              ; preds = %259
  %264 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %30, i32 0, i32 0
  store ptr %262, ptr %264, align 8
  br label %265

265:                                              ; preds = %263, %256
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %266 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %267 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %33, i32 0, i32 0
  store ptr %266, ptr %267, align 8
  %268 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %33) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  br i1 %268, label %269, label %278

269:                                              ; preds = %265
  %270 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  %271 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %34, i32 0, i32 0
  store ptr %270, ptr %271, align 8
  %272 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %34) #7
  br i1 %272, label %273, label %278

273:                                              ; preds = %269
  %274 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #7
  %275 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #7
  %276 = invoke noundef zeroext i1 @_Z9intersectRK3segS1_(ptr noundef nonnull align 16 dereferenceable(68) %274, ptr noundef nonnull align 16 dereferenceable(68) %275)
          to label %277 unwind label %295

277:                                              ; preds = %273
  br label %278

278:                                              ; preds = %277, %269, %265
  %279 = phi i1 [ false, %269 ], [ false, %265 ], [ %276, %277 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  br i1 %279, label %280, label %303

280:                                              ; preds = %278
  %281 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEptEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #7
  %282 = getelementptr inbounds %struct.seg, ptr %281, i32 0, i32 2
  %283 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEptEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #7
  %284 = getelementptr inbounds %struct.seg, ptr %283, i32 0, i32 2
  %285 = invoke i64 @_ZSt9make_pairIRKiS1_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %282, ptr noundef nonnull align 4 dereferenceable(4) %284)
          to label %286 unwind label %299

286:                                              ; preds = %280
  store i64 %285, ptr %2, align 4
  store i32 1, ptr %16, align 4
  br label %309

287:                                              ; preds = %247
  %288 = landingpad { ptr, i32 }
          catch ptr null
  %289 = extractvalue { ptr, i32 } %288, 0
  store ptr %289, ptr %8, align 8
  %290 = extractvalue { ptr, i32 } %288, 1
  store i32 %290, ptr %9, align 4
  br label %314

291:                                              ; preds = %259
  %292 = landingpad { ptr, i32 }
          catch ptr null
  %293 = extractvalue { ptr, i32 } %292, 0
  store ptr %293, ptr %8, align 8
  %294 = extractvalue { ptr, i32 } %292, 1
  store i32 %294, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  br label %313

295:                                              ; preds = %273
  %296 = landingpad { ptr, i32 }
          catch ptr null
  %297 = extractvalue { ptr, i32 } %296, 0
  store ptr %297, ptr %8, align 8
  %298 = extractvalue { ptr, i32 } %296, 1
  store i32 %298, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  br label %313

299:                                              ; preds = %303, %280
  %300 = landingpad { ptr, i32 }
          catch ptr null
  %301 = extractvalue { ptr, i32 } %300, 0
  store ptr %301, ptr %8, align 8
  %302 = extractvalue { ptr, i32 } %300, 1
  store i32 %302, ptr %9, align 4
  br label %313

303:                                              ; preds = %278
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %35, ptr align 8 %26, i64 8, i1 false), !tbaa.struct !18
  %304 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %35, i32 0, i32 0
  %305 = load ptr, ptr %304, align 8
  %306 = invoke ptr @_ZNSt3setI3segSt4lessIS0_ESaIS0_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS0_E(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr %305)
          to label %307 unwind label %299

307:                                              ; preds = %303
  %308 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %36, i32 0, i32 0
  store ptr %306, ptr %308, align 8
  store i32 0, ptr %16, align 4
  br label %309

309:                                              ; preds = %307, %286
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %310

310:                                              ; preds = %309, %246
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  %311 = load i32, ptr %16, align 4
  switch i32 %311, label %316 [
    i32 0, label %312
  ]

312:                                              ; preds = %310
  br label %315

313:                                              ; preds = %299, %295, %291
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %314

314:                                              ; preds = %313, %287
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %322

315:                                              ; preds = %312, %232
  store i32 0, ptr %16, align 4
  br label %316

316:                                              ; preds = %315, %310, %230
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  %317 = load i32, ptr %16, align 4
  switch i32 %317, label %327 [
    i32 0, label %318
    i32 7, label %319
  ]

318:                                              ; preds = %316
  br label %319

319:                                              ; preds = %318, %316
  %320 = load i32, ptr %15, align 4, !tbaa !9
  %321 = add nsw i32 %320, 1
  store i32 %321, ptr %15, align 4, !tbaa !9
  br label %113, !llvm.loop !19

322:                                              ; preds = %314, %238
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %323

323:                                              ; preds = %322
  %324 = load ptr, ptr %8, align 8
  %325 = call ptr @__cxa_begin_catch(ptr %324) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  store i32 0, ptr %37, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #7
  store i32 1, ptr %38, align 4, !tbaa !9
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(4) %37, ptr noundef nonnull align 4 dereferenceable(4) %38)
          to label %326 unwind label %330

326:                                              ; preds = %323
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  store i32 1, ptr %16, align 4
  invoke void @__cxa_end_catch()
          to label %334 unwind label %123

327:                                              ; preds = %316, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  %328 = load i32, ptr %16, align 4
  switch i32 %328, label %343 [
    i32 5, label %329
  ]

329:                                              ; preds = %327
  br label %336

330:                                              ; preds = %323
  %331 = landingpad { ptr, i32 }
          cleanup
  %332 = extractvalue { ptr, i32 } %331, 0
  store ptr %332, ptr %8, align 8
  %333 = extractvalue { ptr, i32 } %331, 1
  store i32 %333, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  invoke void @__cxa_end_catch()
          to label %335 unwind label %352

334:                                              ; preds = %326
  br label %343

335:                                              ; preds = %330
  br label %345

336:                                              ; preds = %329
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #7
  store i32 -1, ptr %39, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #7
  store i32 -1, ptr %40, align 4, !tbaa !9
  %337 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %39, ptr noundef nonnull align 4 dereferenceable(4) %40)
          to label %338 unwind label %339

338:                                              ; preds = %336
  store i64 %337, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  store i32 1, ptr %16, align 4
  br label %343

339:                                              ; preds = %336
  %340 = landingpad { ptr, i32 }
          cleanup
  %341 = extractvalue { ptr, i32 } %340, 0
  store ptr %341, ptr %8, align 8
  %342 = extractvalue { ptr, i32 } %340, 1
  store i32 %342, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  br label %345

343:                                              ; preds = %338, %334, %327
  call void @_ZNSt6vectorISt23_Rb_tree_const_iteratorI3segESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @_ZNSt3setI3segSt4lessIS0_ESaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #7
  call void @_ZNSt6vectorI5eventSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  %344 = load i64, ptr %2, align 4
  ret i64 %344

345:                                              ; preds = %339, %335, %123
  call void @_ZNSt6vectorISt23_Rb_tree_const_iteratorI3segESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @_ZNSt3setI3segSt4lessIS0_ESaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #7
  br label %346

346:                                              ; preds = %345, %119, %97
  call void @_ZNSt6vectorI5eventSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %347

347:                                              ; preds = %346
  %348 = load ptr, ptr %8, align 8
  %349 = load i32, ptr %9, align 4
  %350 = insertvalue { ptr, i32 } poison, ptr %348, 0
  %351 = insertvalue { ptr, i32 } %350, i32 %349, 1
  resume { ptr, i32 } %351

352:                                              ; preds = %330
  %353 = landingpad { ptr, i32 }
          catch ptr null
  %354 = extractvalue { ptr, i32 } %353, 0
  call void @__clang_call_terminate(ptr %354) #8
  unreachable
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5eventC2Eeii(ptr noundef nonnull align 16 dereferenceable(24), x86_fp80 noundef, i32 noundef, i32 noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP5eventSt6vectorIS2_SaIS2_EEEEEvT_S8_(ptr, ptr) #4

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3setI3segSt4lessIS0_ESaIS0_EE11lower_boundERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 16 dereferenceable(68)) #2 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4prevISt23_Rb_tree_const_iteratorI3segEET_S3_NSt15iterator_traitsIS3_E15difference_typeE(ptr, i64 noundef) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3setI3segSt4lessIS0_ESaIS0_EE6insertESt23_Rb_tree_const_iteratorIS0_ERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr, ptr noundef nonnull align 16 dereferenceable(68)) #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4nextISt23_Rb_tree_const_iteratorI3segEET_S3_NSt15iterator_traitsIS3_E15difference_typeE(ptr, i64 noundef) #4

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

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

declare ptr @__cxa_begin_catch(ptr)

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

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #6

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

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

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

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

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

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

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


; 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.std::pair" = type { i32, i32 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<event, std::allocator<event>>::_Vector_impl" }
%"struct.std::_Vector_base<event, std::allocator<event>>::_Vector_impl" = type { %"struct.std::_Vector_base<event, std::allocator<event>>::_Vector_impl_data" }
%"struct.std::_Vector_base<event, std::allocator<event>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.event = type <{ x86_fp80, i32, i32, [8 x i8] }>
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<seg, seg, std::_Identity<seg>, std::less<seg>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<seg, seg, std::_Identity<seg>, std::less<seg>>::_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.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<std::_Rb_tree_const_iterator<seg>, std::allocator<std::_Rb_tree_const_iterator<seg>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::_Rb_tree_const_iterator<seg>, std::allocator<std::_Rb_tree_const_iterator<seg>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::_Rb_tree_const_iterator<seg>, std::allocator<std::_Rb_tree_const_iterator<seg>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::_Rb_tree_const_iterator<seg>, std::allocator<std::_Rb_tree_const_iterator<seg>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZSt3maxIeERKT_S2_S2_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZSt3minIeERKT_S2_S2_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z9intersectRK3segS1_(ptr noundef nonnull align 16 dereferenceable(68), ptr noundef nonnull align 16 dereferenceable(68)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z16any_intersectionRKSt6vectorI3segSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24) %0) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca %"class.std::vector.0", align 8
  %4 = alloca %struct.event, align 16
  %5 = alloca %struct.event, align 16
  %6 = alloca %"class.std::set", align 8
  %7 = alloca %"class.std::vector.8", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = tail call noundef i64 @_ZNKSt6vectorI3segSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %26 = trunc i64 %25 to i32
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt6vectorI5eventSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %1
  %wide.trip.count = and i64 %25, 2147483647
  br label %.lr.ph

._crit_edge:                                      ; preds = %42, %1
  %28 = call ptr @_ZNSt6vectorI5eventSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %29 = call ptr @_ZNSt6vectorI5eventSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP5eventSt6vectorIS2_SaIS2_EEEEEvT_S8_(ptr %28, ptr %29)
          to label %47 unwind label %52

.lr.ph:                                           ; preds = %.lr.ph.preheader, %42
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %42 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  %30 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #5
  %31 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #5
  %32 = getelementptr inbounds i8, ptr %31, i64 32
  %33 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZSt3minIeERKT_S2_S2_(ptr noundef nonnull align 16 dereferenceable(16) %30, ptr noundef nonnull align 16 dereferenceable(16) %32)
  %34 = load x86_fp80, ptr %33, align 16, !tbaa !5
  %35 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_ZN5eventC2Eeii(ptr noundef nonnull align 16 dereferenceable(24) %4, x86_fp80 noundef %34, i32 noundef 1, i32 noundef %35)
  invoke void @_ZNSt6vectorI5eventSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 16 dereferenceable(24) %4)
          to label %36 unwind label %43

36:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  %37 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #5
  %38 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #5
  %39 = getelementptr inbounds i8, ptr %38, i64 32
  %40 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZSt3maxIeERKT_S2_S2_(ptr noundef nonnull align 16 dereferenceable(16) %37, ptr noundef nonnull align 16 dereferenceable(16) %39)
  %41 = load x86_fp80, ptr %40, align 16, !tbaa !5
  call void @_ZN5eventC2Eeii(ptr noundef nonnull align 16 dereferenceable(24) %5, x86_fp80 noundef %41, i32 noundef -1, i32 noundef %35)
  invoke void @_ZNSt6vectorI5eventSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 16 dereferenceable(24) %5)
          to label %42 unwind label %45

42:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

43:                                               ; preds = %.lr.ph
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  br label %178

45:                                               ; preds = %36
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  br label %178

47:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #5
  call void @_ZNSt3setI3segSt4lessIS0_ESaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @_ZNSt6vectorISt23_Rb_tree_const_iteratorI3segESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %48 = call noundef i64 @_ZNKSt6vectorI3segSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %sext = shl i64 %48, 32
  %49 = ashr exact i64 %sext, 32
  invoke void @_ZNSt6vectorISt23_Rb_tree_const_iteratorI3segESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %49)
          to label %.preheader unwind label %54

.preheader:                                       ; preds = %47
  %50 = call noundef i64 @_ZNKSt6vectorI5eventSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %51 = trunc i64 %50 to i32
  %.not73 = icmp sgt i32 %51, 0
  br i1 %.not73, label %.lr.ph75, label %.critedge63

52:                                               ; preds = %._crit_edge
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %178

54:                                               ; preds = %168, %47
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %177

.lr.ph75:                                         ; preds = %.preheader, %165
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %165 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %56 = call noundef nonnull align 16 dereferenceable(24) ptr @_ZNSt6vectorI5eventSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv77) #5
  %57 = getelementptr inbounds i8, ptr %56, i64 20
  %58 = load i32, ptr %57, align 4, !tbaa !11
  store i32 %58, ptr %8, align 4, !tbaa !14
  %59 = call noundef nonnull align 16 dereferenceable(24) ptr @_ZNSt6vectorI5eventSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv77) #5
  %60 = getelementptr inbounds i8, ptr %59, i64 16
  %61 = load i32, ptr %60, align 16, !tbaa !15
  %62 = icmp eq i32 %61, 1
  br i1 %62, label %63, label %121

63:                                               ; preds = %.lr.ph75
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %64 = load i32, ptr %8, align 4, !tbaa !14
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %65) #5
  %67 = invoke ptr @_ZNSt3setI3segSt4lessIS0_ESaIS0_EE11lower_boundERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 16 dereferenceable(68) %66)
          to label %68 unwind label %85

68:                                               ; preds = %63
  store ptr %67, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %69 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  store ptr %69, ptr %11, align 8
  %70 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br i1 %70, label %71, label %73

71:                                               ; preds = %68
  %72 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  br label %75

73:                                               ; preds = %68
  %.sroa.012.0.copyload = load ptr, ptr %9, align 8, !tbaa !16
  %74 = invoke ptr @_ZSt4prevISt23_Rb_tree_const_iteratorI3segEET_S3_NSt15iterator_traitsIS3_E15difference_typeE(ptr %.sroa.012.0.copyload, i64 noundef 1)
          to label %75 unwind label %87

75:                                               ; preds = %73, %71
  %storemerge53 = phi ptr [ %72, %71 ], [ %74, %73 ]
  store ptr %storemerge53, ptr %10, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %76 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  store ptr %76, ptr %12, align 8
  %77 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br i1 %77, label %78, label %.critedge

78:                                               ; preds = %75
  %79 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %80 = load i32, ptr %8, align 4, !tbaa !14
  %81 = sext i32 %80 to i64
  %82 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %81) #5
  %83 = invoke noundef zeroext i1 @_Z9intersectRK3segS1_(ptr noundef nonnull align 16 dereferenceable(68) %79, ptr noundef nonnull align 16 dereferenceable(68) %82)
          to label %84 unwind label %89

84:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  br i1 %83, label %.invoke, label %93

85:                                               ; preds = %63
  %86 = landingpad { ptr, i32 }
          catch ptr null
  br label %120

87:                                               ; preds = %73
  %88 = landingpad { ptr, i32 }
          catch ptr null
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %119

89:                                               ; preds = %78
  %90 = landingpad { ptr, i32 }
          catch ptr null
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  br label %119

91:                                               ; preds = %.invoke
  %92 = landingpad { ptr, i32 }
          catch ptr null
  br label %119

.critedge:                                        ; preds = %75
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  br label %93

93:                                               ; preds = %.critedge, %84
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %94 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  store ptr %94, ptr %13, align 8
  %95 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br i1 %95, label %96, label %.critedge4

96:                                               ; preds = %93
  %97 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %98 = load i32, ptr %8, align 4, !tbaa !14
  %99 = sext i32 %98 to i64
  %100 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %99) #5
  %101 = invoke noundef zeroext i1 @_Z9intersectRK3segS1_(ptr noundef nonnull align 16 dereferenceable(68) %97, ptr noundef nonnull align 16 dereferenceable(68) %100)
          to label %102 unwind label %106

102:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br i1 %101, label %.invoke, label %108

.invoke:                                          ; preds = %102, %84
  %.sink81 = phi ptr [ %9, %84 ], [ %10, %102 ]
  %103 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEptEv(ptr noundef nonnull align 8 dereferenceable(8) %.sink81) #5
  %104 = getelementptr inbounds i8, ptr %103, i64 64
  %105 = invoke i64 @_ZSt9make_pairIRKiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4) %104, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %.critedge61 unwind label %91

106:                                              ; preds = %96
  %107 = landingpad { ptr, i32 }
          catch ptr null
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %119

.critedge4:                                       ; preds = %93
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %108

108:                                              ; preds = %.critedge4, %102
  %.sroa.010.0.copyload = load ptr, ptr %9, align 8, !tbaa !16
  %109 = load i32, ptr %8, align 4, !tbaa !14
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt6vectorI3segSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %110) #5
  %112 = invoke ptr @_ZNSt3setI3segSt4lessIS0_ESaIS0_EE6insertESt23_Rb_tree_const_iteratorIS0_ERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr %.sroa.010.0.copyload, ptr noundef nonnull align 16 dereferenceable(68) %111)
          to label %113 unwind label %117

113:                                              ; preds = %108
  %114 = load i32, ptr %8, align 4, !tbaa !14
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorISt23_Rb_tree_const_iteratorI3segESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %115) #5
  store ptr %112, ptr %116, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %165

117:                                              ; preds = %108
  %118 = landingpad { ptr, i32 }
          catch ptr null
  br label %119

119:                                              ; preds = %117, %106, %91, %89, %87
  %.pn54 = phi { ptr, i32 } [ %92, %91 ], [ %118, %117 ], [ %107, %106 ], [ %90, %89 ], [ %88, %87 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %120

120:                                              ; preds = %119, %85
  %.pn54.pn = phi { ptr, i32 } [ %.pn54, %119 ], [ %86, %85 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %168

121:                                              ; preds = %.lr.ph75
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %122 = load i32, ptr %8, align 4, !tbaa !14
  %123 = sext i32 %122 to i64
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorISt23_Rb_tree_const_iteratorI3segESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %123) #5
  %125 = load i64, ptr %124, align 8, !tbaa !16
  store i64 %125, ptr %14, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %126 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  store ptr %126, ptr %15, align 8
  %127 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br i1 %127, label %.thread, label %128

.thread:                                          ; preds = %121
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %165

128:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #5
  %.sroa.09.0.copyload = load ptr, ptr %14, align 8, !tbaa !16
  %129 = invoke ptr @_ZSt4nextISt23_Rb_tree_const_iteratorI3segEET_S3_NSt15iterator_traitsIS3_E15difference_typeE(ptr %.sroa.09.0.copyload, i64 noundef 1)
          to label %130 unwind label %154

130:                                              ; preds = %128
  store ptr %129, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #5
  %131 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  store ptr %131, ptr %18, align 8
  %132 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  br i1 %132, label %133, label %135

133:                                              ; preds = %130
  %134 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  br label %137

135:                                              ; preds = %130
  %.sroa.08.0.copyload = load ptr, ptr %14, align 8, !tbaa !16
  %136 = invoke ptr @_ZSt4prevISt23_Rb_tree_const_iteratorI3segEET_S3_NSt15iterator_traitsIS3_E15difference_typeE(ptr %.sroa.08.0.copyload, i64 noundef 1)
          to label %137 unwind label %156

137:                                              ; preds = %135, %133
  %storemerge = phi ptr [ %134, %133 ], [ %136, %135 ]
  store ptr %storemerge, ptr %17, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #5
  %138 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  store ptr %138, ptr %19, align 8
  %139 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #5
  br i1 %139, label %140, label %.critedge6

140:                                              ; preds = %137
  %141 = call ptr @_ZNKSt3setI3segSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  store ptr %141, ptr %20, align 8
  %142 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorI3segES3_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %20) #5
  br i1 %142, label %143, label %.critedge6

143:                                              ; preds = %140
  %144 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  %145 = call noundef nonnull align 16 dereferenceable(68) ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  %146 = invoke noundef zeroext i1 @_Z9intersectRK3segS1_(ptr noundef nonnull align 16 dereferenceable(68) %144, ptr noundef nonnull align 16 dereferenceable(68) %145)
          to label %147 unwind label %158

147:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  br i1 %146, label %148, label %160

148:                                              ; preds = %147
  %149 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  %150 = getelementptr inbounds i8, ptr %149, i64 64
  %151 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI3segEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  %152 = getelementptr inbounds i8, ptr %151, i64 64
  %153 = invoke i64 @_ZSt9make_pairIRKiS1_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %150, ptr noundef nonnull align 4 dereferenceable(4) %152)
          to label %162 unwind label %.loopexit.split-lp

154:                                              ; preds = %128
  %155 = landingpad { ptr, i32 }
          catch ptr null
  br label %164

156:                                              ; preds = %135
  %157 = landingpad { ptr, i32 }
          catch ptr null
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  br label %163

158:                                              ; preds = %143
  %159 = landingpad { ptr, i32 }
          catch ptr null
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  br label %163

.loopexit:                                        ; preds = %160
  %lpad.loopexit = landingpad { ptr, i32 }
          catch ptr null
  br label %163

.loopexit.split-lp:                               ; preds = %148
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          catch ptr null
  br label %163

.critedge6:                                       ; preds = %137, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  br label %160

160:                                              ; preds = %.critedge6, %147
  %.sroa.07.0.copyload = load ptr, ptr %14, align 8, !tbaa !16
  %161 = invoke ptr @_ZNSt3setI3segSt4lessIS0_ESaIS0_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS0_E(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr %.sroa.07.0.copyload)
          to label %.thread66 unwind label %.loopexit

.thread66:                                        ; preds = %160
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %165

162:                                              ; preds = %148
  store i64 %153, ptr %2, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %170

163:                                              ; preds = %.loopexit, %.loopexit.split-lp, %158, %156
  %.pn = phi { ptr, i32 } [ %159, %158 ], [ %157, %156 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  br label %164

164:                                              ; preds = %163, %154
  %.pn.pn = phi { ptr, i32 } [ %.pn, %163 ], [ %155, %154 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %168

.critedge61:                                      ; preds = %.invoke
  store i64 %105, ptr %2, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %170

165:                                              ; preds = %.thread, %.thread66, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %166 = call noundef i64 @_ZNKSt6vectorI5eventSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %sext80 = shl i64 %166, 32
  %167 = ashr exact i64 %sext80, 32
  %.not = icmp slt i64 %indvars.iv.next78, %167
  br i1 %.not, label %.lr.ph75, label %.critedge63, !llvm.loop !18

168:                                              ; preds = %164, %120
  %.pn54.pn.pn = phi { ptr, i32 } [ %.pn54.pn, %120 ], [ %.pn.pn, %164 ]
  %.5 = extractvalue { ptr, i32 } %.pn54.pn.pn, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  %169 = call ptr @__cxa_begin_catch(ptr %.5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #5
  store i32 0, ptr %21, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %22) #5
  store i32 1, ptr %22, align 4, !tbaa !14
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #5
  invoke void @__cxa_end_catch()
          to label %175 unwind label %54

170:                                              ; preds = %.critedge61, %162
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  br label %175

.critedge63:                                      ; preds = %165, %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %23) #5
  store i32 -1, ptr %23, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %24) #5
  store i32 -1, ptr %24, align 4, !tbaa !14
  %171 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %172 unwind label %173

172:                                              ; preds = %.critedge63
  store i64 %171, ptr %2, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #5
  br label %175

173:                                              ; preds = %.critedge63
  %174 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #5
  br label %177

175:                                              ; preds = %170, %168, %172
  call void @_ZNSt6vectorISt23_Rb_tree_const_iteratorI3segESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @_ZNSt3setI3segSt4lessIS0_ESaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #5
  call void @_ZNSt6vectorI5eventSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  %176 = load i64, ptr %2, align 8
  ret i64 %176

177:                                              ; preds = %173, %54
  %.pn55 = phi { ptr, i32 } [ %174, %173 ], [ %55, %54 ]
  call void @_ZNSt6vectorISt23_Rb_tree_const_iteratorI3segESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @_ZNSt3setI3segSt4lessIS0_ESaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #5
  br label %178

178:                                              ; preds = %43, %45, %177, %52
  %.pn57.pn = phi { ptr, i32 } [ %.pn55, %177 ], [ %53, %52 ], [ %46, %45 ], [ %44, %43 ]
  call void @_ZNSt6vectorI5eventSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn57.pn
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5eventC2Eeii(ptr noundef nonnull align 16 dereferenceable(24), x86_fp80 noundef, i32 noundef, i32 noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP5eventSt6vectorIS2_SaIS2_EEEEEvT_S8_(ptr, ptr) local_unnamed_addr #4

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3setI3segSt4lessIS0_ESaIS0_EE11lower_boundERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 16 dereferenceable(68)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4prevISt23_Rb_tree_const_iteratorI3segEET_S3_NSt15iterator_traitsIS3_E15difference_typeE(ptr, i64 noundef) local_unnamed_addr #4

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3setI3segSt4lessIS0_ESaIS0_EE6insertESt23_Rb_tree_const_iteratorIS0_ERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr, ptr noundef nonnull align 16 dereferenceable(68)) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4nextISt23_Rb_tree_const_iteratorI3segEET_S3_NSt15iterator_traitsIS3_E15difference_typeE(ptr, i64 noundef) local_unnamed_addr #4

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

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

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

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

declare void @__cxa_end_catch() local_unnamed_addr

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

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

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

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

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

!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 = !{!"long double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !13, i64 20}
!12 = !{!"_ZTS5event", !6, i64 0, !13, i64 16, !13, i64 20}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !13, i64 16}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = distinct !{!18, !10}


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