; LLVM IR from tangjz/acm-icpc :: codeforces/gym (100624G)

; 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.Point = type { i32, i32, i32 }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@que = external dso_local global [200001 x i32], align 16
@bit = external dso_local global [200001 x i32], align 16
@ans = external dso_local global i32, align 4
@pp = external dso_local global [200001 x %"class.std::set"], align 16
@p = external dso_local global [200001 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3addii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sumi(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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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.std::pair", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i32, align 4
  %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.std::_Rb_tree_const_iterator", align 8
  store i32 0, ptr %1, align 4
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %23

23:                                               ; preds = %260, %0
  %24 = load i32, ptr @t, align 4, !tbaa !5
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr @t, align 4, !tbaa !5
  %26 = icmp ne i32 %24, 0
  br i1 %26, label %27, label %263

27:                                               ; preds = %23
  store i32 0, ptr @ans, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @bit, i8 0, i64 800004, i1 false)
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %63, %27
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %36
  %38 = getelementptr inbounds %struct.Point, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %40
  %42 = getelementptr inbounds %struct.Point, ptr %41, i32 0, i32 1
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %44
  %46 = getelementptr inbounds %struct.Point, ptr %45, i32 0, i32 2
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %38, ptr noundef %42, ptr noundef %46)
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %49
  %51 = getelementptr inbounds %struct.Point, ptr %50, i32 0, i32 2
  %52 = load i32, ptr %51, align 4, !tbaa !9
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %51, align 4, !tbaa !9
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %55
  %57 = getelementptr inbounds %struct.Point, ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 4, !tbaa !11
  %59 = load i32, ptr @tot, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr @tot, align 4, !tbaa !5
  %61 = sext i32 %59 to i64
  %62 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %61
  store i32 %58, ptr %62, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %34
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %2, align 4, !tbaa !5
  br label %29, !llvm.loop !12

66:                                               ; preds = %33
  %67 = load i32, ptr @tot, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i32, ptr @que, i64 %68
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %69)
  %70 = load i32, ptr @tot, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i32, ptr @que, i64 %71
  %73 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %72)
  %74 = ptrtoint ptr %73 to i64
  %75 = sub i64 %74, ptrtoint (ptr @que to i64)
  %76 = sdiv exact i64 %75, 4
  %77 = trunc i64 %76 to i32
  store i32 %77, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %101, %66
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = load i32, ptr @n, align 4, !tbaa !5
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %83, label %82

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

83:                                               ; preds = %78
  %84 = load i32, ptr @tot, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i32, ptr @que, i64 %85
  %87 = load i32, ptr %3, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.Point, ptr %89, i32 0, i32 0
  %91 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %86, ptr noundef nonnull align 4 dereferenceable(4) %90)
  %92 = ptrtoint ptr %91 to i64
  %93 = sub i64 %92, ptrtoint (ptr @que to i64)
  %94 = sdiv exact i64 %93, 4
  %95 = add nsw i64 %94, 1
  %96 = trunc i64 %95 to i32
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %98
  %100 = getelementptr inbounds %struct.Point, ptr %99, i32 0, i32 0
  store i32 %96, ptr %100, align 4, !tbaa !11
  br label %101

101:                                              ; preds = %83
  %102 = load i32, ptr %3, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %3, align 4, !tbaa !5
  br label %78, !llvm.loop !14

104:                                              ; preds = %82
  %105 = load i32, ptr @n, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds %struct.Point, ptr @p, i64 %106
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef @p, ptr noundef %107)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %135, %104
  %109 = load i32, ptr %4, align 4, !tbaa !5
  %110 = load i32, ptr @m, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %138

113:                                              ; preds = %108
  %114 = load i32, ptr %4, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %115
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %116) #8
  %117 = load i32, ptr %4, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !5
  %120 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %119, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %121 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 0
  %122 = extractvalue { ptr, i8 } %120, 0
  store ptr %122, ptr %121, align 8
  %123 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 1
  %124 = extractvalue { ptr, i8 } %120, 1
  store i8 %124, ptr %123, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  %125 = load i32, ptr %4, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %128 = load i32, ptr @tot, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %7, align 4, !tbaa !5
  %130 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %127, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %131 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 0
  %132 = extractvalue { ptr, i8 } %130, 0
  store ptr %132, ptr %131, align 8
  %133 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 1
  %134 = extractvalue { ptr, i8 } %130, 1
  store i8 %134, ptr %133, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %135

135:                                              ; preds = %113
  %136 = load i32, ptr %4, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %4, align 4, !tbaa !5
  br label %108, !llvm.loop !15

138:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  br label %139

139:                                              ; preds = %222, %138
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = load i32, ptr @n, align 4, !tbaa !5
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %223

144:                                              ; preds = %139
  %145 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %145, ptr %10, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %189, %144
  %147 = load i32, ptr %10, align 4, !tbaa !5
  %148 = load i32, ptr @n, align 4, !tbaa !5
  %149 = icmp slt i32 %147, %148
  br i1 %149, label %150, label %162

150:                                              ; preds = %146
  %151 = load i32, ptr %9, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %152
  %154 = getelementptr inbounds %struct.Point, ptr %153, i32 0, i32 1
  %155 = load i32, ptr %154, align 4, !tbaa !16
  %156 = load i32, ptr %10, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %157
  %159 = getelementptr inbounds %struct.Point, ptr %158, i32 0, i32 1
  %160 = load i32, ptr %159, align 4, !tbaa !16
  %161 = icmp eq i32 %155, %160
  br label %162

162:                                              ; preds = %150, %146
  %163 = phi i1 [ false, %146 ], [ %161, %150 ]
  br i1 %163, label %164, label %192

164:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %165 = load i32, ptr %10, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %166
  %168 = getelementptr inbounds %struct.Point, ptr %167, i32 0, i32 2
  %169 = load i32, ptr %168, align 4, !tbaa !9
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %170
  %172 = load i32, ptr %10, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %173
  %175 = getelementptr inbounds %struct.Point, ptr %174, i32 0, i32 0
  %176 = call ptr @_ZNSt3setIiSt4lessIiESaIiEE11lower_boundERKi(ptr noundef nonnull align 8 dereferenceable(48) %171, ptr noundef nonnull align 4 dereferenceable(4) %175)
  %177 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %176, ptr %177, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %178 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = sub nsw i32 %179, 1
  store i32 %180, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  %182 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %181) #8
  %183 = load i32, ptr %182, align 4, !tbaa !5
  store i32 %183, ptr %13, align 4, !tbaa !5
  %184 = load i32, ptr %12, align 4, !tbaa !5
  %185 = call noundef i32 @_Z3sumi(i32 noundef %184)
  %186 = load i32, ptr %13, align 4, !tbaa !5
  %187 = call noundef i32 @_Z3sumi(i32 noundef %186)
  %188 = sub nsw i32 %185, %187
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %188)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %189

189:                                              ; preds = %164
  %190 = load i32, ptr %10, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %10, align 4, !tbaa !5
  br label %146, !llvm.loop !17

192:                                              ; preds = %162
  br label %193

193:                                              ; preds = %219, %192
  %194 = load i32, ptr %9, align 4, !tbaa !5
  %195 = load i32, ptr %10, align 4, !tbaa !5
  %196 = icmp slt i32 %194, %195
  br i1 %196, label %197, label %222

197:                                              ; preds = %193
  %198 = load i32, ptr %9, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %199
  %201 = getelementptr inbounds %struct.Point, ptr %200, i32 0, i32 0
  %202 = load i32, ptr %201, align 4, !tbaa !11
  call void @_Z3addii(i32 noundef %202, i32 noundef 1)
  %203 = load i32, ptr %9, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %204
  %206 = getelementptr inbounds %struct.Point, ptr %205, i32 0, i32 2
  %207 = load i32, ptr %206, align 4, !tbaa !9
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %208
  %210 = load i32, ptr %9, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %211
  %213 = getelementptr inbounds %struct.Point, ptr %212, i32 0, i32 0
  %214 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %209, ptr noundef nonnull align 4 dereferenceable(4) %213)
  %215 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 0
  %216 = extractvalue { ptr, i8 } %214, 0
  store ptr %216, ptr %215, align 8
  %217 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 1
  %218 = extractvalue { ptr, i8 } %214, 1
  store i8 %218, ptr %217, align 8
  br label %219

219:                                              ; preds = %197
  %220 = load i32, ptr %9, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %9, align 4, !tbaa !5
  br label %193, !llvm.loop !18

222:                                              ; preds = %193
  br label %139, !llvm.loop !19

223:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %224

224:                                              ; preds = %257, %223
  %225 = load i32, ptr %15, align 4, !tbaa !5
  %226 = load i32, ptr @m, align 4, !tbaa !5
  %227 = icmp slt i32 %225, %226
  br i1 %227, label %229, label %228

228:                                              ; preds = %224
  store i32 21, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %260

229:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %230 = load i32, ptr %15, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %231
  %233 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %232) #8
  %234 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %233, ptr %234, align 8
  %235 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %235, i64 8, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %236

236:                                              ; preds = %254, %229
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %237 = load i32, ptr %15, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %238
  %240 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %239) #8
  %241 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %240, ptr %241, align 8
  %242 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  br i1 %242, label %244, label %243

243:                                              ; preds = %236
  store i32 24, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %256

244:                                              ; preds = %236
  %245 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  %246 = load i32, ptr %245, align 4, !tbaa !5
  store i32 %246, ptr %18, align 4, !tbaa !5
  %247 = load i32, ptr %18, align 4, !tbaa !5
  %248 = sub nsw i32 %247, 1
  %249 = call noundef i32 @_Z3sumi(i32 noundef %248)
  %250 = load i32, ptr %17, align 4, !tbaa !5
  %251 = call noundef i32 @_Z3sumi(i32 noundef %250)
  %252 = sub nsw i32 %249, %251
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %252)
  %253 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %253, ptr %17, align 4, !tbaa !5
  br label %254

254:                                              ; preds = %244
  %255 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  br label %236, !llvm.loop !23

256:                                              ; preds = %243
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %257

257:                                              ; preds = %256
  %258 = load i32, ptr %15, align 4, !tbaa !5
  %259 = add nsw i32 %258, 1
  store i32 %259, ptr %15, align 4, !tbaa !5
  br label %224, !llvm.loop !24

260:                                              ; preds = %228
  %261 = load i32, ptr @ans, align 4, !tbaa !5
  %262 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %261)
  br label %23, !llvm.loop !25

263:                                              ; preds = %23
  ret i32 0
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5PointEvT_S2_(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) #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)) #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(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_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 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) #7

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

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

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

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 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !6, i64 8}
!10 = !{!"_ZTS5Point", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = !{!10, !6, i64 4}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = !{i64 0, i64 8, !21}
!21 = !{!22, !22, i64 0}
!22 = !{!"any pointer", !7, i64 0}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13}
!25 = distinct !{!25, !13}


; 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.Point = type { i32, i32, i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [200001 x i32], align 16
@bit = external dso_local local_unnamed_addr global [200001 x i32], align 16
@ans = external dso_local global i32, align 4
@pp = external dso_local global [200001 x %"class.std::set"], align 16
@p = external dso_local global [200001 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3addii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sumi(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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %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 %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %8 = load i32, ptr @t, align 4, !tbaa !5
  %9 = add nsw i32 %8, -1
  store i32 %9, ptr @t, align 4, !tbaa !5
  %.not76 = icmp eq i32 %8, 0
  br i1 %.not76, label %._crit_edge79, label %.lr.ph78

.lr.ph78:                                         ; preds = %0, %._crit_edge75
  store i32 0, ptr @ans, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800004) @bit, i8 0, i64 800004, i1 false)
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %.lr.ph78.._crit_edge_crit_edge

.lr.ph78.._crit_edge_crit_edge:                   ; preds = %.lr.ph78
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph78.._crit_edge_crit_edge
  %13 = phi i32 [ %.pre, %.lr.ph78.._crit_edge_crit_edge ], [ %34, %.lr.ph ]
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds i32, ptr @que, i64 %14
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %15)
  %16 = load i32, ptr @tot, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds i32, ptr @que, i64 %17
  %19 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %18)
  %20 = ptrtoint ptr %19 to i64
  %21 = sub i64 %20, ptrtoint (ptr @que to i64)
  %22 = lshr exact i64 %21, 2
  %23 = trunc i64 %22 to i32
  store i32 %23, ptr @tot, align 4, !tbaa !5
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph55, label %._crit_edge.._crit_edge56_crit_edge

._crit_edge.._crit_edge56_crit_edge:              ; preds = %._crit_edge
  %.pre102 = sext i32 %24 to i64
  br label %._crit_edge56

.lr.ph:                                           ; preds = %.lr.ph78, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph78 ]
  %26 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv
  %27 = getelementptr inbounds i8, ptr %26, i64 4
  %28 = getelementptr inbounds i8, ptr %26, i64 8
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %26, ptr noundef nonnull %27, ptr noundef nonnull %28)
  %30 = load i32, ptr %28, align 4, !tbaa !9
  %31 = add nsw i32 %30, -1
  store i32 %31, ptr %28, align 4, !tbaa !9
  %32 = load i32, ptr %26, align 4, !tbaa !11
  %33 = load i32, ptr @tot, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr @tot, align 4, !tbaa !5
  %35 = sext i32 %33 to i64
  %36 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %35
  store i32 %32, ptr %36, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = icmp slt i64 %indvars.iv.next, %38
  br i1 %39, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge56:                                    ; preds = %.lr.ph55, %._crit_edge.._crit_edge56_crit_edge
  %.pre-phi = phi i64 [ %.pre102, %._crit_edge.._crit_edge56_crit_edge ], [ %54, %.lr.ph55 ]
  %40 = getelementptr inbounds %struct.Point, ptr @p, i64 %.pre-phi
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef nonnull @p, ptr noundef nonnull %40)
  %41 = load i32, ptr @m, align 4, !tbaa !5
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph59, label %.preheader51

.lr.ph55:                                         ; preds = %._crit_edge, %.lr.ph55
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %.lr.ph55 ], [ 0, %._crit_edge ]
  %43 = load i32, ptr @tot, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i32, ptr @que, i64 %44
  %46 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv83
  %47 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %45, ptr noundef nonnull align 4 dereferenceable(4) %46)
  %48 = ptrtoint ptr %47 to i64
  %49 = sub i64 %48, ptrtoint (ptr @que to i64)
  %50 = lshr exact i64 %49, 2
  %51 = trunc i64 %50 to i32
  %52 = add i32 %51, 1
  store i32 %52, ptr %46, align 4, !tbaa !11
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = icmp slt i64 %indvars.iv.next84, %54
  br i1 %55, label %.lr.ph55, label %._crit_edge56, !llvm.loop !14

.preheader51:                                     ; preds = %.lr.ph59, %._crit_edge56
  %56 = phi i32 [ %41, %._crit_edge56 ], [ %64, %.lr.ph59 ]
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.preheader, label %.preheader50

.lr.ph59:                                         ; preds = %._crit_edge56, %.lr.ph59
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %.lr.ph59 ], [ 0, %._crit_edge56 ]
  %59 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %indvars.iv86
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %59) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  %60 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %59, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %61 = load i32, ptr @tot, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %2, align 4, !tbaa !5
  %63 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %59, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %64 = load i32, ptr @m, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = icmp slt i64 %indvars.iv.next87, %65
  br i1 %66, label %.lr.ph59, label %.preheader51, !llvm.loop !15

.loopexit.loopexit:                               ; preds = %.lr.ph66
  %.pre100 = load i32, ptr @n, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.critedge
  %67 = phi i32 [ %104, %.critedge ], [ %.pre100, %.loopexit.loopexit ]
  %.1.lcssa = phi i32 [ %.04768, %.critedge ], [ %.048.lcssa, %.loopexit.loopexit ]
  %68 = icmp slt i32 %.1.lcssa, %67
  br i1 %68, label %.preheader, label %.preheader50.loopexit, !llvm.loop !16

.preheader50.loopexit:                            ; preds = %.loopexit
  %.pre101 = load i32, ptr @m, align 4, !tbaa !5
  br label %.preheader50

.preheader50:                                     ; preds = %.preheader50.loopexit, %.preheader51
  %69 = phi i32 [ %.pre101, %.preheader50.loopexit ], [ %56, %.preheader51 ]
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.lr.ph74, label %._crit_edge75

.preheader:                                       ; preds = %.preheader51, %.loopexit
  %71 = phi i32 [ %67, %.loopexit ], [ %57, %.preheader51 ]
  %.04768 = phi i32 [ %.1.lcssa, %.loopexit ], [ 0, %.preheader51 ]
  %72 = sext i32 %.04768 to i64
  %73 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %72, i32 1
  %74 = icmp slt i32 %.04768, %71
  br i1 %74, label %.lr.ph61.preheader, label %.critedge

.lr.ph61.preheader:                               ; preds = %.preheader
  %75 = load i32, ptr %73, align 4, !tbaa !17
  %76 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %72
  %77 = getelementptr inbounds i8, ptr %76, i64 4
  %78 = load i32, ptr %77, align 4, !tbaa !17
  %79 = icmp eq i32 %75, %78
  br i1 %79, label %.lr.ph108, label %.critedge.loopexit

.lr.ph61:                                         ; preds = %.lr.ph108
  %80 = load i32, ptr %73, align 4, !tbaa !17
  %81 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv.next90
  %82 = getelementptr inbounds i8, ptr %81, i64 4
  %83 = load i32, ptr %82, align 4, !tbaa !17
  %84 = icmp eq i32 %80, %83
  br i1 %84, label %.lr.ph108, label %.critedge.loopexit, !llvm.loop !18

.lr.ph108:                                        ; preds = %.lr.ph61.preheader, %.lr.ph61
  %85 = phi ptr [ %81, %.lr.ph61 ], [ %76, %.lr.ph61.preheader ]
  %indvars.iv89107 = phi i64 [ %indvars.iv.next90, %.lr.ph61 ], [ %72, %.lr.ph61.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %86 = getelementptr inbounds i8, ptr %85, i64 8
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %88
  %90 = call ptr @_ZNSt3setIiSt4lessIiESaIiEE11lower_boundERKi(ptr noundef nonnull align 8 dereferenceable(48) %89, ptr noundef nonnull align 4 dereferenceable(4) %85)
  store ptr %90, ptr %3, align 8
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = add nsw i32 %92, -1
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %94) #7
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = call noundef i32 @_Z3sumi(i32 noundef %93)
  %98 = call noundef i32 @_Z3sumi(i32 noundef %96)
  %99 = sub nsw i32 %97, %98
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %99)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %indvars.iv.next90 = add nsw i64 %indvars.iv89107, 1
  %100 = load i32, ptr @n, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = icmp slt i64 %indvars.iv.next90, %101
  br i1 %102, label %.lr.ph61, label %.critedge.loopexit, !llvm.loop !18

.critedge.loopexit:                               ; preds = %.lr.ph61, %.lr.ph108, %.lr.ph61.preheader
  %103 = phi i32 [ %71, %.lr.ph61.preheader ], [ %100, %.lr.ph108 ], [ %100, %.lr.ph61 ]
  %.048.lcssa.ph.in = phi i64 [ %72, %.lr.ph61.preheader ], [ %indvars.iv.next90, %.lr.ph108 ], [ %indvars.iv.next90, %.lr.ph61 ]
  %.048.lcssa.ph = trunc i64 %.048.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader
  %104 = phi i32 [ %71, %.preheader ], [ %103, %.critedge.loopexit ]
  %.048.lcssa = phi i32 [ %.04768, %.preheader ], [ %.048.lcssa.ph, %.critedge.loopexit ]
  %105 = icmp slt i32 %.04768, %.048.lcssa
  br i1 %105, label %.lr.ph66, label %.loopexit

.lr.ph66:                                         ; preds = %.critedge, %.lr.ph66
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %.lr.ph66 ], [ %72, %.critedge ]
  %106 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv92
  %107 = load i32, ptr %106, align 4, !tbaa !11
  call void @_Z3addii(i32 noundef %107, i32 noundef 1)
  %108 = getelementptr inbounds i8, ptr %106, i64 8
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %110
  %112 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %111, ptr noundef nonnull align 4 dereferenceable(4) %106)
  %indvars.iv.next93 = add nsw i64 %indvars.iv92, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next93 to i32
  %exitcond.not = icmp eq i32 %.048.lcssa, %lftr.wideiv
  br i1 %exitcond.not, label %.loopexit.loopexit, label %.lr.ph66, !llvm.loop !19

._crit_edge75:                                    ; preds = %._crit_edge72, %.preheader50
  %113 = load i32, ptr @ans, align 4, !tbaa !5
  %114 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %113)
  %115 = load i32, ptr @t, align 4, !tbaa !5
  %116 = add nsw i32 %115, -1
  store i32 %116, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %115, 0
  br i1 %.not, label %._crit_edge79, label %.lr.ph78, !llvm.loop !20

.lr.ph74:                                         ; preds = %.preheader50, %._crit_edge72
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %._crit_edge72 ], [ 0, %.preheader50 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %117 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %indvars.iv96
  %118 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %117) #7
  store ptr %118, ptr %5, align 8
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %120 = load i64, ptr %119, align 8, !tbaa !21
  store i64 %120, ptr %4, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %121 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %117) #7
  store ptr %121, ptr %6, align 8
  %122 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %122, label %.lr.ph71, label %._crit_edge72

._crit_edge72:                                    ; preds = %.lr.ph71, %.lr.ph74
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %123 = load i32, ptr @m, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = icmp slt i64 %indvars.iv.next97, %124
  br i1 %125, label %.lr.ph74, label %._crit_edge75, !llvm.loop !23

.lr.ph71:                                         ; preds = %.lr.ph74, %.lr.ph71
  %.04369 = phi i32 [ %127, %.lr.ph71 ], [ 0, %.lr.ph74 ]
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = add nsw i32 %127, -1
  %129 = call noundef i32 @_Z3sumi(i32 noundef %128)
  %130 = call noundef i32 @_Z3sumi(i32 noundef %.04369)
  %131 = sub nsw i32 %129, %130
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %131)
  %132 = 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 8, ptr nonnull %6) #7
  %133 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %117) #7
  store ptr %133, ptr %6, align 8
  %134 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %134, label %.lr.ph71, label %._crit_edge72, !llvm.loop !24

._crit_edge79:                                    ; preds = %._crit_edge75, %0
  ret i32 0
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5PointEvT_S2_(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) 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 #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(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_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 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 #0

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

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

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 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 #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { 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 #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 = !{!10, !6, i64 8}
!10 = !{!"_ZTS5Point", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = !{!10, !6, i64 4}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = !{!22, !22, i64 0}
!22 = !{!"any pointer", !7, i64 0}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13}


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