; LLVM IR from tangjz/acm-icpc :: hdu (5539)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.ToSort = type { i32, i64, i64 }
%struct.Point = type { i32, i32 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@col = external dso_local global [1002001 x i32], align 16
@tot = external dso_local global i32, align 4
@e = external dso_local global [1002001 x %"class.std::vector"], align 16
@que = external dso_local global [1001 x %struct.ToSort], align 16
@pl = external dso_local global [1001 x [2 x %struct.Point]], align 16
@tr = external dso_local global %struct.Point, align 4
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5checkii(i32 noundef, 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6color1v() #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3idxii(i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6color2v() #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.Point, align 4
  %6 = alloca %struct.Point, align 4
  %7 = alloca %struct.Point, align 4
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.Point, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.Point, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca %struct.Point, align 4
  %23 = alloca %struct.Point, align 4
  %24 = alloca i64, align 8
  %25 = alloca %struct.Point, align 4
  %26 = alloca %struct.Point, align 4
  %27 = alloca i64, align 8
  %28 = alloca %struct.ToSort, align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @t)
  br label %38

38:                                               ; preds = %491, %443, %0
  %39 = load i32, ptr @t, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr @t, align 4, !tbaa !5
  %41 = icmp ne i32 %39, 0
  br i1 %41, label %42, label %492

42:                                               ; preds = %38
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %72, %42
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %75

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

49:                                               ; preds = %68, %48
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = icmp slt i32 %50, 2
  br i1 %51, label %53, label %52

52:                                               ; preds = %49
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %71

53:                                               ; preds = %49
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %55
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [2 x %struct.Point], ptr %56, i64 0, i64 %58
  %60 = getelementptr inbounds %struct.Point, ptr %59, i32 0, i32 0
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %60)
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %62
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [2 x %struct.Point], ptr %63, i64 0, i64 %65
  %67 = getelementptr inbounds %struct.Point, ptr %66, i32 0, i32 1
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %67)
  br label %68

68:                                               ; preds = %53
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %4, align 4, !tbaa !5
  br label %49, !llvm.loop !9

71:                                               ; preds = %52
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %2, align 4, !tbaa !5
  br label %43, !llvm.loop !11

75:                                               ; preds = %47
  %76 = call noundef zeroext i1 @_Z5checkii(i32 noundef 0, i32 noundef 1)
  br i1 %76, label %77, label %80

77:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %78 = getelementptr inbounds %struct.Point, ptr %5, i32 0, i32 0
  store i32 0, ptr %78, align 4, !tbaa !12
  %79 = getelementptr inbounds %struct.Point, ptr %5, i32 0, i32 1
  store i32 1, ptr %79, align 4, !tbaa !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @tr, ptr align 4 %5, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %139

80:                                               ; preds = %75
  %81 = call noundef zeroext i1 @_Z5checkii(i32 noundef 1, i32 noundef 0)
  br i1 %81, label %82, label %85

82:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %83 = getelementptr inbounds %struct.Point, ptr %6, i32 0, i32 0
  store i32 1, ptr %83, align 4, !tbaa !12
  %84 = getelementptr inbounds %struct.Point, ptr %6, i32 0, i32 1
  store i32 0, ptr %84, align 4, !tbaa !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @tr, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %138

85:                                               ; preds = %80
  %86 = call noundef zeroext i1 @_Z5checkii(i32 noundef 1, i32 noundef 1)
  br i1 %86, label %87, label %90

87:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %88 = getelementptr inbounds %struct.Point, ptr %7, i32 0, i32 0
  store i32 1, ptr %88, align 4, !tbaa !12
  %89 = getelementptr inbounds %struct.Point, ptr %7, i32 0, i32 1
  store i32 1, ptr %89, align 4, !tbaa !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @tr, ptr align 4 %7, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %137

90:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #8
  store i8 0, ptr %8, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %133, %90
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = icmp slt i32 %92, 50
  br i1 %93, label %94, label %98

94:                                               ; preds = %91
  %95 = load i8, ptr %8, align 1, !tbaa !16, !range !18, !noundef !19
  %96 = trunc i8 %95 to i1
  %97 = xor i1 %96, true
  br label %98

98:                                               ; preds = %94, %91
  %99 = phi i1 [ false, %91 ], [ %97, %94 ]
  br i1 %99, label %101, label %100

100:                                              ; preds = %98
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %136

101:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %10, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %129, %101
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = icmp slt i32 %105, 50
  br i1 %106, label %107, label %111

107:                                              ; preds = %104
  %108 = load i8, ptr %8, align 1, !tbaa !16, !range !18, !noundef !19
  %109 = trunc i8 %108 to i1
  %110 = xor i1 %109, true
  br label %111

111:                                              ; preds = %107, %104
  %112 = phi i1 [ false, %104 ], [ %110, %107 ]
  br i1 %112, label %114, label %113

113:                                              ; preds = %111
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %132

114:                                              ; preds = %111
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = call noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef %115, i32 noundef %116)
  %118 = icmp eq i32 %117, 1
  br i1 %118, label %119, label %128

119:                                              ; preds = %114
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = call noundef zeroext i1 @_Z5checkii(i32 noundef %120, i32 noundef %121)
  br i1 %122, label %123, label %128

123:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %124 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 0
  %125 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %125, ptr %124, align 4, !tbaa !12
  %126 = getelementptr inbounds %struct.Point, ptr %11, i32 0, i32 1
  %127 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %127, ptr %126, align 4, !tbaa !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @tr, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  store i8 1, ptr %8, align 1, !tbaa !16
  br label %128

128:                                              ; preds = %123, %119, %114
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %10, align 4, !tbaa !5
  br label %104, !llvm.loop !20

132:                                              ; preds = %113
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %9, align 4, !tbaa !5
  br label %91, !llvm.loop !21

136:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #8
  br label %137

137:                                              ; preds = %136, %87
  br label %138

138:                                              ; preds = %137, %82
  br label %139

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

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

144:                                              ; preds = %140
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %207

145:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %177, %145
  %147 = load i32, ptr %13, align 4, !tbaa !5
  %148 = icmp slt i32 %147, 2
  br i1 %148, label %150, label %149

149:                                              ; preds = %146
  store i32 19, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %180

150:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %151 = load i32, ptr %12, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %152
  %154 = load i32, ptr %13, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [2 x %struct.Point], ptr %153, i64 0, i64 %155
  %157 = call noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %156, ptr noundef nonnull align 4 dereferenceable(8) @tr)
  %158 = trunc i64 %157 to i32
  store i32 %158, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %159 = load i32, ptr %12, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %160
  %162 = load i32, ptr %13, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [2 x %struct.Point], ptr %161, i64 0, i64 %163
  %165 = call noundef i64 @_ZNK5Point3dotERKS_(ptr noundef nonnull align 4 dereferenceable(8) %164, ptr noundef nonnull align 4 dereferenceable(8) @tr)
  %166 = trunc i64 %165 to i32
  store i32 %166, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %167 = getelementptr inbounds %struct.Point, ptr %16, i32 0, i32 0
  %168 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %168, ptr %167, align 4, !tbaa !12
  %169 = getelementptr inbounds %struct.Point, ptr %16, i32 0, i32 1
  %170 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %170, ptr %169, align 4, !tbaa !14
  %171 = load i32, ptr %12, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %172
  %174 = load i32, ptr %13, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [2 x %struct.Point], ptr %173, i64 0, i64 %175
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %176, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %177

177:                                              ; preds = %150
  %178 = load i32, ptr %13, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %13, align 4, !tbaa !5
  br label %146, !llvm.loop !22

180:                                              ; preds = %149
  %181 = load i32, ptr %12, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %182
  %184 = getelementptr inbounds [2 x %struct.Point], ptr %183, i64 0, i64 0
  %185 = getelementptr inbounds %struct.Point, ptr %184, i32 0, i32 0
  %186 = load i32, ptr %185, align 16, !tbaa !12
  %187 = load i32, ptr %12, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %188
  %190 = getelementptr inbounds [2 x %struct.Point], ptr %189, i64 0, i64 1
  %191 = getelementptr inbounds %struct.Point, ptr %190, i32 0, i32 0
  %192 = load i32, ptr %191, align 8, !tbaa !12
  %193 = icmp sgt i32 %186, %192
  br i1 %193, label %194, label %203

194:                                              ; preds = %180
  %195 = load i32, ptr %12, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %196
  %198 = getelementptr inbounds [2 x %struct.Point], ptr %197, i64 0, i64 0
  %199 = load i32, ptr %12, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %200
  %202 = getelementptr inbounds [2 x %struct.Point], ptr %201, i64 0, i64 1
  call void @_ZSt4swapI5PointENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 4 dereferenceable(8) %198, ptr noundef nonnull align 4 dereferenceable(8) %202) #8
  br label %203

203:                                              ; preds = %194, %180
  br label %204

204:                                              ; preds = %203
  %205 = load i32, ptr %12, align 4, !tbaa !5
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %12, align 4, !tbaa !5
  br label %140, !llvm.loop !23

207:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %208

208:                                              ; preds = %231, %207
  %209 = load i32, ptr %17, align 4, !tbaa !5
  %210 = load i32, ptr @n, align 4, !tbaa !5
  %211 = icmp slt i32 %209, %210
  br i1 %211, label %213, label %212

212:                                              ; preds = %208
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %234

213:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %214 = load i32, ptr %17, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %18, align 4, !tbaa !5
  br label %216

216:                                              ; preds = %227, %213
  %217 = load i32, ptr %18, align 4, !tbaa !5
  %218 = load i32, ptr @n, align 4, !tbaa !5
  %219 = icmp slt i32 %217, %218
  br i1 %219, label %221, label %220

220:                                              ; preds = %216
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %230

221:                                              ; preds = %216
  %222 = load i32, ptr %17, align 4, !tbaa !5
  %223 = load i32, ptr %18, align 4, !tbaa !5
  %224 = call noundef i32 @_Z3idxii(i32 noundef %222, i32 noundef %223)
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [1002001 x %"class.std::vector"], ptr @e, i64 0, i64 %225
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %226) #8
  br label %227

227:                                              ; preds = %221
  %228 = load i32, ptr %18, align 4, !tbaa !5
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %18, align 4, !tbaa !5
  br label %216, !llvm.loop !24

230:                                              ; preds = %220
  br label %231

231:                                              ; preds = %230
  %232 = load i32, ptr %17, align 4, !tbaa !5
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %17, align 4, !tbaa !5
  br label %208, !llvm.loop !25

234:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %235

235:                                              ; preds = %363, %234
  %236 = load i32, ptr %19, align 4, !tbaa !5
  %237 = load i32, ptr @n, align 4, !tbaa !5
  %238 = icmp slt i32 %236, %237
  br i1 %238, label %240, label %239

239:                                              ; preds = %235
  store i32 28, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %366

240:                                              ; preds = %235
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %329, %240
  %242 = load i32, ptr %20, align 4, !tbaa !5
  %243 = load i32, ptr @n, align 4, !tbaa !5
  %244 = icmp slt i32 %242, %243
  br i1 %244, label %246, label %245

245:                                              ; preds = %241
  store i32 31, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %332

246:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %247 = load i32, ptr %19, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %248
  %250 = getelementptr inbounds [2 x %struct.Point], ptr %249, i64 0, i64 0
  %251 = load i32, ptr %19, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %252
  %254 = getelementptr inbounds [2 x %struct.Point], ptr %253, i64 0, i64 1
  %255 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %250, ptr noundef nonnull align 4 dereferenceable(8) %254)
  store i64 %255, ptr %22, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %256 = load i32, ptr %20, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %257
  %259 = getelementptr inbounds [2 x %struct.Point], ptr %258, i64 0, i64 0
  %260 = load i32, ptr %20, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %261
  %263 = getelementptr inbounds [2 x %struct.Point], ptr %262, i64 0, i64 1
  %264 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %259, ptr noundef nonnull align 4 dereferenceable(8) %263)
  store i64 %264, ptr %23, align 4
  %265 = call noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %22, ptr noundef nonnull align 4 dereferenceable(8) %23)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  store i64 %265, ptr %21, align 8, !tbaa !26
  %266 = load i64, ptr %21, align 8, !tbaa !26
  %267 = icmp ne i64 %266, 0
  br i1 %267, label %274, label %268

268:                                              ; preds = %246
  %269 = load i32, ptr %19, align 4, !tbaa !5
  %270 = load i32, ptr %20, align 4, !tbaa !5
  %271 = call noundef i32 @_Z3idxii(i32 noundef %269, i32 noundef %270)
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [1002001 x i32], ptr @col, i64 0, i64 %272
  store i32 -1, ptr %273, align 4, !tbaa !5
  store i32 33, ptr %3, align 4
  br label %326

274:                                              ; preds = %246
  %275 = load i32, ptr %19, align 4, !tbaa !5
  %276 = load i32, ptr %20, align 4, !tbaa !5
  %277 = call noundef i32 @_Z3idxii(i32 noundef %275, i32 noundef %276)
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [1002001 x i32], ptr @col, i64 0, i64 %278
  store i32 0, ptr %279, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %280 = load i32, ptr %20, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %281
  %283 = getelementptr inbounds [2 x %struct.Point], ptr %282, i64 0, i64 0
  %284 = load i32, ptr %20, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %285
  %287 = getelementptr inbounds [2 x %struct.Point], ptr %286, i64 0, i64 1
  %288 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %283, ptr noundef nonnull align 4 dereferenceable(8) %287)
  store i64 %288, ptr %25, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %289 = load i32, ptr %19, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %290
  %292 = getelementptr inbounds [2 x %struct.Point], ptr %291, i64 0, i64 1
  %293 = load i32, ptr %20, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %294
  %296 = getelementptr inbounds [2 x %struct.Point], ptr %295, i64 0, i64 1
  %297 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %292, ptr noundef nonnull align 4 dereferenceable(8) %296)
  store i64 %297, ptr %26, align 4
  %298 = call noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %25, ptr noundef nonnull align 4 dereferenceable(8) %26)
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  store i64 %298, ptr %24, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %299 = load i64, ptr %24, align 8, !tbaa !26
  %300 = load i64, ptr %21, align 8, !tbaa !26
  %301 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %299, i64 noundef %300)
  store i64 %301, ptr %27, align 8, !tbaa !26
  %302 = load i64, ptr %27, align 8, !tbaa !26
  %303 = load i64, ptr %24, align 8, !tbaa !26
  %304 = sdiv i64 %303, %302
  store i64 %304, ptr %24, align 8, !tbaa !26
  %305 = load i64, ptr %27, align 8, !tbaa !26
  %306 = load i64, ptr %21, align 8, !tbaa !26
  %307 = sdiv i64 %306, %305
  store i64 %307, ptr %21, align 8, !tbaa !26
  %308 = load i64, ptr %21, align 8, !tbaa !26
  %309 = icmp slt i64 %308, 0
  br i1 %309, label %310, label %315

310:                                              ; preds = %274
  %311 = load i64, ptr %24, align 8, !tbaa !26
  %312 = sub nsw i64 0, %311
  store i64 %312, ptr %24, align 8, !tbaa !26
  %313 = load i64, ptr %21, align 8, !tbaa !26
  %314 = sub nsw i64 0, %313
  store i64 %314, ptr %21, align 8, !tbaa !26
  br label %315

315:                                              ; preds = %310, %274
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #8
  %316 = getelementptr inbounds %struct.ToSort, ptr %28, i32 0, i32 0
  %317 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %317, ptr %316, align 8, !tbaa !28
  %318 = getelementptr inbounds %struct.ToSort, ptr %28, i32 0, i32 1
  %319 = load i64, ptr %24, align 8, !tbaa !26
  store i64 %319, ptr %318, align 8, !tbaa !30
  %320 = getelementptr inbounds %struct.ToSort, ptr %28, i32 0, i32 2
  %321 = load i64, ptr %21, align 8, !tbaa !26
  store i64 %321, ptr %320, align 8, !tbaa !31
  %322 = load i32, ptr @tot, align 4, !tbaa !5
  %323 = add nsw i32 %322, 1
  store i32 %323, ptr @tot, align 4, !tbaa !5
  %324 = sext i32 %322 to i64
  %325 = getelementptr inbounds [1001 x %struct.ToSort], ptr @que, i64 0, i64 %324
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %325, ptr align 8 %28, i64 24, i1 false), !tbaa.struct !32
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  store i32 0, ptr %3, align 4
  br label %326

326:                                              ; preds = %315, %268
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  %327 = load i32, ptr %3, align 4
  switch i32 %327, label %493 [
    i32 0, label %328
    i32 33, label %329
  ]

328:                                              ; preds = %326
  br label %329

329:                                              ; preds = %328, %326
  %330 = load i32, ptr %20, align 4, !tbaa !5
  %331 = add nsw i32 %330, 1
  store i32 %331, ptr %20, align 4, !tbaa !5
  br label %241, !llvm.loop !33

332:                                              ; preds = %245
  %333 = load i32, ptr @tot, align 4, !tbaa !5
  %334 = sext i32 %333 to i64
  %335 = getelementptr inbounds %struct.ToSort, ptr @que, i64 %334
  call void @_ZSt4sortIP6ToSortEvT_S2_(ptr noundef @que, ptr noundef %335)
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 1, ptr %29, align 4, !tbaa !5
  br label %336

336:                                              ; preds = %359, %332
  %337 = load i32, ptr %29, align 4, !tbaa !5
  %338 = load i32, ptr @tot, align 4, !tbaa !5
  %339 = icmp slt i32 %337, %338
  br i1 %339, label %341, label %340

340:                                              ; preds = %336
  store i32 34, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %362

341:                                              ; preds = %336
  %342 = load i32, ptr %19, align 4, !tbaa !5
  %343 = load i32, ptr %29, align 4, !tbaa !5
  %344 = sub nsw i32 %343, 1
  %345 = sext i32 %344 to i64
  %346 = getelementptr inbounds [1001 x %struct.ToSort], ptr @que, i64 0, i64 %345
  %347 = getelementptr inbounds %struct.ToSort, ptr %346, i32 0, i32 0
  %348 = load i32, ptr %347, align 8, !tbaa !28
  %349 = call noundef i32 @_Z3idxii(i32 noundef %342, i32 noundef %348)
  %350 = sext i32 %349 to i64
  %351 = getelementptr inbounds [1002001 x %"class.std::vector"], ptr @e, i64 0, i64 %350
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  %352 = load i32, ptr %19, align 4, !tbaa !5
  %353 = load i32, ptr %29, align 4, !tbaa !5
  %354 = sext i32 %353 to i64
  %355 = getelementptr inbounds [1001 x %struct.ToSort], ptr @que, i64 0, i64 %354
  %356 = getelementptr inbounds %struct.ToSort, ptr %355, i32 0, i32 0
  %357 = load i32, ptr %356, align 8, !tbaa !28
  %358 = call noundef i32 @_Z3idxii(i32 noundef %352, i32 noundef %357)
  store i32 %358, ptr %30, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %351, ptr noundef nonnull align 4 dereferenceable(4) %30)
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  br label %359

359:                                              ; preds = %341
  %360 = load i32, ptr %29, align 4, !tbaa !5
  %361 = add nsw i32 %360, 1
  store i32 %361, ptr %29, align 4, !tbaa !5
  br label %336, !llvm.loop !34

362:                                              ; preds = %340
  br label %363

363:                                              ; preds = %362
  %364 = load i32, ptr %19, align 4, !tbaa !5
  %365 = add nsw i32 %364, 1
  store i32 %365, ptr %19, align 4, !tbaa !5
  br label %235, !llvm.loop !35

366:                                              ; preds = %239
  %367 = call noundef zeroext i1 @_Z6color1v()
  br i1 %367, label %368, label %405

368:                                              ; preds = %366
  %369 = call i32 @puts(ptr noundef @.str)
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  store i32 0, ptr %31, align 4, !tbaa !5
  br label %370

370:                                              ; preds = %401, %368
  %371 = load i32, ptr %31, align 4, !tbaa !5
  %372 = load i32, ptr @n, align 4, !tbaa !5
  %373 = icmp slt i32 %371, %372
  br i1 %373, label %375, label %374

374:                                              ; preds = %370
  store i32 37, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %404

375:                                              ; preds = %370
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  %376 = load i32, ptr %31, align 4, !tbaa !5
  %377 = add nsw i32 %376, 1
  store i32 %377, ptr %32, align 4, !tbaa !5
  br label %378

378:                                              ; preds = %397, %375
  %379 = load i32, ptr %32, align 4, !tbaa !5
  %380 = load i32, ptr @n, align 4, !tbaa !5
  %381 = icmp slt i32 %379, %380
  br i1 %381, label %383, label %382

382:                                              ; preds = %378
  store i32 40, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  br label %400

383:                                              ; preds = %378
  %384 = load i32, ptr %31, align 4, !tbaa !5
  %385 = load i32, ptr %32, align 4, !tbaa !5
  %386 = call noundef i32 @_Z3idxii(i32 noundef %384, i32 noundef %385)
  %387 = sext i32 %386 to i64
  %388 = getelementptr inbounds [1002001 x i32], ptr @col, i64 0, i64 %387
  %389 = load i32, ptr %388, align 4, !tbaa !5
  %390 = load i32, ptr %32, align 4, !tbaa !5
  %391 = load i32, ptr @n, align 4, !tbaa !5
  %392 = sub nsw i32 %391, 1
  %393 = icmp eq i32 %390, %392
  %394 = zext i1 %393 to i64
  %395 = getelementptr inbounds [3 x i8], ptr @.str.1, i64 0, i64 %394
  %396 = load i8, ptr %395, align 1, !tbaa !36
  call void @_Z5printIiEvT_c(i32 noundef %389, i8 noundef signext %396)
  br label %397

397:                                              ; preds = %383
  %398 = load i32, ptr %32, align 4, !tbaa !5
  %399 = add nsw i32 %398, 1
  store i32 %399, ptr %32, align 4, !tbaa !5
  br label %378, !llvm.loop !37

400:                                              ; preds = %382
  br label %401

401:                                              ; preds = %400
  %402 = load i32, ptr %31, align 4, !tbaa !5
  %403 = add nsw i32 %402, 1
  store i32 %403, ptr %31, align 4, !tbaa !5
  br label %370, !llvm.loop !38

404:                                              ; preds = %374
  br label %491

405:                                              ; preds = %366
  %406 = call noundef zeroext i1 @_Z6color2v()
  br i1 %406, label %407, label %444

407:                                              ; preds = %405
  %408 = call i32 @puts(ptr noundef @.str.2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %409

409:                                              ; preds = %440, %407
  %410 = load i32, ptr %33, align 4, !tbaa !5
  %411 = load i32, ptr @n, align 4, !tbaa !5
  %412 = icmp slt i32 %410, %411
  br i1 %412, label %414, label %413

413:                                              ; preds = %409
  store i32 43, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  br label %443

414:                                              ; preds = %409
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  %415 = load i32, ptr %33, align 4, !tbaa !5
  %416 = add nsw i32 %415, 1
  store i32 %416, ptr %34, align 4, !tbaa !5
  br label %417

417:                                              ; preds = %436, %414
  %418 = load i32, ptr %34, align 4, !tbaa !5
  %419 = load i32, ptr @n, align 4, !tbaa !5
  %420 = icmp slt i32 %418, %419
  br i1 %420, label %422, label %421

421:                                              ; preds = %417
  store i32 46, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %439

422:                                              ; preds = %417
  %423 = load i32, ptr %33, align 4, !tbaa !5
  %424 = load i32, ptr %34, align 4, !tbaa !5
  %425 = call noundef i32 @_Z3idxii(i32 noundef %423, i32 noundef %424)
  %426 = sext i32 %425 to i64
  %427 = getelementptr inbounds [1002001 x i32], ptr @col, i64 0, i64 %426
  %428 = load i32, ptr %427, align 4, !tbaa !5
  %429 = load i32, ptr %34, align 4, !tbaa !5
  %430 = load i32, ptr @n, align 4, !tbaa !5
  %431 = sub nsw i32 %430, 1
  %432 = icmp eq i32 %429, %431
  %433 = zext i1 %432 to i64
  %434 = getelementptr inbounds [3 x i8], ptr @.str.1, i64 0, i64 %433
  %435 = load i8, ptr %434, align 1, !tbaa !36
  call void @_Z5printIiEvT_c(i32 noundef %428, i8 noundef signext %435)
  br label %436

436:                                              ; preds = %422
  %437 = load i32, ptr %34, align 4, !tbaa !5
  %438 = add nsw i32 %437, 1
  store i32 %438, ptr %34, align 4, !tbaa !5
  br label %417, !llvm.loop !39

439:                                              ; preds = %421
  br label %440

440:                                              ; preds = %439
  %441 = load i32, ptr %33, align 4, !tbaa !5
  %442 = add nsw i32 %441, 1
  store i32 %442, ptr %33, align 4, !tbaa !5
  br label %409, !llvm.loop !40

443:                                              ; preds = %413
  br label %38, !llvm.loop !41

444:                                              ; preds = %405
  %445 = call i32 @puts(ptr noundef @.str.3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  store i32 0, ptr %35, align 4, !tbaa !5
  br label %446

446:                                              ; preds = %486, %444
  %447 = load i32, ptr %35, align 4, !tbaa !5
  %448 = load i32, ptr @n, align 4, !tbaa !5
  %449 = icmp slt i32 %447, %448
  br i1 %449, label %451, label %450

450:                                              ; preds = %446
  store i32 49, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  br label %489

451:                                              ; preds = %446
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %452 = load i32, ptr %35, align 4, !tbaa !5
  %453 = add nsw i32 %452, 1
  store i32 %453, ptr %36, align 4, !tbaa !5
  br label %454

454:                                              ; preds = %482, %451
  %455 = load i32, ptr %36, align 4, !tbaa !5
  %456 = load i32, ptr @n, align 4, !tbaa !5
  %457 = icmp slt i32 %455, %456
  br i1 %457, label %459, label %458

458:                                              ; preds = %454
  store i32 52, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  br label %485

459:                                              ; preds = %454
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  %460 = load i32, ptr %35, align 4, !tbaa !5
  %461 = load i32, ptr %36, align 4, !tbaa !5
  %462 = call noundef i32 @_Z3idxii(i32 noundef %460, i32 noundef %461)
  store i32 %462, ptr %37, align 4, !tbaa !5
  %463 = load i32, ptr %37, align 4, !tbaa !5
  %464 = sext i32 %463 to i64
  %465 = getelementptr inbounds [1002001 x i32], ptr @col, i64 0, i64 %464
  %466 = load i32, ptr %465, align 4, !tbaa !5
  %467 = icmp ne i32 %466, 0
  br i1 %467, label %470, label %468

468:                                              ; preds = %459
  %469 = load i32, ptr %37, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %469)
  br label %470

470:                                              ; preds = %468, %459
  %471 = load i32, ptr %37, align 4, !tbaa !5
  %472 = sext i32 %471 to i64
  %473 = getelementptr inbounds [1002001 x i32], ptr @col, i64 0, i64 %472
  %474 = load i32, ptr %473, align 4, !tbaa !5
  %475 = load i32, ptr %36, align 4, !tbaa !5
  %476 = load i32, ptr @n, align 4, !tbaa !5
  %477 = sub nsw i32 %476, 1
  %478 = icmp eq i32 %475, %477
  %479 = zext i1 %478 to i64
  %480 = getelementptr inbounds [3 x i8], ptr @.str.1, i64 0, i64 %479
  %481 = load i8, ptr %480, align 1, !tbaa !36
  call void @_Z5printIiEvT_c(i32 noundef %474, i8 noundef signext %481)
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  br label %482

482:                                              ; preds = %470
  %483 = load i32, ptr %36, align 4, !tbaa !5
  %484 = add nsw i32 %483, 1
  store i32 %484, ptr %36, align 4, !tbaa !5
  br label %454, !llvm.loop !42

485:                                              ; preds = %458
  br label %486

486:                                              ; preds = %485
  %487 = load i32, ptr %35, align 4, !tbaa !5
  %488 = add nsw i32 %487, 1
  store i32 %488, ptr %35, align 4, !tbaa !5
  br label %446, !llvm.loop !43

489:                                              ; preds = %450
  br label %490

490:                                              ; preds = %489
  br label %491

491:                                              ; preds = %490, %404
  br label %38, !llvm.loop !41

492:                                              ; preds = %38
  ret i32 0

493:                                              ; preds = %326
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef, i32 noundef) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef, i64 noundef) #2

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

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

declare i32 @puts(ptr noundef) #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z5printIiEvT_c(i32 noundef, i8 noundef signext) #5

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTS5Point", !6, i64 0, !6, i64 4}
!14 = !{!13, !6, i64 4}
!15 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = !{!27, !27, i64 0}
!27 = !{!"long long", !7, i64 0}
!28 = !{!29, !6, i64 0}
!29 = !{!"_ZTS6ToSort", !6, i64 0, !27, i64 8, !27, i64 16}
!30 = !{!29, !27, i64 8}
!31 = !{!29, !27, i64 16}
!32 = !{i64 0, i64 4, !5, i64 8, i64 8, !26, i64 16, i64 8, !26}
!33 = distinct !{!33, !10}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !10}
!36 = !{!7, !7, i64 0}
!37 = distinct !{!37, !10}
!38 = distinct !{!38, !10}
!39 = distinct !{!39, !10}
!40 = distinct !{!40, !10}
!41 = distinct !{!41, !10}
!42 = distinct !{!42, !10}
!43 = distinct !{!43, !10}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.ToSort = type { i32, i64, i64 }
%struct.Point = type { i32, i32 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@col = external dso_local local_unnamed_addr global [1002001 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@e = external dso_local global [1002001 x %"class.std::vector"], align 16
@que = external dso_local global [1001 x %struct.ToSort], align 16
@pl = external dso_local global [1001 x [2 x %struct.Point]], align 16
@tr = external dso_local global %struct.Point, align 4
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5checkii(i32 noundef, 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 nounwind uwtable
declare dso_local noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6color1v() local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3idxii(i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6color2v() local_unnamed_addr #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca %struct.Point, align 8
  %2 = alloca %struct.Point, align 8
  %3 = alloca %struct.Point, align 8
  %4 = alloca %struct.Point, align 8
  %5 = alloca i32, align 4
  tail call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @t)
  %6 = load i32, ptr @t, align 4, !tbaa !5
  %7 = add nsw i32 %6, -1
  store i32 %7, ptr @t, align 4, !tbaa !5
  %.not201 = icmp eq i32 %6, 0
  br i1 %.not201, label %._crit_edge204, label %.lr.ph203

.lr.ph203:                                        ; preds = %0, %.backedge
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @n)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.preheader149, label %._crit_edge

.preheader149:                                    ; preds = %.lr.ph203, %.preheader149
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader149 ], [ 0, %.lr.ph203 ]
  %10 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %indvars.iv, i64 0
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %10)
  %11 = getelementptr inbounds i8, ptr %10, i64 4
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %11)
  %12 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %indvars.iv, i64 1
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %12)
  %13 = getelementptr inbounds i8, ptr %12, i64 4
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = icmp slt i64 %indvars.iv.next, %15
  br i1 %16, label %.preheader149, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.preheader149, %.lr.ph203
  %17 = call noundef zeroext i1 @_Z5checkii(i32 noundef 0, i32 noundef 1)
  br i1 %17, label %.loopexit156.sink.split, label %18

18:                                               ; preds = %._crit_edge
  %19 = call noundef zeroext i1 @_Z5checkii(i32 noundef 1, i32 noundef 0)
  br i1 %19, label %.loopexit156.sink.split, label %20

20:                                               ; preds = %18
  %21 = call noundef zeroext i1 @_Z5checkii(i32 noundef 1, i32 noundef 1)
  br i1 %21, label %.loopexit156.sink.split, label %.preheader155

.loopexit148:                                     ; preds = %28
  br i1 %23, label %.loopexit156, label %.preheader155, !llvm.loop !11

.preheader155:                                    ; preds = %20, %.loopexit148
  %.0126163 = phi i32 [ %22, %.loopexit148 ], [ 1, %20 ]
  %22 = add nuw nsw i32 %.0126163, 1
  %23 = icmp ugt i32 %.0126163, 48
  br i1 %23, label %.loopexit156, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader155, %28
  %.0127160 = phi i32 [ %29, %28 ], [ %22, %.preheader155 ]
  %24 = call noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef %.0126163, i32 noundef %.0127160)
  %25 = icmp eq i32 %24, 1
  br i1 %25, label %26, label %28

26:                                               ; preds = %.lr.ph
  %27 = call noundef zeroext i1 @_Z5checkii(i32 noundef %.0126163, i32 noundef %.0127160)
  br i1 %27, label %.loopexit156.sink.split, label %28

28:                                               ; preds = %.lr.ph, %26
  %29 = add nuw nsw i32 %.0127160, 1
  %30 = icmp ugt i32 %.0127160, 48
  br i1 %30, label %.loopexit148, label %.lr.ph, !llvm.loop !12

.loopexit156.sink.split:                          ; preds = %26, %20, %18, %._crit_edge
  %.0126163.lcssa.sink = phi i32 [ 0, %._crit_edge ], [ 1, %18 ], [ 1, %20 ], [ %.0126163, %26 ]
  %.0127160.lcssa.sink = phi i32 [ 1, %._crit_edge ], [ 0, %18 ], [ 1, %20 ], [ %.0127160, %26 ]
  store i32 %.0126163.lcssa.sink, ptr @tr, align 4, !tbaa !5
  store i32 %.0127160.lcssa.sink, ptr getelementptr inbounds (i8, ptr @tr, i64 4), align 4, !tbaa !5
  br label %.loopexit156

.loopexit156:                                     ; preds = %.loopexit148, %.preheader155, %.loopexit156.sink.split
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.preheader, label %._crit_edge182

.preheader154:                                    ; preds = %48
  %33 = icmp sgt i32 %49, 0
  br i1 %33, label %.lr.ph171, label %._crit_edge182

.preheader:                                       ; preds = %.loopexit156, %48
  %indvars.iv212 = phi i64 [ %indvars.iv.next213, %48 ], [ 0, %.loopexit156 ]
  %34 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %indvars.iv212, i64 0
  %35 = call noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %34, ptr noundef nonnull align 4 dereferenceable(8) @tr)
  %36 = trunc i64 %35 to i32
  %37 = call noundef i64 @_ZNK5Point3dotERKS_(ptr noundef nonnull align 4 dereferenceable(8) %34, ptr noundef nonnull align 4 dereferenceable(8) @tr)
  %38 = trunc i64 %37 to i32
  store i32 %36, ptr %34, align 16, !tbaa !5
  %.sroa.471.0..sroa_idx = getelementptr inbounds i8, ptr %34, i64 4
  store i32 %38, ptr %.sroa.471.0..sroa_idx, align 4, !tbaa !5
  %39 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %indvars.iv212, i64 1
  %40 = call noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %39, ptr noundef nonnull align 4 dereferenceable(8) @tr)
  %41 = trunc i64 %40 to i32
  %42 = call noundef i64 @_ZNK5Point3dotERKS_(ptr noundef nonnull align 4 dereferenceable(8) %39, ptr noundef nonnull align 4 dereferenceable(8) @tr)
  %43 = trunc i64 %42 to i32
  store i32 %41, ptr %39, align 8, !tbaa !5
  %.sroa.471.0..sroa_idx.1 = getelementptr inbounds i8, ptr %39, i64 4
  store i32 %43, ptr %.sroa.471.0..sroa_idx.1, align 4, !tbaa !5
  %44 = load i32, ptr %34, align 16, !tbaa !13
  %45 = icmp sgt i32 %44, %41
  br i1 %45, label %46, label %48

46:                                               ; preds = %.preheader
  %47 = getelementptr inbounds i8, ptr %34, i64 8
  call void @_ZSt4swapI5PointENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 4 dereferenceable(8) %34, ptr noundef nonnull align 4 dereferenceable(8) %47) #8
  br label %48

48:                                               ; preds = %.preheader, %46
  %indvars.iv.next213 = add nuw nsw i64 %indvars.iv212, 1
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next213, %50
  br i1 %51, label %.preheader, label %.preheader154, !llvm.loop !15

.loopexit147:                                     ; preds = %.lr.ph169, %.lr.ph171
  %52 = phi i32 [ %55, %.lr.ph171 ], [ %62, %.lr.ph169 ]
  %53 = icmp slt i32 %56, %52
  br i1 %53, label %.lr.ph171, label %.preheader153, !llvm.loop !16

.preheader153:                                    ; preds = %.loopexit147
  %54 = icmp sgt i32 %52, 0
  br i1 %54, label %.lr.ph181, label %._crit_edge182

.lr.ph171:                                        ; preds = %.preheader154, %.loopexit147
  %55 = phi i32 [ %52, %.loopexit147 ], [ %49, %.preheader154 ]
  %.0133170 = phi i32 [ %56, %.loopexit147 ], [ 0, %.preheader154 ]
  %56 = add nuw nsw i32 %.0133170, 1
  %57 = icmp slt i32 %56, %55
  br i1 %57, label %.lr.ph169, label %.loopexit147

.lr.ph169:                                        ; preds = %.lr.ph171, %.lr.ph169
  %.0132167 = phi i32 [ %61, %.lr.ph169 ], [ %56, %.lr.ph171 ]
  %58 = call noundef i32 @_Z3idxii(i32 noundef %.0133170, i32 noundef %.0132167)
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1002001 x %"class.std::vector"], ptr @e, i64 0, i64 %59
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #8
  %61 = add nuw nsw i32 %.0132167, 1
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %.lr.ph169, label %.loopexit147, !llvm.loop !17

._crit_edge182:                                   ; preds = %._crit_edge179, %.loopexit156, %.preheader154, %.preheader153
  %64 = call noundef zeroext i1 @_Z6color1v()
  br i1 %64, label %123, label %145

.lr.ph181:                                        ; preds = %.preheader153, %._crit_edge179
  %65 = phi i32 [ %108, %._crit_edge179 ], [ %52, %.preheader153 ]
  %indvars.iv221 = phi i64 [ %indvars.iv.next222, %._crit_edge179 ], [ 0, %.preheader153 ]
  store i32 0, ptr @tot, align 4, !tbaa !5
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %.lr.ph174, label %._crit_edge175

.lr.ph174:                                        ; preds = %.lr.ph181
  %67 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %indvars.iv221
  %68 = getelementptr inbounds i8, ptr %67, i64 8
  %69 = trunc nuw nsw i64 %indvars.iv221 to i32
  %70 = trunc nuw nsw i64 %indvars.iv221 to i32
  br label %77

._crit_edge175.loopexit:                          ; preds = %104
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge175

._crit_edge175:                                   ; preds = %._crit_edge175.loopexit, %.lr.ph181
  %71 = phi i32 [ %.pre, %._crit_edge175.loopexit ], [ 0, %.lr.ph181 ]
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds %struct.ToSort, ptr @que, i64 %72
  call void @_ZSt4sortIP6ToSortEvT_S2_(ptr noundef nonnull @que, ptr noundef nonnull %73)
  %74 = load i32, ptr @tot, align 4, !tbaa !5
  %75 = icmp sgt i32 %74, 1
  br i1 %75, label %.lr.ph178.preheader, label %._crit_edge179

.lr.ph178.preheader:                              ; preds = %._crit_edge175
  %76 = trunc nuw nsw i64 %indvars.iv221 to i32
  br label %.lr.ph178

77:                                               ; preds = %.lr.ph174, %104
  %indvars.iv215 = phi i64 [ 0, %.lr.ph174 ], [ %indvars.iv.next216, %104 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %78 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %67, ptr noundef nonnull align 4 dereferenceable(8) %68)
  store i64 %78, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %79 = getelementptr inbounds [1001 x [2 x %struct.Point]], ptr @pl, i64 0, i64 %indvars.iv215
  %80 = getelementptr inbounds i8, ptr %79, i64 8
  %81 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %79, ptr noundef nonnull align 4 dereferenceable(8) %80)
  store i64 %81, ptr %2, align 8
  %82 = call noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  %.not144 = icmp eq i64 %82, 0
  %83 = trunc nuw nsw i64 %indvars.iv215 to i32
  br i1 %.not144, label %84, label %88

84:                                               ; preds = %77
  %85 = call noundef i32 @_Z3idxii(i32 noundef %70, i32 noundef %83)
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [1002001 x i32], ptr @col, i64 0, i64 %86
  store i32 -1, ptr %87, align 4, !tbaa !5
  br label %104

88:                                               ; preds = %77
  %89 = call noundef i32 @_Z3idxii(i32 noundef %69, i32 noundef %83)
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [1002001 x i32], ptr @col, i64 0, i64 %90
  store i32 0, ptr %91, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %92 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %79, ptr noundef nonnull align 4 dereferenceable(8) %80)
  store i64 %92, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %93 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %68, ptr noundef nonnull align 4 dereferenceable(8) %80)
  store i64 %93, ptr %4, align 8
  %94 = call noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %95 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %94, i64 noundef %82)
  %96 = sdiv i64 %94, %95
  %97 = sdiv i64 %82, %95
  %98 = icmp slt i64 %97, 0
  %99 = sub nsw i64 0, %96
  %.0129 = call i64 @llvm.abs.i64(i64 %97, i1 true)
  %.0128 = select i1 %98, i64 %99, i64 %96
  %100 = load i32, ptr @tot, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr @tot, align 4, !tbaa !5
  %102 = sext i32 %100 to i64
  %103 = getelementptr inbounds [1001 x %struct.ToSort], ptr @que, i64 0, i64 %102
  store i32 %83, ptr %103, align 8, !tbaa !5
  %.sroa.431.0..sroa_idx = getelementptr inbounds i8, ptr %103, i64 8
  store i64 %.0128, ptr %.sroa.431.0..sroa_idx, align 8, !tbaa !18
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %103, i64 16
  store i64 %.0129, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !18
  br label %104

104:                                              ; preds = %88, %84
  %indvars.iv.next216 = add nuw nsw i64 %indvars.iv215, 1
  %105 = load i32, ptr @n, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = icmp slt i64 %indvars.iv.next216, %106
  br i1 %107, label %77, label %._crit_edge175.loopexit, !llvm.loop !20

._crit_edge179:                                   ; preds = %.lr.ph178, %._crit_edge175
  %indvars.iv.next222 = add nuw nsw i64 %indvars.iv221, 1
  %108 = load i32, ptr @n, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = icmp slt i64 %indvars.iv.next222, %109
  br i1 %110, label %.lr.ph181, label %._crit_edge182, !llvm.loop !21

.lr.ph178:                                        ; preds = %.lr.ph178.preheader, %.lr.ph178
  %indvars.iv218 = phi i64 [ 1, %.lr.ph178.preheader ], [ %indvars.iv.next219, %.lr.ph178 ]
  %111 = add nsw i64 %indvars.iv218, -1
  %112 = getelementptr inbounds [1001 x %struct.ToSort], ptr @que, i64 0, i64 %111
  %113 = load i32, ptr %112, align 8, !tbaa !22
  %114 = call noundef i32 @_Z3idxii(i32 noundef %76, i32 noundef %113)
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [1002001 x %"class.std::vector"], ptr @e, i64 0, i64 %115
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %117 = getelementptr inbounds [1001 x %struct.ToSort], ptr @que, i64 0, i64 %indvars.iv218
  %118 = load i32, ptr %117, align 8, !tbaa !22
  %119 = call noundef i32 @_Z3idxii(i32 noundef %76, i32 noundef %118)
  store i32 %119, ptr %5, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %116, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  %indvars.iv.next219 = add nuw nsw i64 %indvars.iv218, 1
  %120 = load i32, ptr @tot, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = icmp slt i64 %indvars.iv.next219, %121
  br i1 %122, label %.lr.ph178, label %._crit_edge179, !llvm.loop !24

123:                                              ; preds = %._crit_edge182
  %124 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str)
  %125 = load i32, ptr @n, align 4, !tbaa !5
  %126 = icmp sgt i32 %125, 0
  br i1 %126, label %.lr.ph200, label %.backedge

.loopexit:                                        ; preds = %.lr.ph197, %.lr.ph200
  %127 = phi i32 [ %129, %.lr.ph200 ], [ %143, %.lr.ph197 ]
  %128 = icmp slt i32 %130, %127
  br i1 %128, label %.lr.ph200, label %.backedge, !llvm.loop !25

.lr.ph200:                                        ; preds = %123, %.loopexit
  %129 = phi i32 [ %127, %.loopexit ], [ %125, %123 ]
  %.0122198 = phi i32 [ %130, %.loopexit ], [ 0, %123 ]
  %130 = add nuw nsw i32 %.0122198, 1
  %131 = icmp slt i32 %130, %129
  br i1 %131, label %.lr.ph197, label %.loopexit

.lr.ph197:                                        ; preds = %.lr.ph200, %.lr.ph197
  %.0121195 = phi i32 [ %142, %.lr.ph197 ], [ %130, %.lr.ph200 ]
  %132 = call noundef i32 @_Z3idxii(i32 noundef %.0122198, i32 noundef %.0121195)
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [1002001 x i32], ptr @col, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = load i32, ptr @n, align 4, !tbaa !5
  %137 = add nsw i32 %136, -1
  %138 = icmp eq i32 %.0121195, %137
  %139 = zext i1 %138 to i64
  %140 = getelementptr inbounds [3 x i8], ptr @.str.1, i64 0, i64 %139
  %141 = load i8, ptr %140, align 1, !tbaa !26
  call void @_Z5printIiEvT_c(i32 noundef %135, i8 noundef signext %141)
  %142 = add nuw nsw i32 %.0121195, 1
  %143 = load i32, ptr @n, align 4, !tbaa !5
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %.lr.ph197, label %.loopexit, !llvm.loop !27

145:                                              ; preds = %._crit_edge182
  %146 = call noundef zeroext i1 @_Z6color2v()
  br i1 %146, label %147, label %169

147:                                              ; preds = %145
  %148 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  %149 = load i32, ptr @n, align 4, !tbaa !5
  %150 = icmp sgt i32 %149, 0
  br i1 %150, label %.lr.ph194, label %.backedge, !llvm.loop !28

.loopexit145:                                     ; preds = %.lr.ph191, %.lr.ph194
  %151 = phi i32 [ %153, %.lr.ph194 ], [ %167, %.lr.ph191 ]
  %152 = icmp slt i32 %154, %151
  br i1 %152, label %.lr.ph194, label %.backedge, !llvm.loop !29

.lr.ph194:                                        ; preds = %147, %.loopexit145
  %153 = phi i32 [ %151, %.loopexit145 ], [ %149, %147 ]
  %.0120192 = phi i32 [ %154, %.loopexit145 ], [ 0, %147 ]
  %154 = add nuw nsw i32 %.0120192, 1
  %155 = icmp slt i32 %154, %153
  br i1 %155, label %.lr.ph191, label %.loopexit145

.lr.ph191:                                        ; preds = %.lr.ph194, %.lr.ph191
  %.0119189 = phi i32 [ %166, %.lr.ph191 ], [ %154, %.lr.ph194 ]
  %156 = call noundef i32 @_Z3idxii(i32 noundef %.0120192, i32 noundef %.0119189)
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [1002001 x i32], ptr @col, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = load i32, ptr @n, align 4, !tbaa !5
  %161 = add nsw i32 %160, -1
  %162 = icmp eq i32 %.0119189, %161
  %163 = zext i1 %162 to i64
  %164 = getelementptr inbounds [3 x i8], ptr @.str.1, i64 0, i64 %163
  %165 = load i8, ptr %164, align 1, !tbaa !26
  call void @_Z5printIiEvT_c(i32 noundef %159, i8 noundef signext %165)
  %166 = add nuw nsw i32 %.0119189, 1
  %167 = load i32, ptr @n, align 4, !tbaa !5
  %168 = icmp slt i32 %166, %167
  br i1 %168, label %.lr.ph191, label %.loopexit145, !llvm.loop !30

169:                                              ; preds = %145
  %170 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  %171 = load i32, ptr @n, align 4, !tbaa !5
  %172 = icmp sgt i32 %171, 0
  br i1 %172, label %.lr.ph188, label %.backedge

.loopexit146:                                     ; preds = %183, %.lr.ph188
  %173 = phi i32 [ %175, %.lr.ph188 ], [ %192, %183 ]
  %174 = icmp slt i32 %176, %173
  br i1 %174, label %.lr.ph188, label %.backedge, !llvm.loop !31

.lr.ph188:                                        ; preds = %169, %.loopexit146
  %175 = phi i32 [ %173, %.loopexit146 ], [ %171, %169 ]
  %.0118186 = phi i32 [ %176, %.loopexit146 ], [ 0, %169 ]
  %176 = add nuw nsw i32 %.0118186, 1
  %177 = icmp slt i32 %176, %175
  br i1 %177, label %.lr.ph185, label %.loopexit146

.lr.ph185:                                        ; preds = %.lr.ph188, %183
  %.0117183 = phi i32 [ %191, %183 ], [ %176, %.lr.ph188 ]
  %178 = call noundef i32 @_Z3idxii(i32 noundef %.0118186, i32 noundef %.0117183)
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [1002001 x i32], ptr @col, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %.not143 = icmp eq i32 %181, 0
  br i1 %.not143, label %182, label %183

182:                                              ; preds = %.lr.ph185
  call void @_Z3dfsi(i32 noundef %178)
  %.pre224 = load i32, ptr %180, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %182, %.lr.ph185
  %184 = phi i32 [ %.pre224, %182 ], [ %181, %.lr.ph185 ]
  %185 = load i32, ptr @n, align 4, !tbaa !5
  %186 = add nsw i32 %185, -1
  %187 = icmp eq i32 %.0117183, %186
  %188 = zext i1 %187 to i64
  %189 = getelementptr inbounds [3 x i8], ptr @.str.1, i64 0, i64 %188
  %190 = load i8, ptr %189, align 1, !tbaa !26
  call void @_Z5printIiEvT_c(i32 noundef %184, i8 noundef signext %190)
  %191 = add nuw nsw i32 %.0117183, 1
  %192 = load i32, ptr @n, align 4, !tbaa !5
  %193 = icmp slt i32 %191, %192
  br i1 %193, label %.lr.ph185, label %.loopexit146, !llvm.loop !32

.backedge:                                        ; preds = %.loopexit146, %.loopexit145, %.loopexit, %123, %169, %147
  %194 = load i32, ptr @t, align 4, !tbaa !5
  %195 = add nsw i32 %194, -1
  store i32 %195, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %194, 0
  br i1 %.not, label %._crit_edge204, label %.lr.ph203, !llvm.loop !28

._crit_edge204:                                   ; preds = %.backedge, %0
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef, i64 noundef) local_unnamed_addr #2

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z5printIiEvT_c(i32 noundef, i8 noundef signext) local_unnamed_addr #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #7

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

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

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


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