; LLVM IR from tangjz/acm-icpc :: codeforces (453E)

; 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<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<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.Node = type { i32, i32, i32 }
%struct.Event = type { i32, i32, i32, i32 }
%struct.Bit = type { [100001 x i64] }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@sz = external dso_local global [2 x i32], align 4
@rht = external dso_local global [100003 x i32], align 16
@tim = external dso_local global [100003 x i32], align 16
@ans = external dso_local global [100001 x i64], align 16
@sp = external dso_local global %"class.std::set", align 8
@a = external dso_local global [100001 x %struct.Node], align 16
@que = external dso_local global [100001 x %struct.Event], align 16
@eve = external dso_local global [2 x [200003 x %struct.Event]], align 16
@b = external dso_local global [2 x %struct.Bit], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solveiP5Event(i32 noundef, ptr 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5EventEvT_S2_(ptr noundef, ptr 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 %"struct.std::pair", align 8
  %6 = alloca i32, align 4
  %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 %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.Event, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct.Event, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::pair", align 8
  %22 = alloca %"struct.std::pair", align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %35, %0
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = icmp sle i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %38

31:                                               ; preds = %26
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %33
  call void @_ZN4Node4readEv(ptr noundef nonnull align 4 dereferenceable(12) %34)
  br label %35

35:                                               ; preds = %31
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %2, align 4, !tbaa !5
  br label %26, !llvm.loop !9

38:                                               ; preds = %30
  %39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %50, %38
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = load i32, ptr @m, align 4, !tbaa !5
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %53

45:                                               ; preds = %40
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %47
  %49 = load i32, ptr %3, align 4, !tbaa !5
  call void @_ZN5Event4readEi(ptr noundef nonnull align 4 dereferenceable(16) %48, i32 noundef %49)
  br label %50

50:                                               ; preds = %45
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %3, align 4, !tbaa !5
  br label %40, !llvm.loop !11

53:                                               ; preds = %44
  %54 = load i32, ptr @m, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds %struct.Event, ptr @que, i64 %55
  %57 = getelementptr inbounds %struct.Event, ptr %56, i64 1
  call void @_ZSt4sortIP5EventEvT_S2_(ptr noundef getelementptr inbounds (%struct.Event, ptr @que, i64 1), ptr noundef %57)
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr @rht, align 16, !tbaa !5
  store i32 -1, ptr @tim, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  %60 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %61 = getelementptr inbounds { ptr, i8 }, ptr %5, i32 0, i32 0
  %62 = extractvalue { ptr, i8 } %60, 0
  store ptr %62, ptr %61, align 8
  %63 = getelementptr inbounds { ptr, i8 }, ptr %5, i32 0, i32 1
  %64 = extractvalue { ptr, i8 } %60, 1
  store i8 %64, ptr %63, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  store i32 -1, ptr getelementptr inbounds (%struct.Event, ptr getelementptr inbounds ([2 x [200003 x %struct.Event]], ptr @eve, i64 0, i64 1), i32 0, i32 3), align 4, !tbaa !12
  store i32 -1, ptr getelementptr inbounds (%struct.Event, ptr @eve, i32 0, i32 3), align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %317, %53
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = load i32, ptr @m, align 4, !tbaa !5
  %68 = icmp sle i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %320

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.Event, ptr %73, i32 0, i32 2
  %75 = call ptr @_ZNSt3setIiSt4lessIiESaIiEE11upper_boundERKi(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(4) %74)
  %76 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %9, i32 0, i32 0
  store ptr %75, ptr %76, align 8
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %77, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  call void @_ZNSt23_Rb_tree_const_iteratorIiEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  br label %78

78:                                               ; preds = %281, %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %79 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #8
  %80 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %79, ptr %80, align 8
  %81 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  store i32 11, ptr %7, align 4
  br label %282

83:                                               ; preds = %78
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %8, i64 8, i1 false), !tbaa.struct !14
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  %86 = load i32, ptr %85, align 4, !tbaa !5
  store i32 %86, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %87 = load i32, ptr %12, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100003 x i32], ptr @rht, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  store i32 %90, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %91 = load i32, ptr %12, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100003 x i32], ptr @tim, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  store i32 %94, ptr %14, align 4, !tbaa !5
  %95 = load i32, ptr %12, align 4, !tbaa !5
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %97
  %99 = getelementptr inbounds %struct.Event, ptr %98, i32 0, i32 3
  %100 = load i32, ptr %99, align 4, !tbaa !12
  %101 = icmp sgt i32 %95, %100
  br i1 %101, label %102, label %103

102:                                              ; preds = %83
  store i32 11, ptr %7, align 4
  br label %278

103:                                              ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %105
  %107 = getelementptr inbounds %struct.Event, ptr %106, i32 0, i32 2
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %107)
  %109 = load i32, ptr %108, align 4, !tbaa !5
  store i32 %109, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %111
  %113 = getelementptr inbounds %struct.Event, ptr %112, i32 0, i32 3
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %113)
  %115 = load i32, ptr %114, align 4, !tbaa !5
  store i32 %115, ptr %16, align 4, !tbaa !5
  %116 = load i32, ptr %15, align 4, !tbaa !5
  %117 = load i32, ptr %16, align 4, !tbaa !5
  %118 = icmp sgt i32 %116, %117
  br i1 %118, label %119, label %120

119:                                              ; preds = %103
  store i32 13, ptr %7, align 4
  br label %277

120:                                              ; preds = %103
  %121 = load i32, ptr %14, align 4, !tbaa !5
  %122 = icmp slt i32 %121, 0
  br i1 %122, label %123, label %172

123:                                              ; preds = %120
  %124 = load i32, ptr @sz, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [200003 x %struct.Event], ptr @eve, i64 0, i64 %125
  %127 = getelementptr inbounds %struct.Event, ptr %126, i32 0, i32 0
  %128 = load i32, ptr %127, align 16, !tbaa !17
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %130
  %132 = getelementptr inbounds %struct.Event, ptr %131, i32 0, i32 0
  %133 = load i32, ptr %132, align 16, !tbaa !17
  %134 = icmp eq i32 %128, %133
  br i1 %134, label %135, label %150

135:                                              ; preds = %123
  %136 = load i32, ptr @sz, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [200003 x %struct.Event], ptr @eve, i64 0, i64 %137
  %139 = getelementptr inbounds %struct.Event, ptr %138, i32 0, i32 3
  %140 = load i32, ptr %139, align 4, !tbaa !12
  %141 = load i32, ptr %15, align 4, !tbaa !5
  %142 = sub nsw i32 %141, 1
  %143 = icmp eq i32 %140, %142
  br i1 %143, label %144, label %150

144:                                              ; preds = %135
  %145 = load i32, ptr %16, align 4, !tbaa !5
  %146 = load i32, ptr @sz, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [200003 x %struct.Event], ptr @eve, i64 0, i64 %147
  %149 = getelementptr inbounds %struct.Event, ptr %148, i32 0, i32 3
  store i32 %145, ptr %149, align 4, !tbaa !12
  br label %171

150:                                              ; preds = %135, %123
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #8
  %151 = getelementptr inbounds %struct.Event, ptr %17, i32 0, i32 0
  %152 = load i32, ptr %6, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %153
  %155 = getelementptr inbounds %struct.Event, ptr %154, i32 0, i32 0
  %156 = load i32, ptr %155, align 16, !tbaa !17
  store i32 %156, ptr %151, align 4, !tbaa !17
  %157 = getelementptr inbounds %struct.Event, ptr %17, i32 0, i32 1
  %158 = load i32, ptr %6, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %159
  %161 = getelementptr inbounds %struct.Event, ptr %160, i32 0, i32 1
  %162 = load i32, ptr %161, align 4, !tbaa !18
  store i32 %162, ptr %157, align 4, !tbaa !18
  %163 = getelementptr inbounds %struct.Event, ptr %17, i32 0, i32 2
  %164 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %164, ptr %163, align 4, !tbaa !19
  %165 = getelementptr inbounds %struct.Event, ptr %17, i32 0, i32 3
  %166 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %166, ptr %165, align 4, !tbaa !12
  %167 = load i32, ptr @sz, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr @sz, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [200003 x %struct.Event], ptr @eve, i64 0, i64 %169
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %170, ptr align 4 %17, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  br label %171

171:                                              ; preds = %150, %144
  br label %241

172:                                              ; preds = %120
  %173 = load i32, ptr %14, align 4, !tbaa !5
  %174 = load i32, ptr %6, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %175
  %177 = getelementptr inbounds %struct.Event, ptr %176, i32 0, i32 1
  %178 = load i32, ptr %177, align 4, !tbaa !18
  %179 = icmp slt i32 %173, %178
  br i1 %179, label %180, label %240

180:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %181 = load i32, ptr %6, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %182
  %184 = getelementptr inbounds %struct.Event, ptr %183, i32 0, i32 1
  %185 = load i32, ptr %184, align 4, !tbaa !18
  %186 = load i32, ptr %14, align 4, !tbaa !5
  %187 = sub nsw i32 %185, %186
  store i32 %187, ptr %18, align 4, !tbaa !5
  %188 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @sz, i64 0, i64 1), align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [200003 x %struct.Event], ptr getelementptr inbounds ([2 x [200003 x %struct.Event]], ptr @eve, i64 0, i64 1), i64 0, i64 %189
  %191 = getelementptr inbounds %struct.Event, ptr %190, i32 0, i32 0
  %192 = load i32, ptr %191, align 16, !tbaa !17
  %193 = load i32, ptr %6, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %194
  %196 = getelementptr inbounds %struct.Event, ptr %195, i32 0, i32 0
  %197 = load i32, ptr %196, align 16, !tbaa !17
  %198 = icmp eq i32 %192, %197
  br i1 %198, label %199, label %222

199:                                              ; preds = %180
  %200 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @sz, i64 0, i64 1), align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [200003 x %struct.Event], ptr getelementptr inbounds ([2 x [200003 x %struct.Event]], ptr @eve, i64 0, i64 1), i64 0, i64 %201
  %203 = getelementptr inbounds %struct.Event, ptr %202, i32 0, i32 1
  %204 = load i32, ptr %203, align 4, !tbaa !18
  %205 = load i32, ptr %18, align 4, !tbaa !5
  %206 = icmp eq i32 %204, %205
  br i1 %206, label %207, label %222

207:                                              ; preds = %199
  %208 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @sz, i64 0, i64 1), align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [200003 x %struct.Event], ptr getelementptr inbounds ([2 x [200003 x %struct.Event]], ptr @eve, i64 0, i64 1), i64 0, i64 %209
  %211 = getelementptr inbounds %struct.Event, ptr %210, i32 0, i32 3
  %212 = load i32, ptr %211, align 4, !tbaa !12
  %213 = load i32, ptr %15, align 4, !tbaa !5
  %214 = sub nsw i32 %213, 1
  %215 = icmp eq i32 %212, %214
  br i1 %215, label %216, label %222

216:                                              ; preds = %207
  %217 = load i32, ptr %16, align 4, !tbaa !5
  %218 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @sz, i64 0, i64 1), align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [200003 x %struct.Event], ptr getelementptr inbounds ([2 x [200003 x %struct.Event]], ptr @eve, i64 0, i64 1), i64 0, i64 %219
  %221 = getelementptr inbounds %struct.Event, ptr %220, i32 0, i32 3
  store i32 %217, ptr %221, align 4, !tbaa !12
  br label %239

222:                                              ; preds = %207, %199, %180
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #8
  %223 = getelementptr inbounds %struct.Event, ptr %19, i32 0, i32 0
  %224 = load i32, ptr %6, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %225
  %227 = getelementptr inbounds %struct.Event, ptr %226, i32 0, i32 0
  %228 = load i32, ptr %227, align 16, !tbaa !17
  store i32 %228, ptr %223, align 4, !tbaa !17
  %229 = getelementptr inbounds %struct.Event, ptr %19, i32 0, i32 1
  %230 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %230, ptr %229, align 4, !tbaa !18
  %231 = getelementptr inbounds %struct.Event, ptr %19, i32 0, i32 2
  %232 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %232, ptr %231, align 4, !tbaa !19
  %233 = getelementptr inbounds %struct.Event, ptr %19, i32 0, i32 3
  %234 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %234, ptr %233, align 4, !tbaa !12
  %235 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @sz, i64 0, i64 1), align 4, !tbaa !5
  %236 = add nsw i32 %235, 1
  store i32 %236, ptr getelementptr inbounds ([2 x i32], ptr @sz, i64 0, i64 1), align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [200003 x %struct.Event], ptr getelementptr inbounds ([2 x [200003 x %struct.Event]], ptr @eve, i64 0, i64 1), i64 0, i64 %237
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %238, ptr align 4 %19, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  br label %239

239:                                              ; preds = %222, %216
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %240

240:                                              ; preds = %239, %172
  br label %241

241:                                              ; preds = %240, %171
  %242 = load i32, ptr %16, align 4, !tbaa !5
  %243 = load i32, ptr %13, align 4, !tbaa !5
  %244 = icmp slt i32 %242, %243
  br i1 %244, label %245, label %264

245:                                              ; preds = %241
  %246 = load i32, ptr %13, align 4, !tbaa !5
  %247 = load i32, ptr %16, align 4, !tbaa !5
  %248 = add nsw i32 %247, 1
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [100003 x i32], ptr @rht, i64 0, i64 %249
  store i32 %246, ptr %250, align 4, !tbaa !5
  %251 = load i32, ptr %14, align 4, !tbaa !5
  %252 = load i32, ptr %16, align 4, !tbaa !5
  %253 = add nsw i32 %252, 1
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [100003 x i32], ptr @tim, i64 0, i64 %254
  store i32 %251, ptr %255, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %256 = load i32, ptr %16, align 4, !tbaa !5
  %257 = add nsw i32 %256, 1
  store i32 %257, ptr %20, align 4, !tbaa !5
  %258 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %259 = getelementptr inbounds { ptr, i8 }, ptr %21, i32 0, i32 0
  %260 = extractvalue { ptr, i8 } %258, 0
  store ptr %260, ptr %259, align 8
  %261 = getelementptr inbounds { ptr, i8 }, ptr %21, i32 0, i32 1
  %262 = extractvalue { ptr, i8 } %258, 1
  store i8 %262, ptr %261, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %8, i64 8, i1 false), !tbaa.struct !14
  %263 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  br label %264

264:                                              ; preds = %245, %241
  %265 = load i32, ptr %12, align 4, !tbaa !5
  %266 = load i32, ptr %15, align 4, !tbaa !5
  %267 = icmp slt i32 %265, %266
  br i1 %267, label %268, label %274

268:                                              ; preds = %264
  %269 = load i32, ptr %15, align 4, !tbaa !5
  %270 = sub nsw i32 %269, 1
  %271 = load i32, ptr %12, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [100003 x i32], ptr @rht, i64 0, i64 %272
  store i32 %270, ptr %273, align 4, !tbaa !5
  br label %276

274:                                              ; preds = %264
  %275 = call noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(4) %12)
  br label %276

276:                                              ; preds = %274, %268
  store i32 0, ptr %7, align 4
  br label %277

277:                                              ; preds = %276, %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %278

278:                                              ; preds = %277, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  %279 = load i32, ptr %7, align 4
  switch i32 %279, label %282 [
    i32 0, label %280
    i32 13, label %281
  ]

280:                                              ; preds = %278
  br label %281

281:                                              ; preds = %280, %278
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %10, i64 8, i1 false), !tbaa.struct !14
  br label %78, !llvm.loop !21

282:                                              ; preds = %278, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %283

283:                                              ; preds = %282
  %284 = load i32, ptr %6, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %285
  %287 = getelementptr inbounds %struct.Event, ptr %286, i32 0, i32 3
  %288 = load i32, ptr %287, align 4, !tbaa !12
  %289 = load i32, ptr %6, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %290
  %292 = getelementptr inbounds %struct.Event, ptr %291, i32 0, i32 2
  %293 = load i32, ptr %292, align 8, !tbaa !19
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [100003 x i32], ptr @rht, i64 0, i64 %294
  store i32 %288, ptr %295, align 4, !tbaa !5
  %296 = load i32, ptr %6, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %297
  %299 = getelementptr inbounds %struct.Event, ptr %298, i32 0, i32 1
  %300 = load i32, ptr %299, align 4, !tbaa !18
  %301 = load i32, ptr %6, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %302
  %304 = getelementptr inbounds %struct.Event, ptr %303, i32 0, i32 2
  %305 = load i32, ptr %304, align 8, !tbaa !19
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds [100003 x i32], ptr @tim, i64 0, i64 %306
  store i32 %300, ptr %307, align 4, !tbaa !5
  %308 = load i32, ptr %6, align 4, !tbaa !5
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %309
  %311 = getelementptr inbounds %struct.Event, ptr %310, i32 0, i32 2
  %312 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(4) %311)
  %313 = getelementptr inbounds { ptr, i8 }, ptr %22, i32 0, i32 0
  %314 = extractvalue { ptr, i8 } %312, 0
  store ptr %314, ptr %313, align 8
  %315 = getelementptr inbounds { ptr, i8 }, ptr %22, i32 0, i32 1
  %316 = extractvalue { ptr, i8 } %312, 1
  store i8 %316, ptr %315, align 8
  br label %317

317:                                              ; preds = %283
  %318 = load i32, ptr %6, align 4, !tbaa !5
  %319 = add nsw i32 %318, 1
  store i32 %319, ptr %6, align 4, !tbaa !5
  br label %65, !llvm.loop !22

320:                                              ; preds = %69
  %321 = load i32, ptr @sz, align 4, !tbaa !5
  call void @_Z5solveiP5Event(i32 noundef %321, ptr noundef @eve)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 1, ptr %23, align 4, !tbaa !5
  br label %322

322:                                              ; preds = %338, %320
  %323 = load i32, ptr %23, align 4, !tbaa !5
  %324 = load i32, ptr @n, align 4, !tbaa !5
  %325 = icmp sle i32 %323, %324
  br i1 %325, label %327, label %326

326:                                              ; preds = %322
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %341

327:                                              ; preds = %322
  %328 = load i32, ptr %23, align 4, !tbaa !5
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [100001 x i64], ptr getelementptr inbounds ([2 x %struct.Bit], ptr @b, i64 0, i64 1), i64 0, i64 %329
  store i64 0, ptr %330, align 8, !tbaa !23
  %331 = load i32, ptr %23, align 4, !tbaa !5
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds [100001 x i64], ptr @b, i64 0, i64 %332
  store i64 0, ptr %333, align 8, !tbaa !23
  %334 = load i32, ptr %23, align 4, !tbaa !5
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %335
  %337 = getelementptr inbounds %struct.Node, ptr %336, i32 0, i32 0
  store i32 0, ptr %337, align 4, !tbaa !25
  br label %338

338:                                              ; preds = %327
  %339 = load i32, ptr %23, align 4, !tbaa !5
  %340 = add nsw i32 %339, 1
  store i32 %340, ptr %23, align 4, !tbaa !5
  br label %322, !llvm.loop !27

341:                                              ; preds = %326
  %342 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @sz, i64 0, i64 1), align 4, !tbaa !5
  call void @_Z5solveiP5Event(i32 noundef %342, ptr noundef getelementptr inbounds ([2 x [200003 x %struct.Event]], ptr @eve, i64 0, i64 1))
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 1, ptr %24, align 4, !tbaa !5
  br label %343

343:                                              ; preds = %354, %341
  %344 = load i32, ptr %24, align 4, !tbaa !5
  %345 = load i32, ptr @m, align 4, !tbaa !5
  %346 = icmp sle i32 %344, %345
  br i1 %346, label %348, label %347

347:                                              ; preds = %343
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %357

348:                                              ; preds = %343
  %349 = load i32, ptr %24, align 4, !tbaa !5
  %350 = sext i32 %349 to i64
  %351 = getelementptr inbounds [100001 x i64], ptr @ans, i64 0, i64 %350
  %352 = load i64, ptr %351, align 8, !tbaa !23
  %353 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %352)
  br label %354

354:                                              ; preds = %348
  %355 = load i32, ptr %24, align 4, !tbaa !5
  %356 = add nsw i32 %355, 1
  store i32 %356, ptr %24, align 4, !tbaa !5
  br label %343, !llvm.loop !28

357:                                              ; preds = %347
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Node4readEv(ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Event4readEi(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef) #0 align 2

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

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

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

; 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) #6

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

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

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

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

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

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

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

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

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

declare i32 @printf(ptr noundef, ...) #4

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

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

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


; 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<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<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.Node = type { i32, i32, i32 }
%struct.Event = type { i32, i32, i32, i32 }
%struct.Bit = type { [100001 x i64] }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@sz = external dso_local local_unnamed_addr global [2 x i32], align 4
@rht = external dso_local local_unnamed_addr global [100003 x i32], align 16
@tim = external dso_local local_unnamed_addr global [100003 x i32], align 16
@ans = external dso_local local_unnamed_addr global [100001 x i64], align 16
@sp = external dso_local global %"class.std::set", align 8
@a = external dso_local global [100001 x %struct.Node], align 16
@que = external dso_local global [100001 x %struct.Event], align 16
@eve = external dso_local global [2 x [200003 x %struct.Event]], align 16
@b = external dso_local local_unnamed_addr global [2 x %struct.Bit], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solveiP5Event(i32 noundef, ptr 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5EventEvT_S2_(ptr noundef, ptr 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 %"struct.std::_Rb_tree_const_iterator", align 8
  %3 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %.not82 = icmp slt i32 %10, 1
  br i1 %.not82, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %.not7784 = icmp slt i32 %12, 1
  br i1 %.not7784, label %._crit_edge.._crit_edge88_crit_edge, label %.lr.ph87

._crit_edge.._crit_edge88_crit_edge:              ; preds = %._crit_edge
  %.pre = sext i32 %12 to i64
  br label %._crit_edge88

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %13 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv
  tail call void @_ZN4Node4readEv(ptr noundef nonnull align 4 dereferenceable(12) %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %.not.not = icmp slt i64 %indvars.iv, %15
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge88:                                    ; preds = %.lr.ph87, %._crit_edge.._crit_edge88_crit_edge
  %.pre-phi = phi i64 [ %.pre, %._crit_edge.._crit_edge88_crit_edge ], [ %25, %.lr.ph87 ]
  %16 = getelementptr inbounds %struct.Event, ptr @que, i64 %.pre-phi
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  tail call void @_ZSt4sortIP5EventEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @que, i64 16), ptr noundef nonnull %17)
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr @rht, align 16, !tbaa !5
  store i32 -1, ptr @tim, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  %20 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  store i32 -1, ptr getelementptr inbounds (i8, ptr @eve, i64 3200060), align 4, !tbaa !11
  store i32 -1, ptr getelementptr inbounds (i8, ptr @eve, i64 12), align 4, !tbaa !11
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %.not7891 = icmp slt i32 %21, 1
  br i1 %.not7891, label %._crit_edge95, label %.lr.ph94

.lr.ph87:                                         ; preds = %._crit_edge, %.lr.ph87
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.lr.ph87 ], [ 1, %._crit_edge ]
  %22 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %indvars.iv108
  %23 = trunc nuw nsw i64 %indvars.iv108 to i32
  tail call void @_ZN5Event4readEi(ptr noundef nonnull align 4 dereferenceable(16) %22, i32 noundef %23)
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %24 = load i32, ptr @m, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %.not77.not = icmp slt i64 %indvars.iv108, %25
  br i1 %.not77.not, label %.lr.ph87, label %._crit_edge88, !llvm.loop !13

._crit_edge95:                                    ; preds = %.loopexit, %._crit_edge88
  %26 = load i32, ptr @sz, align 4, !tbaa !5
  call void @_Z5solveiP5Event(i32 noundef %26, ptr noundef nonnull @eve)
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %.not7996 = icmp slt i32 %27, 1
  br i1 %.not7996, label %._crit_edge100, label %.lr.ph99.preheader

.lr.ph99.preheader:                               ; preds = %._crit_edge95
  %28 = zext nneg i32 %27 to i64
  %xtraiter = and i64 %28, 1
  %29 = icmp eq i32 %27, 1
  br i1 %29, label %._crit_edge100.loopexit.unr-lcssa, label %.lr.ph99.preheader.new

.lr.ph99.preheader.new:                           ; preds = %.lr.ph99.preheader
  %unroll_iter = and i64 %28, 2147483646
  br label %.lr.ph99

.lr.ph94:                                         ; preds = %._crit_edge88, %.loopexit
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %.loopexit ], [ 1, %._crit_edge88 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %30 = getelementptr inbounds [100001 x %struct.Event], ptr @que, i64 0, i64 %indvars.iv111
  %31 = getelementptr inbounds i8, ptr %30, i64 8
  %32 = call ptr @_ZNSt3setIiSt4lessIiESaIiEE11upper_boundERKi(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(4) %31)
  store ptr %32, ptr %3, align 8
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %34 = load i64, ptr %33, align 8, !tbaa !14
  store i64 %34, ptr %2, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @_ZNSt23_Rb_tree_const_iteratorIiEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %35 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #7
  store ptr %35, ptr %5, align 8
  %36 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br i1 %36, label %.lr.ph90, label %.loopexit

.lr.ph90:                                         ; preds = %.lr.ph94
  %37 = getelementptr inbounds i8, ptr %30, i64 12
  %38 = getelementptr inbounds i8, ptr %30, i64 4
  br label %39

39:                                               ; preds = %.lr.ph90, %117
  %40 = load i64, ptr %2, align 8, !tbaa !14
  store i64 %40, ptr %4, align 8, !tbaa !14
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  %43 = load i32, ptr %42, align 4, !tbaa !5
  store i32 %43, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100003 x i32], ptr @rht, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  store i32 %46, ptr %7, align 4, !tbaa !5
  %47 = getelementptr inbounds [100003 x i32], ptr @tim, i64 0, i64 %44
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = load i32, ptr %37, align 4, !tbaa !11
  %50 = icmp sgt i32 %43, %49
  br i1 %50, label %116, label %51

51:                                               ; preds = %39
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %31)
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %37)
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp sgt i32 %53, %55
  br i1 %56, label %117, label %57

57:                                               ; preds = %51
  %58 = icmp slt i32 %48, 0
  br i1 %58, label %59, label %73

59:                                               ; preds = %57
  %60 = load i32, ptr @sz, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [200003 x %struct.Event], ptr @eve, i64 0, i64 %61
  %63 = load i32, ptr %62, align 16, !tbaa !16
  %64 = load i32, ptr %30, align 16, !tbaa !16
  %65 = icmp eq i32 %63, %64
  br i1 %65, label %66, label %71

66:                                               ; preds = %59
  %67 = getelementptr inbounds i8, ptr %62, i64 12
  %68 = load i32, ptr %67, align 4, !tbaa !11
  %69 = add nsw i32 %53, -1
  %70 = icmp eq i32 %68, %69
  br i1 %70, label %.sink.split, label %71

71:                                               ; preds = %66, %59
  %72 = load i32, ptr %38, align 4, !tbaa !17
  br label %.sink.split.sink.split

73:                                               ; preds = %57
  %74 = load i32, ptr %38, align 4, !tbaa !17
  %75 = icmp slt i32 %48, %74
  br i1 %75, label %76, label %96

76:                                               ; preds = %73
  %77 = sub nsw i32 %74, %48
  %78 = load i32, ptr getelementptr inbounds (i8, ptr @sz, i64 4), align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [200003 x %struct.Event], ptr getelementptr inbounds (i8, ptr @eve, i64 3200048), i64 0, i64 %79
  %81 = load i32, ptr %80, align 16, !tbaa !16
  %82 = load i32, ptr %30, align 16, !tbaa !16
  %83 = icmp eq i32 %81, %82
  br i1 %83, label %84, label %.sink.split.sink.split

84:                                               ; preds = %76
  %85 = getelementptr inbounds i8, ptr %80, i64 4
  %86 = load i32, ptr %85, align 4, !tbaa !17
  %87 = icmp eq i32 %86, %77
  br i1 %87, label %88, label %.sink.split.sink.split

88:                                               ; preds = %84
  %89 = getelementptr inbounds i8, ptr %80, i64 12
  %90 = load i32, ptr %89, align 4, !tbaa !11
  %91 = add nsw i32 %53, -1
  %92 = icmp eq i32 %90, %91
  br i1 %92, label %.sink.split, label %.sink.split.sink.split

.sink.split.sink.split:                           ; preds = %76, %84, %88, %71
  %.sink129 = phi i32 [ %60, %71 ], [ %78, %88 ], [ %78, %84 ], [ %78, %76 ]
  %sz.sink = phi ptr [ @sz, %71 ], [ getelementptr inbounds (i8, ptr @sz, i64 4), %88 ], [ getelementptr inbounds (i8, ptr @sz, i64 4), %84 ], [ getelementptr inbounds (i8, ptr @sz, i64 4), %76 ]
  %eve.sink = phi ptr [ @eve, %71 ], [ getelementptr inbounds (i8, ptr @eve, i64 3200048), %88 ], [ getelementptr inbounds (i8, ptr @eve, i64 3200048), %84 ], [ getelementptr inbounds (i8, ptr @eve, i64 3200048), %76 ]
  %.sink124 = phi i32 [ %64, %71 ], [ %82, %88 ], [ %82, %84 ], [ %82, %76 ]
  %.sink122 = phi i32 [ %72, %71 ], [ %77, %88 ], [ %77, %84 ], [ %77, %76 ]
  %93 = add nsw i32 %.sink129, 1
  store i32 %93, ptr %sz.sink, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [200003 x %struct.Event], ptr %eve.sink, i64 0, i64 %94
  store i32 %.sink124, ptr %95, align 16, !tbaa !5
  %.sroa.414.0..sroa_idx = getelementptr inbounds i8, ptr %95, i64 4
  store i32 %.sink122, ptr %.sroa.414.0..sroa_idx, align 4, !tbaa !5
  %.sroa.515.0..sroa_idx = getelementptr inbounds i8, ptr %95, i64 8
  store i32 %53, ptr %.sroa.515.0..sroa_idx, align 8, !tbaa !5
  %.sroa.616.0..sroa_idx = getelementptr inbounds i8, ptr %95, i64 12
  br label %.sink.split

.sink.split:                                      ; preds = %.sink.split.sink.split, %88, %66
  %.sink = phi ptr [ %67, %66 ], [ %89, %88 ], [ %.sroa.616.0..sroa_idx, %.sink.split.sink.split ]
  store i32 %55, ptr %.sink, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %.sink.split, %73
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = icmp slt i32 %55, %97
  br i1 %98, label %99, label %107

99:                                               ; preds = %96
  %100 = add nsw i32 %55, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100003 x i32], ptr @rht, i64 0, i64 %101
  store i32 %97, ptr %102, align 4, !tbaa !5
  %103 = getelementptr inbounds [100003 x i32], ptr @tim, i64 0, i64 %101
  store i32 %48, ptr %103, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 %100, ptr %8, align 4, !tbaa !5
  %104 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  %105 = load i64, ptr %2, align 8, !tbaa !14
  store i64 %105, ptr %4, align 8, !tbaa !14
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br label %107

107:                                              ; preds = %99, %96
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = icmp slt i32 %108, %53
  br i1 %109, label %110, label %114

110:                                              ; preds = %107
  %111 = add nsw i32 %53, -1
  %112 = sext i32 %108 to i64
  %113 = getelementptr inbounds [100003 x i32], ptr @rht, i64 0, i64 %112
  store i32 %111, ptr %113, align 4, !tbaa !5
  br label %117

114:                                              ; preds = %107
  %115 = call noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(4) %6)
  br label %117

116:                                              ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %.loopexit

117:                                              ; preds = %51, %114, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %118 = load i64, ptr %4, align 8, !tbaa !14
  store i64 %118, ptr %2, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %119 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #7
  store ptr %119, ptr %5, align 8
  %120 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br i1 %120, label %39, label %.loopexit, !llvm.loop !18

.loopexit:                                        ; preds = %117, %.lr.ph94, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %121 = getelementptr inbounds i8, ptr %30, i64 12
  %122 = load i32, ptr %121, align 4, !tbaa !11
  %123 = load i32, ptr %31, align 8, !tbaa !19
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100003 x i32], ptr @rht, i64 0, i64 %124
  store i32 %122, ptr %125, align 4, !tbaa !5
  %126 = getelementptr inbounds i8, ptr %30, i64 4
  %127 = load i32, ptr %126, align 4, !tbaa !17
  %128 = getelementptr inbounds [100003 x i32], ptr @tim, i64 0, i64 %124
  store i32 %127, ptr %128, align 4, !tbaa !5
  %129 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(4) %31)
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %130 = load i32, ptr @m, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %.not78.not = icmp slt i64 %indvars.iv111, %131
  br i1 %.not78.not, label %.lr.ph94, label %._crit_edge95, !llvm.loop !20

._crit_edge100.loopexit.unr-lcssa:                ; preds = %.lr.ph99, %.lr.ph99.preheader
  %indvars.iv114.unr = phi i64 [ 1, %.lr.ph99.preheader ], [ %indvars.iv.next115.1, %.lr.ph99 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge100, label %.lr.ph99.epil

.lr.ph99.epil:                                    ; preds = %._crit_edge100.loopexit.unr-lcssa
  %132 = getelementptr inbounds [100001 x i64], ptr getelementptr inbounds (i8, ptr @b, i64 800008), i64 0, i64 %indvars.iv114.unr
  store i64 0, ptr %132, align 8, !tbaa !21
  %133 = getelementptr inbounds [100001 x i64], ptr @b, i64 0, i64 %indvars.iv114.unr
  store i64 0, ptr %133, align 8, !tbaa !21
  %134 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv114.unr
  store i32 0, ptr %134, align 4, !tbaa !23
  br label %._crit_edge100

._crit_edge100:                                   ; preds = %.lr.ph99.epil, %._crit_edge100.loopexit.unr-lcssa, %._crit_edge95
  %135 = load i32, ptr getelementptr inbounds (i8, ptr @sz, i64 4), align 4, !tbaa !5
  call void @_Z5solveiP5Event(i32 noundef %135, ptr noundef nonnull getelementptr inbounds (i8, ptr @eve, i64 3200048))
  %136 = load i32, ptr @m, align 4, !tbaa !5
  %.not80101 = icmp slt i32 %136, 1
  br i1 %.not80101, label %._crit_edge105, label %.lr.ph104

.lr.ph99:                                         ; preds = %.lr.ph99, %.lr.ph99.preheader.new
  %indvars.iv114 = phi i64 [ 1, %.lr.ph99.preheader.new ], [ %indvars.iv.next115.1, %.lr.ph99 ]
  %niter = phi i64 [ 0, %.lr.ph99.preheader.new ], [ %niter.next.1, %.lr.ph99 ]
  %137 = getelementptr inbounds [100001 x i64], ptr getelementptr inbounds (i8, ptr @b, i64 800008), i64 0, i64 %indvars.iv114
  store i64 0, ptr %137, align 8, !tbaa !21
  %138 = getelementptr inbounds [100001 x i64], ptr @b, i64 0, i64 %indvars.iv114
  store i64 0, ptr %138, align 8, !tbaa !21
  %139 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv114
  store i32 0, ptr %139, align 4, !tbaa !23
  %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
  %140 = getelementptr inbounds [100001 x i64], ptr getelementptr inbounds (i8, ptr @b, i64 800008), i64 0, i64 %indvars.iv.next115
  store i64 0, ptr %140, align 8, !tbaa !21
  %141 = getelementptr inbounds [100001 x i64], ptr @b, i64 0, i64 %indvars.iv.next115
  store i64 0, ptr %141, align 8, !tbaa !21
  %142 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv.next115
  store i32 0, ptr %142, align 4, !tbaa !23
  %indvars.iv.next115.1 = add nuw nsw i64 %indvars.iv114, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge100.loopexit.unr-lcssa, label %.lr.ph99, !llvm.loop !25

._crit_edge105:                                   ; preds = %.lr.ph104, %._crit_edge100
  ret i32 0

.lr.ph104:                                        ; preds = %._crit_edge100, %.lr.ph104
  %indvars.iv117 = phi i64 [ %indvars.iv.next118, %.lr.ph104 ], [ 1, %._crit_edge100 ]
  %143 = getelementptr inbounds [100001 x i64], ptr @ans, i64 0, i64 %indvars.iv117
  %144 = load i64, ptr %143, align 8, !tbaa !21
  %145 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %144)
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %146 = load i32, ptr @m, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %.not80.not = icmp slt i64 %indvars.iv117, %147
  br i1 %.not80.not, label %.lr.ph104, label %._crit_edge105, !llvm.loop !26
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Node4readEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Event4readEi(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3setIiSt4lessIiESaIiEE11upper_boundERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) 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_iteratorIiEmmEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

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

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

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

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

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

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

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

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

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

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

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

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

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


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