; LLVM IR from tangjz/acm-icpc :: lydsy (3658)

; 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 { i64, i64, 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
@bit = external dso_local global [200001 x i32], align 16
@ans = external dso_local global i32, align 4
@que = external dso_local global [200001 x i64], align 16
@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 [11 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 i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %"struct.std::pair", align 8
  %28 = alloca i32, align 4
  %29 = alloca %"struct.std::pair", align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca %"struct.std::pair", align 8
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %42 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %43 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store i32 0, ptr %1, align 4
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %45

45:                                               ; preds = %466, %0
  %46 = load i32, ptr @t, align 4, !tbaa !5
  %47 = add nsw i32 %46, -1
  store i32 %47, ptr @t, align 4, !tbaa !5
  %48 = icmp ne i32 %46, 0
  br i1 %48, label %49, label %469

49:                                               ; preds = %45
  store i32 0, ptr @ans, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  %50 = 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) #9
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %85, %49
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %88

56:                                               ; preds = %51
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %58
  %60 = getelementptr inbounds %struct.Point, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %62
  %64 = getelementptr inbounds %struct.Point, ptr %63, i32 0, i32 1
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %66
  %68 = getelementptr inbounds %struct.Point, ptr %67, i32 0, i32 2
  %69 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %60, ptr noundef %64, ptr noundef %68)
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %71
  %73 = getelementptr inbounds %struct.Point, ptr %72, i32 0, i32 2
  %74 = load i32, ptr %73, align 8, !tbaa !9
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr %73, align 8, !tbaa !9
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %77
  %79 = getelementptr inbounds %struct.Point, ptr %78, i32 0, i32 0
  %80 = load i64, ptr %79, align 8, !tbaa !12
  %81 = load i32, ptr @tot, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr @tot, align 4, !tbaa !5
  %83 = sext i32 %81 to i64
  %84 = getelementptr inbounds [200001 x i64], ptr @que, i64 0, i64 %83
  store i64 %80, ptr %84, align 8, !tbaa !13
  br label %85

85:                                               ; preds = %56
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %2, align 4, !tbaa !5
  br label %51, !llvm.loop !14

88:                                               ; preds = %55
  %89 = load i32, ptr @tot, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i64, ptr @que, i64 %90
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef @que, ptr noundef %91)
  %92 = load i32, ptr @tot, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i64, ptr @que, i64 %93
  %95 = call noundef ptr @_ZSt6uniqueIPxET_S1_S1_(ptr noundef @que, ptr noundef %94)
  %96 = ptrtoint ptr %95 to i64
  %97 = sub i64 %96, ptrtoint (ptr @que to i64)
  %98 = sdiv exact i64 %97, 8
  %99 = trunc i64 %98 to i32
  store i32 %99, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %122, %88
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = load i32, ptr @n, align 4, !tbaa !5
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %105, label %104

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

105:                                              ; preds = %100
  %106 = load i32, ptr @tot, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i64, ptr @que, i64 %107
  %109 = load i32, ptr %3, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %110
  %112 = getelementptr inbounds %struct.Point, ptr %111, i32 0, i32 0
  %113 = call noundef ptr @_ZSt11lower_boundIPxxET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %108, ptr noundef nonnull align 8 dereferenceable(8) %112)
  %114 = ptrtoint ptr %113 to i64
  %115 = sub i64 %114, ptrtoint (ptr @que to i64)
  %116 = sdiv exact i64 %115, 8
  %117 = add nsw i64 %116, 1
  %118 = load i32, ptr %3, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %119
  %121 = getelementptr inbounds %struct.Point, ptr %120, i32 0, i32 0
  store i64 %117, ptr %121, align 8, !tbaa !12
  br label %122

122:                                              ; preds = %105
  %123 = load i32, ptr %3, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %3, align 4, !tbaa !5
  br label %100, !llvm.loop !16

125:                                              ; preds = %104
  %126 = load i32, ptr @n, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds %struct.Point, ptr @p, i64 %127
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef @p, ptr noundef %128)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %156, %125
  %130 = load i32, ptr %4, align 4, !tbaa !5
  %131 = load i32, ptr @m, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  br label %159

134:                                              ; preds = %129
  %135 = load i32, ptr %4, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %136
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %137) #9
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  store i32 0, ptr %5, align 4, !tbaa !5
  %141 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %140, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %142 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 0
  %143 = extractvalue { ptr, i8 } %141, 0
  store ptr %143, ptr %142, align 8
  %144 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 1
  %145 = extractvalue { ptr, i8 } %141, 1
  store i8 %145, ptr %144, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  %146 = load i32, ptr %4, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  %149 = load i32, ptr @tot, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %7, align 4, !tbaa !5
  %151 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %148, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %152 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 0
  %153 = extractvalue { ptr, i8 } %151, 0
  store ptr %153, ptr %152, align 8
  %154 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 1
  %155 = extractvalue { ptr, i8 } %151, 1
  store i8 %155, ptr %154, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %156

156:                                              ; preds = %134
  %157 = load i32, ptr %4, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %4, align 4, !tbaa !5
  br label %129, !llvm.loop !17

159:                                              ; preds = %133
  call void @llvm.memset.p0.i64(ptr align 16 @bit, i8 0, i64 800004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  br label %160

160:                                              ; preds = %248, %159
  %161 = load i32, ptr %9, align 4, !tbaa !5
  %162 = load i32, ptr @n, align 4, !tbaa !5
  %163 = icmp slt i32 %161, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %160
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %249

165:                                              ; preds = %160
  %166 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %166, ptr %10, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %212, %165
  %168 = load i32, ptr %10, align 4, !tbaa !5
  %169 = load i32, ptr @n, align 4, !tbaa !5
  %170 = icmp slt i32 %168, %169
  br i1 %170, label %171, label %183

171:                                              ; preds = %167
  %172 = load i32, ptr %9, 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 1
  %176 = load i64, ptr %175, align 8, !tbaa !18
  %177 = load i32, ptr %10, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %178
  %180 = getelementptr inbounds %struct.Point, ptr %179, i32 0, i32 1
  %181 = load i64, ptr %180, align 8, !tbaa !18
  %182 = icmp eq i64 %176, %181
  br label %183

183:                                              ; preds = %171, %167
  %184 = phi i1 [ false, %167 ], [ %182, %171 ]
  br i1 %184, label %185, label %215

185:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %186 = load i32, ptr %10, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %187
  %189 = getelementptr inbounds %struct.Point, ptr %188, i32 0, i32 2
  %190 = load i32, ptr %189, align 8, !tbaa !9
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %191
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  %193 = load i32, ptr %10, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %194
  %196 = getelementptr inbounds %struct.Point, ptr %195, i32 0, i32 0
  %197 = load i64, ptr %196, align 8, !tbaa !12
  %198 = trunc i64 %197 to i32
  store i32 %198, ptr %12, align 4, !tbaa !5
  %199 = call ptr @_ZNSt3setIiSt4lessIiESaIiEE11lower_boundERKi(ptr noundef nonnull align 8 dereferenceable(48) %192, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %200 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %199, ptr %200, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  %201 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #9
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = sub nsw i32 %202, 1
  store i32 %203, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  %204 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #9
  %205 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %204) #9
  %206 = load i32, ptr %205, align 4, !tbaa !5
  store i32 %206, ptr %14, align 4, !tbaa !5
  %207 = load i32, ptr %13, align 4, !tbaa !5
  %208 = call noundef i32 @_Z3sumi(i32 noundef %207)
  %209 = load i32, ptr %14, align 4, !tbaa !5
  %210 = call noundef i32 @_Z3sumi(i32 noundef %209)
  %211 = sub nsw i32 %208, %210
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %211)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  br label %212

212:                                              ; preds = %185
  %213 = load i32, ptr %10, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %10, align 4, !tbaa !5
  br label %167, !llvm.loop !19

215:                                              ; preds = %183
  br label %216

216:                                              ; preds = %245, %215
  %217 = load i32, ptr %9, align 4, !tbaa !5
  %218 = load i32, ptr %10, align 4, !tbaa !5
  %219 = icmp slt i32 %217, %218
  br i1 %219, label %220, label %248

220:                                              ; preds = %216
  %221 = load i32, ptr %9, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %222
  %224 = getelementptr inbounds %struct.Point, ptr %223, i32 0, i32 0
  %225 = load i64, ptr %224, align 8, !tbaa !12
  %226 = trunc i64 %225 to i32
  call void @_Z3addii(i32 noundef %226, i32 noundef 1)
  %227 = load i32, ptr %9, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %228
  %230 = getelementptr inbounds %struct.Point, ptr %229, i32 0, i32 2
  %231 = load i32, ptr %230, align 8, !tbaa !9
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %232
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  %234 = load i32, ptr %9, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %235
  %237 = getelementptr inbounds %struct.Point, ptr %236, i32 0, i32 0
  %238 = load i64, ptr %237, align 8, !tbaa !12
  %239 = trunc i64 %238 to i32
  store i32 %239, ptr %15, align 4, !tbaa !5
  %240 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %233, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %241 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 0
  %242 = extractvalue { ptr, i8 } %240, 0
  store ptr %242, ptr %241, align 8
  %243 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 1
  %244 = extractvalue { ptr, i8 } %240, 1
  store i8 %244, ptr %243, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %245

245:                                              ; preds = %220
  %246 = load i32, ptr %9, align 4, !tbaa !5
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %9, align 4, !tbaa !5
  br label %216, !llvm.loop !20

248:                                              ; preds = %216
  br label %160, !llvm.loop !21

249:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %250

250:                                              ; preds = %283, %249
  %251 = load i32, ptr %17, align 4, !tbaa !5
  %252 = load i32, ptr @m, align 4, !tbaa !5
  %253 = icmp slt i32 %251, %252
  br i1 %253, label %255, label %254

254:                                              ; preds = %250
  store i32 21, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  br label %286

255:                                              ; preds = %250
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  %256 = load i32, ptr %17, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %257
  %259 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %258) #9
  %260 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %259, ptr %260, align 8
  %261 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %261, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  br label %262

262:                                              ; preds = %280, %255
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  %263 = load i32, ptr %17, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %264
  %266 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %265) #9
  %267 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %23, i32 0, i32 0
  store ptr %266, ptr %267, align 8
  %268 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  br i1 %268, label %270, label %269

269:                                              ; preds = %262
  store i32 24, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %282

270:                                              ; preds = %262
  %271 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #9
  %272 = load i32, ptr %271, align 4, !tbaa !5
  store i32 %272, ptr %20, align 4, !tbaa !5
  %273 = load i32, ptr %20, align 4, !tbaa !5
  %274 = sub nsw i32 %273, 1
  %275 = call noundef i32 @_Z3sumi(i32 noundef %274)
  %276 = load i32, ptr %19, align 4, !tbaa !5
  %277 = call noundef i32 @_Z3sumi(i32 noundef %276)
  %278 = sub nsw i32 %275, %277
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %278)
  %279 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %279, ptr %19, align 4, !tbaa !5
  br label %280

280:                                              ; preds = %270
  %281 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #9
  br label %262, !llvm.loop !25

282:                                              ; preds = %269
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %283

283:                                              ; preds = %282
  %284 = load i32, ptr %17, align 4, !tbaa !5
  %285 = add nsw i32 %284, 1
  store i32 %285, ptr %17, align 4, !tbaa !5
  br label %250, !llvm.loop !26

286:                                              ; preds = %254
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %287

287:                                              ; preds = %305, %286
  %288 = load i32, ptr %24, align 4, !tbaa !5
  %289 = load i32, ptr @n, align 4, !tbaa !5
  %290 = load i32, ptr %24, align 4, !tbaa !5
  %291 = sub nsw i32 %289, %290
  %292 = sub nsw i32 %291, 1
  %293 = icmp slt i32 %288, %292
  br i1 %293, label %295, label %294

294:                                              ; preds = %287
  store i32 27, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %308

295:                                              ; preds = %287
  %296 = load i32, ptr %24, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %297
  %299 = load i32, ptr @n, align 4, !tbaa !5
  %300 = load i32, ptr %24, align 4, !tbaa !5
  %301 = sub nsw i32 %299, %300
  %302 = sub nsw i32 %301, 1
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %303
  call void @_ZSt4swapI5PointENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(24) %298, ptr noundef nonnull align 8 dereferenceable(24) %304) #9
  br label %305

305:                                              ; preds = %295
  %306 = load i32, ptr %24, align 4, !tbaa !5
  %307 = add nsw i32 %306, 1
  store i32 %307, ptr %24, align 4, !tbaa !5
  br label %287, !llvm.loop !27

308:                                              ; preds = %294
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #9
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %309

309:                                              ; preds = %336, %308
  %310 = load i32, ptr %25, align 4, !tbaa !5
  %311 = load i32, ptr @m, align 4, !tbaa !5
  %312 = icmp slt i32 %310, %311
  br i1 %312, label %314, label %313

313:                                              ; preds = %309
  store i32 30, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #9
  br label %339

314:                                              ; preds = %309
  %315 = load i32, ptr %25, align 4, !tbaa !5
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %316
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %317) #9
  %318 = load i32, ptr %25, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %319
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  store i32 0, ptr %26, align 4, !tbaa !5
  %321 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %320, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %322 = getelementptr inbounds { ptr, i8 }, ptr %27, i32 0, i32 0
  %323 = extractvalue { ptr, i8 } %321, 0
  store ptr %323, ptr %322, align 8
  %324 = getelementptr inbounds { ptr, i8 }, ptr %27, i32 0, i32 1
  %325 = extractvalue { ptr, i8 } %321, 1
  store i8 %325, ptr %324, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  %326 = load i32, ptr %25, align 4, !tbaa !5
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %327
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  %329 = load i32, ptr @tot, align 4, !tbaa !5
  %330 = add nsw i32 %329, 1
  store i32 %330, ptr %28, align 4, !tbaa !5
  %331 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %328, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %332 = getelementptr inbounds { ptr, i8 }, ptr %29, i32 0, i32 0
  %333 = extractvalue { ptr, i8 } %331, 0
  store ptr %333, ptr %332, align 8
  %334 = getelementptr inbounds { ptr, i8 }, ptr %29, i32 0, i32 1
  %335 = extractvalue { ptr, i8 } %331, 1
  store i8 %335, ptr %334, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  br label %336

336:                                              ; preds = %314
  %337 = load i32, ptr %25, align 4, !tbaa !5
  %338 = add nsw i32 %337, 1
  store i32 %338, ptr %25, align 4, !tbaa !5
  br label %309, !llvm.loop !28

339:                                              ; preds = %313
  call void @llvm.memset.p0.i64(ptr align 16 @bit, i8 0, i64 800004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #9
  store i32 0, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #9
  br label %340

340:                                              ; preds = %428, %339
  %341 = load i32, ptr %30, align 4, !tbaa !5
  %342 = load i32, ptr @n, align 4, !tbaa !5
  %343 = icmp slt i32 %341, %342
  br i1 %343, label %345, label %344

344:                                              ; preds = %340
  store i32 33, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #9
  br label %429

345:                                              ; preds = %340
  %346 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %346, ptr %31, align 4, !tbaa !5
  br label %347

347:                                              ; preds = %392, %345
  %348 = load i32, ptr %31, align 4, !tbaa !5
  %349 = load i32, ptr @n, align 4, !tbaa !5
  %350 = icmp slt i32 %348, %349
  br i1 %350, label %351, label %363

351:                                              ; preds = %347
  %352 = load i32, ptr %30, align 4, !tbaa !5
  %353 = sext i32 %352 to i64
  %354 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %353
  %355 = getelementptr inbounds %struct.Point, ptr %354, i32 0, i32 1
  %356 = load i64, ptr %355, align 8, !tbaa !18
  %357 = load i32, ptr %31, align 4, !tbaa !5
  %358 = sext i32 %357 to i64
  %359 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %358
  %360 = getelementptr inbounds %struct.Point, ptr %359, i32 0, i32 1
  %361 = load i64, ptr %360, align 8, !tbaa !18
  %362 = icmp eq i64 %356, %361
  br label %363

363:                                              ; preds = %351, %347
  %364 = phi i1 [ false, %347 ], [ %362, %351 ]
  br i1 %364, label %365, label %395

365:                                              ; preds = %363
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #9
  %366 = load i32, ptr %31, align 4, !tbaa !5
  %367 = sext i32 %366 to i64
  %368 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %367
  %369 = getelementptr inbounds %struct.Point, ptr %368, i32 0, i32 2
  %370 = load i32, ptr %369, align 8, !tbaa !9
  %371 = sext i32 %370 to i64
  %372 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %371
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #9
  %373 = load i32, ptr %31, align 4, !tbaa !5
  %374 = sext i32 %373 to i64
  %375 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %374
  %376 = getelementptr inbounds %struct.Point, ptr %375, i32 0, i32 0
  %377 = load i64, ptr %376, align 8, !tbaa !12
  %378 = trunc i64 %377 to i32
  store i32 %378, ptr %33, align 4, !tbaa !5
  %379 = call ptr @_ZNSt3setIiSt4lessIiESaIiEE11lower_boundERKi(ptr noundef nonnull align 8 dereferenceable(48) %372, ptr noundef nonnull align 4 dereferenceable(4) %33)
  %380 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %32, i32 0, i32 0
  store ptr %379, ptr %380, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #9
  %381 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %32) #9
  %382 = load i32, ptr %381, align 4, !tbaa !5
  %383 = sub nsw i32 %382, 1
  store i32 %383, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #9
  %384 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %32) #9
  %385 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %384) #9
  %386 = load i32, ptr %385, align 4, !tbaa !5
  store i32 %386, ptr %35, align 4, !tbaa !5
  %387 = load i32, ptr %34, align 4, !tbaa !5
  %388 = call noundef i32 @_Z3sumi(i32 noundef %387)
  %389 = load i32, ptr %35, align 4, !tbaa !5
  %390 = call noundef i32 @_Z3sumi(i32 noundef %389)
  %391 = sub nsw i32 %388, %390
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %391)
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #9
  br label %392

392:                                              ; preds = %365
  %393 = load i32, ptr %31, align 4, !tbaa !5
  %394 = add nsw i32 %393, 1
  store i32 %394, ptr %31, align 4, !tbaa !5
  br label %347, !llvm.loop !29

395:                                              ; preds = %363
  br label %396

396:                                              ; preds = %425, %395
  %397 = load i32, ptr %30, align 4, !tbaa !5
  %398 = load i32, ptr %31, align 4, !tbaa !5
  %399 = icmp slt i32 %397, %398
  br i1 %399, label %400, label %428

400:                                              ; preds = %396
  %401 = load i32, ptr %30, align 4, !tbaa !5
  %402 = sext i32 %401 to i64
  %403 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %402
  %404 = getelementptr inbounds %struct.Point, ptr %403, i32 0, i32 0
  %405 = load i64, ptr %404, align 8, !tbaa !12
  %406 = trunc i64 %405 to i32
  call void @_Z3addii(i32 noundef %406, i32 noundef 1)
  %407 = load i32, ptr %30, align 4, !tbaa !5
  %408 = sext i32 %407 to i64
  %409 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %408
  %410 = getelementptr inbounds %struct.Point, ptr %409, i32 0, i32 2
  %411 = load i32, ptr %410, align 8, !tbaa !9
  %412 = sext i32 %411 to i64
  %413 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %412
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #9
  %414 = load i32, ptr %30, align 4, !tbaa !5
  %415 = sext i32 %414 to i64
  %416 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %415
  %417 = getelementptr inbounds %struct.Point, ptr %416, i32 0, i32 0
  %418 = load i64, ptr %417, align 8, !tbaa !12
  %419 = trunc i64 %418 to i32
  store i32 %419, ptr %36, align 4, !tbaa !5
  %420 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %413, ptr noundef nonnull align 4 dereferenceable(4) %36)
  %421 = getelementptr inbounds { ptr, i8 }, ptr %37, i32 0, i32 0
  %422 = extractvalue { ptr, i8 } %420, 0
  store ptr %422, ptr %421, align 8
  %423 = getelementptr inbounds { ptr, i8 }, ptr %37, i32 0, i32 1
  %424 = extractvalue { ptr, i8 } %420, 1
  store i8 %424, ptr %423, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #9
  br label %425

425:                                              ; preds = %400
  %426 = load i32, ptr %30, align 4, !tbaa !5
  %427 = add nsw i32 %426, 1
  store i32 %427, ptr %30, align 4, !tbaa !5
  br label %396, !llvm.loop !30

428:                                              ; preds = %396
  br label %340, !llvm.loop !31

429:                                              ; preds = %344
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #9
  store i32 0, ptr %38, align 4, !tbaa !5
  br label %430

430:                                              ; preds = %463, %429
  %431 = load i32, ptr %38, align 4, !tbaa !5
  %432 = load i32, ptr @m, align 4, !tbaa !5
  %433 = icmp slt i32 %431, %432
  br i1 %433, label %435, label %434

434:                                              ; preds = %430
  store i32 41, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #9
  br label %466

435:                                              ; preds = %430
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #9
  store i32 0, ptr %39, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #9
  %436 = load i32, ptr %38, align 4, !tbaa !5
  %437 = sext i32 %436 to i64
  %438 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %437
  %439 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %438) #9
  %440 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %42, i32 0, i32 0
  store ptr %439, ptr %440, align 8
  %441 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %42) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %41, ptr align 8 %441, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #9
  br label %442

442:                                              ; preds = %460, %435
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #9
  %443 = load i32, ptr %38, align 4, !tbaa !5
  %444 = sext i32 %443 to i64
  %445 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %444
  %446 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %445) #9
  %447 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %43, i32 0, i32 0
  store ptr %446, ptr %447, align 8
  %448 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull align 8 dereferenceable(8) %43) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #9
  br i1 %448, label %450, label %449

449:                                              ; preds = %442
  store i32 44, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #9
  br label %462

450:                                              ; preds = %442
  %451 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %41) #9
  %452 = load i32, ptr %451, align 4, !tbaa !5
  store i32 %452, ptr %40, align 4, !tbaa !5
  %453 = load i32, ptr %40, align 4, !tbaa !5
  %454 = sub nsw i32 %453, 1
  %455 = call noundef i32 @_Z3sumi(i32 noundef %454)
  %456 = load i32, ptr %39, align 4, !tbaa !5
  %457 = call noundef i32 @_Z3sumi(i32 noundef %456)
  %458 = sub nsw i32 %455, %457
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %458)
  %459 = load i32, ptr %40, align 4, !tbaa !5
  store i32 %459, ptr %39, align 4, !tbaa !5
  br label %460

460:                                              ; preds = %450
  %461 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %41) #9
  br label %442, !llvm.loop !32

462:                                              ; preds = %449
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  br label %463

463:                                              ; preds = %462
  %464 = load i32, ptr %38, align 4, !tbaa !5
  %465 = add nsw i32 %464, 1
  store i32 %465, ptr %38, align 4, !tbaa !5
  br label %430, !llvm.loop !33

466:                                              ; preds = %434
  %467 = load i32, ptr @ans, align 4, !tbaa !5
  %468 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %467)
  br label %45, !llvm.loop !34

469:                                              ; preds = %45
  ret i32 0
}

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

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

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

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

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

; 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)) #5 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapI5PointENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #8

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


; 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 { i64, i64, 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
@bit = external dso_local local_unnamed_addr global [200001 x i32], align 16
@ans = external dso_local global i32, align 4
@que = external dso_local global [200001 x i64], align 16
@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 [11 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 i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", 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::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %18 = load i32, ptr @t, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr @t, align 4, !tbaa !5
  %.not150 = icmp eq i32 %18, 0
  br i1 %.not150, label %._crit_edge153, label %.lr.ph152

.lr.ph152:                                        ; preds = %0, %._crit_edge149
  store i32 0, ptr @ans, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph, label %.lr.ph152.._crit_edge_crit_edge

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

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph152.._crit_edge_crit_edge
  %23 = phi i32 [ %.pre, %.lr.ph152.._crit_edge_crit_edge ], [ %44, %.lr.ph ]
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i64, ptr @que, i64 %24
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %25)
  %26 = load i32, ptr @tot, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i64, ptr @que, i64 %27
  %29 = call noundef ptr @_ZSt6uniqueIPxET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %28)
  %30 = ptrtoint ptr %29 to i64
  %31 = sub i64 %30, ptrtoint (ptr @que to i64)
  %32 = lshr exact i64 %31, 3
  %33 = trunc i64 %32 to i32
  store i32 %33, ptr @tot, align 4, !tbaa !5
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph108, label %._crit_edge.._crit_edge109_crit_edge

._crit_edge.._crit_edge109_crit_edge:             ; preds = %._crit_edge
  %.pre204 = sext i32 %34 to i64
  br label %._crit_edge109

.lr.ph:                                           ; preds = %.lr.ph152, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph152 ]
  %36 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  %38 = getelementptr inbounds i8, ptr %36, i64 16
  %39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %36, ptr noundef nonnull %37, ptr noundef nonnull %38)
  %40 = load i32, ptr %38, align 8, !tbaa !9
  %41 = add nsw i32 %40, -1
  store i32 %41, ptr %38, align 8, !tbaa !9
  %42 = load i64, ptr %36, align 8, !tbaa !12
  %43 = load i32, ptr @tot, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr @tot, align 4, !tbaa !5
  %45 = sext i32 %43 to i64
  %46 = getelementptr inbounds [200001 x i64], ptr @que, i64 0, i64 %45
  store i64 %42, ptr %46, align 8, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = icmp slt i64 %indvars.iv.next, %48
  br i1 %49, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge109:                                   ; preds = %.lr.ph108, %._crit_edge.._crit_edge109_crit_edge
  %.pre-phi = phi i64 [ %.pre204, %._crit_edge.._crit_edge109_crit_edge ], [ %63, %.lr.ph108 ]
  %50 = getelementptr inbounds %struct.Point, ptr @p, i64 %.pre-phi
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef nonnull @p, ptr noundef nonnull %50)
  %51 = load i32, ptr @m, align 4, !tbaa !5
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph112, label %._crit_edge113

.lr.ph108:                                        ; preds = %._crit_edge, %.lr.ph108
  %indvars.iv158 = phi i64 [ %indvars.iv.next159, %.lr.ph108 ], [ 0, %._crit_edge ]
  %53 = load i32, ptr @tot, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i64, ptr @que, i64 %54
  %56 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv158
  %57 = call noundef ptr @_ZSt11lower_boundIPxxET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %55, ptr noundef nonnull align 8 dereferenceable(8) %56)
  %58 = ptrtoint ptr %57 to i64
  %59 = sub i64 %58, ptrtoint (ptr @que to i64)
  %60 = ashr exact i64 %59, 3
  %61 = add nsw i64 %60, 1
  store i64 %61, ptr %56, align 8, !tbaa !12
  %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next159, %63
  br i1 %64, label %.lr.ph108, label %._crit_edge109, !llvm.loop !16

._crit_edge113:                                   ; preds = %.lr.ph112, %._crit_edge109
  %65 = phi i32 [ %51, %._crit_edge109 ], [ %73, %.lr.ph112 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800004) @bit, i8 0, i64 800004, i1 false)
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %.preheader100, label %.preheader104

.lr.ph112:                                        ; preds = %._crit_edge109, %.lr.ph112
  %indvars.iv161 = phi i64 [ %indvars.iv.next162, %.lr.ph112 ], [ 0, %._crit_edge109 ]
  %68 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %indvars.iv161
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %68) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 0, ptr %1, align 4, !tbaa !5
  %69 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %68, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %70 = load i32, ptr @tot, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %2, align 4, !tbaa !5
  %72 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %68, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next162, %74
  br i1 %75, label %.lr.ph112, label %._crit_edge113, !llvm.loop !17

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

.loopexit99:                                      ; preds = %.loopexit99.loopexit, %.critedge
  %76 = phi i32 [ %116, %.critedge ], [ %.pre197, %.loopexit99.loopexit ]
  %.1.lcssa = phi i32 [ %.088122, %.critedge ], [ %.089.lcssa, %.loopexit99.loopexit ]
  %77 = icmp slt i32 %.1.lcssa, %76
  br i1 %77, label %.preheader100, label %.preheader104.loopexit, !llvm.loop !18

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

.preheader104:                                    ; preds = %.preheader104.loopexit, %._crit_edge113
  %78 = phi i32 [ %76, %.preheader104.loopexit ], [ %66, %._crit_edge113 ]
  %79 = phi i32 [ %.pre198, %.preheader104.loopexit ], [ %65, %._crit_edge113 ]
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %.lr.ph128, label %.preheader103

.preheader100:                                    ; preds = %._crit_edge113, %.loopexit99
  %81 = phi i32 [ %76, %.loopexit99 ], [ %66, %._crit_edge113 ]
  %.088122 = phi i32 [ %.1.lcssa, %.loopexit99 ], [ 0, %._crit_edge113 ]
  %82 = sext i32 %.088122 to i64
  %83 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %82, i32 1
  %84 = icmp slt i32 %.088122, %81
  br i1 %84, label %.lr.ph115.preheader, label %.critedge

.lr.ph115.preheader:                              ; preds = %.preheader100
  %85 = load i64, ptr %83, align 8, !tbaa !19
  %86 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %82
  %87 = getelementptr inbounds i8, ptr %86, i64 8
  %88 = load i64, ptr %87, align 8, !tbaa !19
  %89 = icmp eq i64 %85, %88
  br i1 %89, label %.lr.ph218, label %.critedge.loopexit

.lr.ph115:                                        ; preds = %.lr.ph218
  %90 = load i64, ptr %83, align 8, !tbaa !19
  %91 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv.next165
  %92 = getelementptr inbounds i8, ptr %91, i64 8
  %93 = load i64, ptr %92, align 8, !tbaa !19
  %94 = icmp eq i64 %90, %93
  br i1 %94, label %.lr.ph218, label %.critedge.loopexit, !llvm.loop !20

.lr.ph218:                                        ; preds = %.lr.ph115.preheader, %.lr.ph115
  %95 = phi ptr [ %91, %.lr.ph115 ], [ %86, %.lr.ph115.preheader ]
  %indvars.iv164217 = phi i64 [ %indvars.iv.next165, %.lr.ph115 ], [ %82, %.lr.ph115.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %96 = getelementptr inbounds i8, ptr %95, i64 16
  %97 = load i32, ptr %96, align 8, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %98
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %100 = load i64, ptr %95, align 8, !tbaa !12
  %101 = trunc i64 %100 to i32
  store i32 %101, ptr %4, align 4, !tbaa !5
  %102 = call ptr @_ZNSt3setIiSt4lessIiESaIiEE11lower_boundERKi(ptr noundef nonnull align 8 dereferenceable(48) %99, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store ptr %102, ptr %3, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = add nsw i32 %104, -1
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %106) #8
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = call noundef i32 @_Z3sumi(i32 noundef %105)
  %110 = call noundef i32 @_Z3sumi(i32 noundef %108)
  %111 = sub nsw i32 %109, %110
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %111)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %indvars.iv.next165 = add nsw i64 %indvars.iv164217, 1
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = icmp slt i64 %indvars.iv.next165, %113
  br i1 %114, label %.lr.ph115, label %.critedge.loopexit, !llvm.loop !20

.critedge.loopexit:                               ; preds = %.lr.ph115, %.lr.ph218, %.lr.ph115.preheader
  %115 = phi i32 [ %81, %.lr.ph115.preheader ], [ %112, %.lr.ph218 ], [ %112, %.lr.ph115 ]
  %.089.lcssa.ph.in = phi i64 [ %82, %.lr.ph115.preheader ], [ %indvars.iv.next165, %.lr.ph218 ], [ %indvars.iv.next165, %.lr.ph115 ]
  %.089.lcssa.ph = trunc i64 %.089.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader100
  %116 = phi i32 [ %81, %.preheader100 ], [ %115, %.critedge.loopexit ]
  %.089.lcssa = phi i32 [ %.088122, %.preheader100 ], [ %.089.lcssa.ph, %.critedge.loopexit ]
  %117 = icmp slt i32 %.088122, %.089.lcssa
  br i1 %117, label %.lr.ph120, label %.loopexit99

.lr.ph120:                                        ; preds = %.critedge, %.lr.ph120
  %indvars.iv167 = phi i64 [ %indvars.iv.next168, %.lr.ph120 ], [ %82, %.critedge ]
  %118 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv167
  %119 = load i64, ptr %118, align 8, !tbaa !12
  %120 = trunc i64 %119 to i32
  call void @_Z3addii(i32 noundef %120, i32 noundef 1)
  %121 = getelementptr inbounds i8, ptr %118, i64 16
  %122 = load i32, ptr %121, align 8, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %123
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %125 = load i64, ptr %118, align 8, !tbaa !12
  %126 = trunc i64 %125 to i32
  store i32 %126, ptr %5, align 4, !tbaa !5
  %127 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %124, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  %indvars.iv.next168 = add nsw i64 %indvars.iv167, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next168 to i32
  %exitcond.not = icmp eq i32 %.089.lcssa, %lftr.wideiv
  br i1 %exitcond.not, label %.loopexit99.loopexit, label %.lr.ph120, !llvm.loop !21

.preheader103.loopexit:                           ; preds = %._crit_edge126
  %.pre199 = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader103

.preheader103:                                    ; preds = %.preheader103.loopexit, %.preheader104
  %128 = phi i32 [ %138, %.preheader103.loopexit ], [ %79, %.preheader104 ]
  %129 = phi i32 [ %.pre199, %.preheader103.loopexit ], [ %78, %.preheader104 ]
  %130 = add i32 %129, -1
  %131 = icmp sgt i32 %130, 0
  br i1 %131, label %.lr.ph130, label %.preheader102

.lr.ph128:                                        ; preds = %.preheader104, %._crit_edge126
  %indvars.iv171 = phi i64 [ %indvars.iv.next172, %._crit_edge126 ], [ 0, %.preheader104 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %132 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %indvars.iv171
  %133 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %132) #8
  store ptr %133, ptr %7, align 8
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  %135 = load i64, ptr %134, align 8, !tbaa !22
  store i64 %135, ptr %6, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %136 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %132) #8
  store ptr %136, ptr %8, align 8
  %137 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  br i1 %137, label %.lr.ph125, label %._crit_edge126

._crit_edge126:                                   ; preds = %.lr.ph125, %.lr.ph128
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  %indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
  %138 = load i32, ptr @m, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = icmp slt i64 %indvars.iv.next172, %139
  br i1 %140, label %.lr.ph128, label %.preheader103.loopexit, !llvm.loop !24

.lr.ph125:                                        ; preds = %.lr.ph128, %.lr.ph125
  %.094123 = phi i32 [ %142, %.lr.ph125 ], [ 0, %.lr.ph128 ]
  %141 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = add nsw i32 %142, -1
  %144 = call noundef i32 @_Z3sumi(i32 noundef %143)
  %145 = call noundef i32 @_Z3sumi(i32 noundef %.094123)
  %146 = sub nsw i32 %144, %145
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %146)
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %148 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %132) #8
  store ptr %148, ptr %8, align 8
  %149 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  br i1 %149, label %.lr.ph125, label %._crit_edge126, !llvm.loop !25

.preheader102.loopexit:                           ; preds = %.lr.ph130
  %.pre200 = load i32, ptr @m, align 4, !tbaa !5
  br label %.preheader102

.preheader102:                                    ; preds = %.preheader102.loopexit, %.preheader103
  %150 = phi i32 [ %157, %.preheader102.loopexit ], [ %129, %.preheader103 ]
  %151 = phi i32 [ %.pre200, %.preheader102.loopexit ], [ %128, %.preheader103 ]
  %152 = icmp sgt i32 %151, 0
  br i1 %152, label %.lr.ph132, label %._crit_edge133

.lr.ph130:                                        ; preds = %.preheader103, %.lr.ph130
  %indvars.iv175 = phi i64 [ %indvars.iv.next176, %.lr.ph130 ], [ 0, %.preheader103 ]
  %153 = phi i32 [ %159, %.lr.ph130 ], [ %130, %.preheader103 ]
  %154 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv175
  %155 = sext i32 %153 to i64
  %156 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %155
  call void @_ZSt4swapI5PointENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(24) %154, ptr noundef nonnull align 8 dereferenceable(24) %156) #8
  %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
  %157 = load i32, ptr @n, align 4, !tbaa !5
  %158 = trunc nuw nsw i64 %indvars.iv175 to i32
  %reass.sub = sub i32 %157, %158
  %159 = add i32 %reass.sub, -2
  %160 = sext i32 %159 to i64
  %161 = icmp slt i64 %indvars.iv.next176, %160
  br i1 %161, label %.lr.ph130, label %.preheader102.loopexit, !llvm.loop !26

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

._crit_edge133:                                   ; preds = %._crit_edge133.loopexit, %.preheader102
  %162 = phi i32 [ %170, %._crit_edge133.loopexit ], [ %151, %.preheader102 ]
  %163 = phi i32 [ %.pre201, %._crit_edge133.loopexit ], [ %150, %.preheader102 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800004) @bit, i8 0, i64 800004, i1 false)
  %164 = icmp sgt i32 %163, 0
  br i1 %164, label %.preheader, label %.preheader101

.lr.ph132:                                        ; preds = %.preheader102, %.lr.ph132
  %indvars.iv179 = phi i64 [ %indvars.iv.next180, %.lr.ph132 ], [ 0, %.preheader102 ]
  %165 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %indvars.iv179
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %165) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  %166 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %165, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  %167 = load i32, ptr @tot, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %10, align 4, !tbaa !5
  %169 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %165, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  %indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1
  %170 = load i32, ptr @m, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = icmp slt i64 %indvars.iv.next180, %171
  br i1 %172, label %.lr.ph132, label %._crit_edge133.loopexit, !llvm.loop !27

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

.loopexit:                                        ; preds = %.loopexit.loopexit, %.critedge2
  %173 = phi i32 [ %212, %.critedge2 ], [ %.pre202, %.loopexit.loopexit ]
  %.192.lcssa = phi i32 [ %.091142, %.critedge2 ], [ %.090.lcssa, %.loopexit.loopexit ]
  %174 = icmp slt i32 %.192.lcssa, %173
  br i1 %174, label %.preheader, label %.preheader101.loopexit, !llvm.loop !28

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

.preheader101:                                    ; preds = %.preheader101.loopexit, %._crit_edge133
  %175 = phi i32 [ %.pre203, %.preheader101.loopexit ], [ %162, %._crit_edge133 ]
  %176 = icmp sgt i32 %175, 0
  br i1 %176, label %.lr.ph148, label %._crit_edge149

.preheader:                                       ; preds = %._crit_edge133, %.loopexit
  %177 = phi i32 [ %173, %.loopexit ], [ %163, %._crit_edge133 ]
  %.091142 = phi i32 [ %.192.lcssa, %.loopexit ], [ 0, %._crit_edge133 ]
  %178 = sext i32 %.091142 to i64
  %179 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %178, i32 1
  %180 = icmp slt i32 %.091142, %177
  br i1 %180, label %.lr.ph135.preheader, label %.critedge2

.lr.ph135.preheader:                              ; preds = %.preheader
  %181 = load i64, ptr %179, align 8, !tbaa !19
  %182 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %178
  %183 = getelementptr inbounds i8, ptr %182, i64 8
  %184 = load i64, ptr %183, align 8, !tbaa !19
  %185 = icmp eq i64 %181, %184
  br i1 %185, label %.lr.ph223, label %.critedge2.loopexit

.lr.ph135:                                        ; preds = %.lr.ph223
  %186 = load i64, ptr %179, align 8, !tbaa !19
  %187 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv.next184
  %188 = getelementptr inbounds i8, ptr %187, i64 8
  %189 = load i64, ptr %188, align 8, !tbaa !19
  %190 = icmp eq i64 %186, %189
  br i1 %190, label %.lr.ph223, label %.critedge2.loopexit, !llvm.loop !29

.lr.ph223:                                        ; preds = %.lr.ph135.preheader, %.lr.ph135
  %191 = phi ptr [ %187, %.lr.ph135 ], [ %182, %.lr.ph135.preheader ]
  %indvars.iv183222 = phi i64 [ %indvars.iv.next184, %.lr.ph135 ], [ %178, %.lr.ph135.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  %192 = getelementptr inbounds i8, ptr %191, i64 16
  %193 = load i32, ptr %192, align 8, !tbaa !9
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %194
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  %196 = load i64, ptr %191, align 8, !tbaa !12
  %197 = trunc i64 %196 to i32
  store i32 %197, ptr %12, align 4, !tbaa !5
  %198 = call ptr @_ZNSt3setIiSt4lessIiESaIiEE11lower_boundERKi(ptr noundef nonnull align 8 dereferenceable(48) %195, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store ptr %198, ptr %11, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  %199 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = add nsw i32 %200, -1
  %202 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  %203 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %202) #8
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %205 = call noundef i32 @_Z3sumi(i32 noundef %201)
  %206 = call noundef i32 @_Z3sumi(i32 noundef %204)
  %207 = sub nsw i32 %205, %206
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %207)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  %indvars.iv.next184 = add nsw i64 %indvars.iv183222, 1
  %208 = load i32, ptr @n, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = icmp slt i64 %indvars.iv.next184, %209
  br i1 %210, label %.lr.ph135, label %.critedge2.loopexit, !llvm.loop !29

.critedge2.loopexit:                              ; preds = %.lr.ph135, %.lr.ph223, %.lr.ph135.preheader
  %211 = phi i32 [ %177, %.lr.ph135.preheader ], [ %208, %.lr.ph223 ], [ %208, %.lr.ph135 ]
  %.090.lcssa.ph.in = phi i64 [ %178, %.lr.ph135.preheader ], [ %indvars.iv.next184, %.lr.ph223 ], [ %indvars.iv.next184, %.lr.ph135 ]
  %.090.lcssa.ph = trunc i64 %.090.lcssa.ph.in to i32
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge2.loopexit, %.preheader
  %212 = phi i32 [ %177, %.preheader ], [ %211, %.critedge2.loopexit ]
  %.090.lcssa = phi i32 [ %.091142, %.preheader ], [ %.090.lcssa.ph, %.critedge2.loopexit ]
  %213 = icmp slt i32 %.091142, %.090.lcssa
  br i1 %213, label %.lr.ph140, label %.loopexit

.lr.ph140:                                        ; preds = %.critedge2, %.lr.ph140
  %indvars.iv187 = phi i64 [ %indvars.iv.next188, %.lr.ph140 ], [ %178, %.critedge2 ]
  %214 = getelementptr inbounds [200001 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv187
  %215 = load i64, ptr %214, align 8, !tbaa !12
  %216 = trunc i64 %215 to i32
  call void @_Z3addii(i32 noundef %216, i32 noundef 1)
  %217 = getelementptr inbounds i8, ptr %214, i64 16
  %218 = load i32, ptr %217, align 8, !tbaa !9
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %219
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  %221 = load i64, ptr %214, align 8, !tbaa !12
  %222 = trunc i64 %221 to i32
  store i32 %222, ptr %13, align 4, !tbaa !5
  %223 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %220, ptr noundef nonnull align 4 dereferenceable(4) %13)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  %indvars.iv.next188 = add nsw i64 %indvars.iv187, 1
  %lftr.wideiv191 = trunc i64 %indvars.iv.next188 to i32
  %exitcond192.not = icmp eq i32 %.090.lcssa, %lftr.wideiv191
  br i1 %exitcond192.not, label %.loopexit.loopexit, label %.lr.ph140, !llvm.loop !30

._crit_edge149:                                   ; preds = %._crit_edge146, %.preheader101
  %224 = load i32, ptr @ans, align 4, !tbaa !5
  %225 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %224)
  %226 = load i32, ptr @t, align 4, !tbaa !5
  %227 = add nsw i32 %226, -1
  store i32 %227, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %226, 0
  br i1 %.not, label %._crit_edge153, label %.lr.ph152, !llvm.loop !31

.lr.ph148:                                        ; preds = %.preheader101, %._crit_edge146
  %indvars.iv193 = phi i64 [ %indvars.iv.next194, %._crit_edge146 ], [ 0, %.preheader101 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  %228 = getelementptr inbounds [200001 x %"class.std::set"], ptr @pp, i64 0, i64 %indvars.iv193
  %229 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %228) #8
  store ptr %229, ptr %15, align 8
  %230 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #8
  %231 = load i64, ptr %230, align 8, !tbaa !22
  store i64 %231, ptr %14, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  %232 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %228) #8
  store ptr %232, ptr %16, align 8
  %233 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  br i1 %233, label %.lr.ph145, label %._crit_edge146

._crit_edge146:                                   ; preds = %.lr.ph145, %.lr.ph148
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  %indvars.iv.next194 = add nuw nsw i64 %indvars.iv193, 1
  %234 = load i32, ptr @m, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = icmp slt i64 %indvars.iv.next194, %235
  br i1 %236, label %.lr.ph148, label %._crit_edge149, !llvm.loop !32

.lr.ph145:                                        ; preds = %.lr.ph148, %.lr.ph145
  %.084143 = phi i32 [ %238, %.lr.ph145 ], [ 0, %.lr.ph148 ]
  %237 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = add nsw i32 %238, -1
  %240 = call noundef i32 @_Z3sumi(i32 noundef %239)
  %241 = call noundef i32 @_Z3sumi(i32 noundef %.084143)
  %242 = sub nsw i32 %240, %241
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %242)
  %243 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  %244 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %228) #8
  store ptr %244, ptr %16, align 8
  %245 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  br i1 %245, label %.lr.ph145, label %._crit_edge146, !llvm.loop !33

._crit_edge153:                                   ; preds = %._crit_edge149, %0
  ret i32 0
}

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

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

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

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

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

; 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 #5 align 2

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

; 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 #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 #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 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapI5PointENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #7

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


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