; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1034D)

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

%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<std::pair<int, int>, int>, std::pair<std::pair<int, int>, int>, std::_Identity<std::pair<std::pair<int, int>, int>>, std::less<std::pair<std::pair<int, int>, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<std::pair<int, int>, int>, std::pair<std::pair<int, int>, int>, std::_Identity<std::pair<std::pair<int, int>, int>>, std::less<std::pair<std::pair<int, int>, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%struct.Event = type { i32, i32, i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::pair" = type { %"struct.std::pair.0", i32 }
%"struct.std::pair.0" = type { i32, i32 }
%"struct.std::pair.2" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@etot = external dso_local global i32, align 4
@sp = external dso_local global %"class.std::set", align 8
@eve = external dso_local global [1200005 x %struct.Event], align 16
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4calci(i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solvei(i32 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.Event, align 4
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca %"struct.std::pair.0", align 4
  %10 = alloca i32, align 4
  %11 = alloca { i64, i32 }, align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca i8, align 1
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %struct.Event, align 4
  %22 = alloca %"struct.std::pair", align 4
  %23 = alloca %"struct.std::pair.0", align 4
  %24 = alloca { i64, i32 }, align 8
  %25 = alloca %"struct.std::pair.2", align 8
  %26 = alloca %"struct.std::pair", align 4
  %27 = alloca %"struct.std::pair.0", align 4
  %28 = alloca { i64, i32 }, align 8
  %29 = alloca %"struct.std::pair.2", align 8
  %30 = alloca %struct.Event, align 4
  %31 = alloca %"struct.std::pair", align 4
  %32 = alloca %"struct.std::pair.0", align 4
  %33 = alloca { i64, i32 }, align 8
  %34 = alloca %"struct.std::pair.2", align 8
  %35 = alloca %struct.Event, align 4
  %36 = alloca %"struct.std::pair", align 4
  %37 = alloca %"struct.std::pair.0", align 4
  %38 = alloca { i64, i32 }, align 8
  %39 = alloca %"struct.std::pair.2", align 8
  %40 = alloca %struct.Event, align 4
  %41 = alloca %"struct.std::pair", align 4
  %42 = alloca %"struct.std::pair.0", align 4
  %43 = alloca { i64, i32 }, align 8
  %44 = alloca %"struct.std::pair.2", align 8
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %236, %0
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = icmp sle i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %239

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #6
  %56 = getelementptr inbounds %struct.Event, ptr %6, i32 0, i32 0
  %57 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %57, ptr %56, align 4, !tbaa !9
  %58 = getelementptr inbounds %struct.Event, ptr %6, i32 0, i32 1
  %59 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %59, ptr %58, align 4, !tbaa !11
  %60 = getelementptr inbounds %struct.Event, ptr %6, i32 0, i32 2
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = sub nsw i32 %61, %62
  store i32 %63, ptr %60, align 4, !tbaa !12
  %64 = load i32, ptr @etot, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr @etot, align 4, !tbaa !5
  %66 = sext i32 %64 to i64
  %67 = getelementptr inbounds [1200005 x %struct.Event], ptr @eve, i64 0, i64 %66
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %67, ptr align 4 %6, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #6
  %68 = call noundef zeroext i1 @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #6
  br i1 %68, label %228, label %69

69:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %70 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %70, ptr %9, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  %71 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store { i64, i32 } %71, ptr %11, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 8 %11, i64 12, i1 false)
  %72 = call ptr @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE11upper_boundERKS2_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(12) %8)
  %73 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %7, i32 0, i32 0
  store ptr %72, ptr %73, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %74 = call ptr @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #6
  %75 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %12, i32 0, i32 0
  store ptr %74, ptr %75, align 8
  %76 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br i1 %76, label %77, label %79

77:                                               ; preds = %69
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br label %79

79:                                               ; preds = %77, %69
  br label %80

80:                                               ; preds = %226, %79
  %81 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %82 = getelementptr inbounds %"struct.std::pair", ptr %81, i32 0, i32 0
  %83 = getelementptr inbounds %"struct.std::pair.0", ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 4, !tbaa !14
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = icmp sgt i32 %84, %85
  br i1 %86, label %87, label %227

87:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %88 = call ptr @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #6
  %89 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %88, ptr %89, align 8
  %90 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %91 = zext i1 %90 to i8
  store i8 %91, ptr %13, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %92 = call ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 0) #6
  %93 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %94 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %95 = getelementptr inbounds %"struct.std::pair", ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds %"struct.std::pair.0", ptr %95, i32 0, i32 0
  %97 = load i32, ptr %96, align 4, !tbaa !19
  store i32 %97, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %98 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %99 = getelementptr inbounds %"struct.std::pair", ptr %98, i32 0, i32 0
  %100 = getelementptr inbounds %"struct.std::pair.0", ptr %99, i32 0, i32 1
  %101 = load i32, ptr %100, align 4, !tbaa !14
  store i32 %101, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %102 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %103 = getelementptr inbounds %"struct.std::pair", ptr %102, i32 0, i32 1
  %104 = load i32, ptr %103, align 4, !tbaa !20
  store i32 %104, ptr %18, align 4, !tbaa !5
  %105 = load i32, ptr %16, align 4, !tbaa !5
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = icmp slt i32 %105, %106
  br i1 %107, label %108, label %219

108:                                              ; preds = %87
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %15, i64 8, i1 false), !tbaa.struct !21
  %109 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8
  %111 = call ptr @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr %110)
  %112 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %111, ptr %112, align 8
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = load i32, ptr %16, align 4, !tbaa !5
  %115 = icmp sle i32 %113, %114
  br i1 %115, label %116, label %134

116:                                              ; preds = %108
  %117 = load i32, ptr %17, align 4, !tbaa !5
  %118 = load i32, ptr %5, align 4, !tbaa !5
  %119 = icmp sle i32 %117, %118
  br i1 %119, label %120, label %134

120:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #6
  %121 = getelementptr inbounds %struct.Event, ptr %21, i32 0, i32 0
  %122 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %122, ptr %121, align 4, !tbaa !9
  %123 = getelementptr inbounds %struct.Event, ptr %21, i32 0, i32 1
  %124 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %124, ptr %123, align 4, !tbaa !11
  %125 = getelementptr inbounds %struct.Event, ptr %21, i32 0, i32 2
  %126 = load i32, ptr %17, align 4, !tbaa !5
  %127 = load i32, ptr %16, align 4, !tbaa !5
  %128 = sub nsw i32 %126, %127
  %129 = sub nsw i32 0, %128
  store i32 %129, ptr %125, align 4, !tbaa !12
  %130 = load i32, ptr @etot, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr @etot, align 4, !tbaa !5
  %132 = sext i32 %130 to i64
  %133 = getelementptr inbounds [1200005 x %struct.Event], ptr @eve, i64 0, i64 %132
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %133, ptr align 4 %21, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #6
  br label %218

134:                                              ; preds = %116, %108
  %135 = load i32, ptr %16, align 4, !tbaa !5
  %136 = load i32, ptr %4, align 4, !tbaa !5
  %137 = icmp sle i32 %135, %136
  br i1 %137, label %138, label %170

138:                                              ; preds = %134
  %139 = load i32, ptr %5, align 4, !tbaa !5
  %140 = load i32, ptr %17, align 4, !tbaa !5
  %141 = icmp sle i32 %139, %140
  br i1 %141, label %142, label %170

142:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %143 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %143, ptr %23, align 4
  %144 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(4) %18)
  store { i64, i32 } %144, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 8 %24, i64 12, i1 false)
  %145 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(12) %22)
  %146 = getelementptr inbounds { ptr, i8 }, ptr %25, i32 0, i32 0
  %147 = extractvalue { ptr, i8 } %145, 0
  store ptr %147, ptr %146, align 8
  %148 = getelementptr inbounds { ptr, i8 }, ptr %25, i32 0, i32 1
  %149 = extractvalue { ptr, i8 } %145, 1
  store i8 %149, ptr %148, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %26) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %150 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %17)
  store i64 %150, ptr %27, align 4
  %151 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %27, ptr noundef nonnull align 4 dereferenceable(4) %18)
  store { i64, i32 } %151, ptr %28, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 8 %28, i64 12, i1 false)
  %152 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(12) %26)
  %153 = getelementptr inbounds { ptr, i8 }, ptr %29, i32 0, i32 0
  %154 = extractvalue { ptr, i8 } %152, 0
  store ptr %154, ptr %153, align 8
  %155 = getelementptr inbounds { ptr, i8 }, ptr %29, i32 0, i32 1
  %156 = extractvalue { ptr, i8 } %152, 1
  store i8 %156, ptr %155, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %30) #6
  %157 = getelementptr inbounds %struct.Event, ptr %30, i32 0, i32 0
  %158 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %158, ptr %157, align 4, !tbaa !9
  %159 = getelementptr inbounds %struct.Event, ptr %30, i32 0, i32 1
  %160 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %160, ptr %159, align 4, !tbaa !11
  %161 = getelementptr inbounds %struct.Event, ptr %30, i32 0, i32 2
  %162 = load i32, ptr %5, align 4, !tbaa !5
  %163 = load i32, ptr %4, align 4, !tbaa !5
  %164 = sub nsw i32 %162, %163
  %165 = sub nsw i32 0, %164
  store i32 %165, ptr %161, align 4, !tbaa !12
  %166 = load i32, ptr @etot, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr @etot, align 4, !tbaa !5
  %168 = sext i32 %166 to i64
  %169 = getelementptr inbounds [1200005 x %struct.Event], ptr @eve, i64 0, i64 %168
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %169, ptr align 4 %30, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #6
  br label %217

170:                                              ; preds = %138, %134
  %171 = load i32, ptr %4, align 4, !tbaa !5
  %172 = load i32, ptr %16, align 4, !tbaa !5
  %173 = icmp sle i32 %171, %172
  br i1 %173, label %174, label %195

174:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 12, ptr %31) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %175 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %17)
  store i64 %175, ptr %32, align 4
  %176 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %32, ptr noundef nonnull align 4 dereferenceable(4) %18)
  store { i64, i32 } %176, ptr %33, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 8 %33, i64 12, i1 false)
  %177 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(12) %31)
  %178 = getelementptr inbounds { ptr, i8 }, ptr %34, i32 0, i32 0
  %179 = extractvalue { ptr, i8 } %177, 0
  store ptr %179, ptr %178, align 8
  %180 = getelementptr inbounds { ptr, i8 }, ptr %34, i32 0, i32 1
  %181 = extractvalue { ptr, i8 } %177, 1
  store i8 %181, ptr %180, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %31) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %35) #6
  %182 = getelementptr inbounds %struct.Event, ptr %35, i32 0, i32 0
  %183 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %183, ptr %182, align 4, !tbaa !9
  %184 = getelementptr inbounds %struct.Event, ptr %35, i32 0, i32 1
  %185 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %185, ptr %184, align 4, !tbaa !11
  %186 = getelementptr inbounds %struct.Event, ptr %35, i32 0, i32 2
  %187 = load i32, ptr %5, align 4, !tbaa !5
  %188 = load i32, ptr %16, align 4, !tbaa !5
  %189 = sub nsw i32 %187, %188
  %190 = sub nsw i32 0, %189
  store i32 %190, ptr %186, align 4, !tbaa !12
  %191 = load i32, ptr @etot, align 4, !tbaa !5
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr @etot, align 4, !tbaa !5
  %193 = sext i32 %191 to i64
  %194 = getelementptr inbounds [1200005 x %struct.Event], ptr @eve, i64 0, i64 %193
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %194, ptr align 4 %35, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 12, ptr %35) #6
  br label %216

195:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 12, ptr %36) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  %196 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %196, ptr %37, align 4
  %197 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %37, ptr noundef nonnull align 4 dereferenceable(4) %18)
  store { i64, i32 } %197, ptr %38, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %36, ptr align 8 %38, i64 12, i1 false)
  %198 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(12) %36)
  %199 = getelementptr inbounds { ptr, i8 }, ptr %39, i32 0, i32 0
  %200 = extractvalue { ptr, i8 } %198, 0
  store ptr %200, ptr %199, align 8
  %201 = getelementptr inbounds { ptr, i8 }, ptr %39, i32 0, i32 1
  %202 = extractvalue { ptr, i8 } %198, 1
  store i8 %202, ptr %201, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %36) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %40) #6
  %203 = getelementptr inbounds %struct.Event, ptr %40, i32 0, i32 0
  %204 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %204, ptr %203, align 4, !tbaa !9
  %205 = getelementptr inbounds %struct.Event, ptr %40, i32 0, i32 1
  %206 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %206, ptr %205, align 4, !tbaa !11
  %207 = getelementptr inbounds %struct.Event, ptr %40, i32 0, i32 2
  %208 = load i32, ptr %17, align 4, !tbaa !5
  %209 = load i32, ptr %4, align 4, !tbaa !5
  %210 = sub nsw i32 %208, %209
  %211 = sub nsw i32 0, %210
  store i32 %211, ptr %207, align 4, !tbaa !12
  %212 = load i32, ptr @etot, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr @etot, align 4, !tbaa !5
  %214 = sext i32 %212 to i64
  %215 = getelementptr inbounds [1200005 x %struct.Event], ptr @eve, i64 0, i64 %214
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %215, ptr align 4 %40, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 12, ptr %40) #6
  br label %216

216:                                              ; preds = %195, %174
  br label %217

217:                                              ; preds = %216, %142
  br label %218

218:                                              ; preds = %217, %120
  br label %219

219:                                              ; preds = %218, %87
  %220 = load i8, ptr %13, align 1, !tbaa !17, !range !24, !noundef !25
  %221 = trunc i8 %220 to i1
  br i1 %221, label %222, label %223

222:                                              ; preds = %219
  store i32 6, ptr %3, align 4
  br label %224

223:                                              ; preds = %219
  store i32 0, ptr %3, align 4
  br label %224

224:                                              ; preds = %223, %222
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  %225 = load i32, ptr %3, align 4
  switch i32 %225, label %264 [
    i32 0, label %226
    i32 6, label %227
  ]

226:                                              ; preds = %224
  br label %80, !llvm.loop !26

227:                                              ; preds = %224, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %228

228:                                              ; preds = %227, %54
  call void @llvm.lifetime.start.p0(i64 12, ptr %41) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #6
  %229 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %229, ptr %42, align 4
  %230 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %42, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store { i64, i32 } %230, ptr %43, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %41, ptr align 8 %43, i64 12, i1 false)
  %231 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(12) %41)
  %232 = getelementptr inbounds { ptr, i8 }, ptr %44, i32 0, i32 0
  %233 = extractvalue { ptr, i8 } %231, 0
  store ptr %233, ptr %232, align 8
  %234 = getelementptr inbounds { ptr, i8 }, ptr %44, i32 0, i32 1
  %235 = extractvalue { ptr, i8 } %231, 1
  store i8 %235, ptr %234, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %41) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %236

236:                                              ; preds = %228
  %237 = load i32, ptr %2, align 4, !tbaa !5
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %2, align 4, !tbaa !5
  br label %49, !llvm.loop !28

239:                                              ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #6
  store i32 1, ptr %45, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #6
  store i32 999999999, ptr %46, align 4, !tbaa !5
  br label %240

240:                                              ; preds = %260, %239
  %241 = load i32, ptr %45, align 4, !tbaa !5
  %242 = load i32, ptr %46, align 4, !tbaa !5
  %243 = icmp slt i32 %241, %242
  br i1 %243, label %244, label %261

244:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #6
  %245 = load i32, ptr %45, align 4, !tbaa !5
  %246 = load i32, ptr %46, align 4, !tbaa !5
  %247 = add nsw i32 %245, %246
  %248 = add nsw i32 %247, 1
  %249 = ashr i32 %248, 1
  store i32 %249, ptr %47, align 4, !tbaa !5
  %250 = load i32, ptr %47, align 4, !tbaa !5
  %251 = call noundef i64 @_Z4calci(i32 noundef %250)
  %252 = load i32, ptr @m, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = icmp sge i64 %251, %253
  br i1 %254, label %255, label %257

255:                                              ; preds = %244
  %256 = load i32, ptr %47, align 4, !tbaa !5
  store i32 %256, ptr %45, align 4, !tbaa !5
  br label %260

257:                                              ; preds = %244
  %258 = load i32, ptr %47, align 4, !tbaa !5
  %259 = sub nsw i32 %258, 1
  store i32 %259, ptr %46, align 4, !tbaa !5
  br label %260

260:                                              ; preds = %257, %255
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #6
  br label %240, !llvm.loop !29

261:                                              ; preds = %240
  %262 = load i32, ptr %45, align 4, !tbaa !5
  call void @_Z5solvei(i32 noundef %262)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #6
  %263 = load i32, ptr %1, align 4
  ret i32 %263

264:                                              ; preds = %224
  unreachable
}

declare i32 @__isoc99_scanf(ptr 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 @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 norecurse 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 = { "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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTS5Event", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 4}
!12 = !{!10, !6, i64 8}
!13 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!14 = !{!15, !6, i64 4}
!15 = !{!"_ZTSSt4pairIS_IiiEiE", !16, i64 0, !6, i64 8}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!15, !6, i64 0}
!20 = !{!15, !6, i64 8}
!21 = !{i64 0, i64 8, !22}
!22 = !{!23, !23, i64 0}
!23 = !{!"any pointer", !7, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = distinct !{!29, !27}


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

%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<std::pair<int, int>, int>, std::pair<std::pair<int, int>, int>, std::_Identity<std::pair<std::pair<int, int>, int>>, std::less<std::pair<std::pair<int, int>, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<std::pair<int, int>, int>, std::pair<std::pair<int, int>, int>, std::_Identity<std::pair<std::pair<int, int>, int>>, std::less<std::pair<std::pair<int, int>, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%struct.Event = type { i32, i32, i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::pair" = type { %"struct.std::pair.0", i32 }
%"struct.std::pair.0" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@etot = external dso_local local_unnamed_addr global i32, align 4
@sp = external dso_local global %"class.std::set", align 8
@eve = external dso_local local_unnamed_addr global [1200005 x %struct.Event], align 16
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4calci(i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solvei(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair.0", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca %"struct.std::pair.0", align 8
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca %"struct.std::pair.0", align 8
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca %"struct.std::pair.0", align 8
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca %"struct.std::pair.0", align 8
  %22 = alloca %"struct.std::pair", align 8
  %23 = alloca %"struct.std::pair.0", align 8
  %24 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @n, ptr noundef nonnull @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 1, ptr %1, align 4, !tbaa !5
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %.not69 = icmp slt i32 %25, 1
  br i1 %.not69, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %.sroa.249.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  %.sroa.239.0..sroa_idx = getelementptr inbounds i8, ptr %14, i64 8
  %.sroa.233.0..sroa_idx = getelementptr inbounds i8, ptr %16, i64 8
  %.sroa.224.0..sroa_idx = getelementptr inbounds i8, ptr %18, i64 8
  %.sroa.215.0..sroa_idx = getelementptr inbounds i8, ptr %20, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 8
  br label %26

._crit_edge:                                      ; preds = %106, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  br label %113

26:                                               ; preds = %.lr.ph, %106
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %28 = load i32, ptr %1, align 4, !tbaa !5
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sub nsw i32 %29, %30
  %32 = load i32, ptr @etot, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr @etot, align 4, !tbaa !5
  %34 = sext i32 %32 to i64
  %35 = getelementptr inbounds [1200005 x %struct.Event], ptr @eve, i64 0, i64 %34
  store i32 %28, ptr %35, align 4, !tbaa !5
  %.sroa.451.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 4
  store i32 %28, ptr %.sroa.451.0..sroa_idx, align 4, !tbaa !5
  %.sroa.552.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 8
  store i32 %31, ptr %.sroa.552.0..sroa_idx, align 4, !tbaa !5
  %36 = call noundef zeroext i1 @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #5
  br i1 %36, label %106, label %37

37:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %38 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %38, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  %39 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %.fca.0.extract46 = extractvalue { i64, i32 } %39, 0
  %.fca.1.extract47 = extractvalue { i64, i32 } %39, 1
  store i64 %.fca.0.extract46, ptr %5, align 8
  store i32 %.fca.1.extract47, ptr %.sroa.249.0..sroa_idx, align 8
  %40 = call ptr @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE11upper_boundERKS2_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(12) %5)
  store ptr %40, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %41 = call ptr @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #5
  store ptr %41, ptr %8, align 8
  %42 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br i1 %42, label %43, label %.preheader

43:                                               ; preds = %37
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  br label %.preheader

.preheader:                                       ; preds = %43, %37
  br label %45

45:                                               ; preds = %.preheader, %104
  %46 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %47 = getelementptr inbounds i8, ptr %46, i64 4
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = icmp sgt i32 %48, %49
  br i1 %50, label %51, label %105

51:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %52 = call ptr @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #5
  store ptr %52, ptr %9, align 8
  %53 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %54 = call ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 0) #5
  store ptr %54, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  %55 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %56 = load i32, ptr %55, align 4, !tbaa !12
  store i32 %56, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  %57 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %58 = getelementptr inbounds i8, ptr %57, i64 4
  %59 = load i32, ptr %58, align 4, !tbaa !9
  store i32 %59, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  %60 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %61 = getelementptr inbounds i8, ptr %60, i64 8
  %62 = load i32, ptr %61, align 4, !tbaa !13
  store i32 %62, ptr %13, align 4, !tbaa !5
  %63 = load i32, ptr %11, align 4, !tbaa !5
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %66, label %104

66:                                               ; preds = %51
  %.sroa.044.0.copyload = load ptr, ptr %10, align 8, !tbaa !14
  %67 = call ptr @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr %.sroa.044.0.copyload)
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = load i32, ptr %11, align 4, !tbaa !5
  %.not61 = icmp sgt i32 %68, %69
  br i1 %.not61, label %74, label %70

70:                                               ; preds = %66
  %71 = load i32, ptr %12, align 4, !tbaa !5
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %.not62 = icmp sgt i32 %71, %72
  br i1 %.not62, label %74, label %73

73:                                               ; preds = %70
  %.neg68 = sub nsw i32 %69, %71
  br label %.sink.split

74:                                               ; preds = %70, %66
  %.not63 = icmp sgt i32 %69, %68
  br i1 %.not63, label %87, label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = load i32, ptr %12, align 4, !tbaa !5
  %.not64 = icmp sgt i32 %76, %77
  br i1 %.not64, label %87, label %78

78:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %79 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %79, ptr %15, align 8
  %80 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %.fca.0.extract36 = extractvalue { i64, i32 } %80, 0
  %.fca.1.extract37 = extractvalue { i64, i32 } %80, 1
  store i64 %.fca.0.extract36, ptr %14, align 8
  store i32 %.fca.1.extract37, ptr %.sroa.239.0..sroa_idx, align 8
  %81 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(12) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  %82 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store i64 %82, ptr %17, align 8
  %83 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %.fca.0.extract30 = extractvalue { i64, i32 } %83, 0
  %.fca.1.extract31 = extractvalue { i64, i32 } %83, 1
  store i64 %.fca.0.extract30, ptr %16, align 8
  store i32 %.fca.1.extract31, ptr %.sroa.233.0..sroa_idx, align 8
  %84 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(12) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #5
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %.neg67 = sub nsw i32 %86, %85
  br label %.sink.split

87:                                               ; preds = %75, %74
  br i1 %.not61, label %94, label %88

88:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #5
  %89 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store i64 %89, ptr %19, align 8
  %90 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %.fca.0.extract21 = extractvalue { i64, i32 } %90, 0
  %.fca.1.extract22 = extractvalue { i64, i32 } %90, 1
  store i64 %.fca.0.extract21, ptr %18, align 8
  store i32 %.fca.1.extract22, ptr %.sroa.224.0..sroa_idx, align 8
  %91 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(12) %18)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #5
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = load i32, ptr %11, align 4, !tbaa !5
  %.neg66 = sub nsw i32 %93, %92
  br label %.sink.split

94:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #5
  %95 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %95, ptr %21, align 8
  %96 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %.fca.0.extract12 = extractvalue { i64, i32 } %96, 0
  %.fca.1.extract13 = extractvalue { i64, i32 } %96, 1
  store i64 %.fca.0.extract12, ptr %20, align 8
  store i32 %.fca.1.extract13, ptr %.sroa.215.0..sroa_idx, align 8
  %97 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(12) %20)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %20) #5
  %98 = load i32, ptr %12, align 4, !tbaa !5
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %.neg = sub nsw i32 %99, %98
  br label %.sink.split

.sink.split:                                      ; preds = %78, %94, %88, %73
  %.neg68.sink = phi i32 [ %.neg68, %73 ], [ %.neg66, %88 ], [ %.neg, %94 ], [ %.neg67, %78 ]
  %.sink72 = load i32, ptr %1, align 4, !tbaa !5
  %.sink74 = load i32, ptr %13, align 4, !tbaa !5
  %100 = load i32, ptr @etot, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr @etot, align 4, !tbaa !5
  %102 = sext i32 %100 to i64
  %103 = getelementptr inbounds [1200005 x %struct.Event], ptr @eve, i64 0, i64 %102
  store i32 %.sink74, ptr %103, align 4, !tbaa !5
  %.sroa.441.0..sroa_idx = getelementptr inbounds i8, ptr %103, i64 4
  store i32 %.sink72, ptr %.sroa.441.0..sroa_idx, align 4, !tbaa !5
  %.sroa.542.0..sroa_idx = getelementptr inbounds i8, ptr %103, i64 8
  store i32 %.neg68.sink, ptr %.sroa.542.0..sroa_idx, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %.sink.split, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br i1 %53, label %105, label %45

105:                                              ; preds = %104, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %106

106:                                              ; preds = %105, %26
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #5
  %107 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %107, ptr %23, align 8
  %108 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %.fca.0.extract = extractvalue { i64, i32 } %108, 0
  %.fca.1.extract = extractvalue { i64, i32 } %108, 1
  store i64 %.fca.0.extract, ptr %22, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %109 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(12) %22)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %110 = load i32, ptr %1, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %1, align 4, !tbaa !5
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %.not.not = icmp slt i32 %110, %112
  br i1 %.not.not, label %26, label %._crit_edge, !llvm.loop !16

113:                                              ; preds = %._crit_edge, %113
  %.071 = phi i32 [ 999999999, %._crit_edge ], [ %.1, %113 ]
  %.05570 = phi i32 [ 1, %._crit_edge ], [ %.156, %113 ]
  %114 = add nsw i32 %.05570, 1
  %115 = add i32 %114, %.071
  %116 = ashr i32 %115, 1
  %117 = call noundef i64 @_Z4calci(i32 noundef %116)
  %118 = load i32, ptr @m, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %.not60 = icmp slt i64 %117, %119
  %120 = add nsw i32 %116, -1
  %.156 = select i1 %.not60, i32 %.05570, i32 %116
  %.1 = select i1 %.not60, i32 %120, i32 %.071
  %121 = icmp slt i32 %.156, %.1
  br i1 %121, label %113, label %122, !llvm.loop !18

122:                                              ; preds = %113
  call void @_Z5solvei(i32 noundef %.156)
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(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 zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass