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

; 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"

%struct.Point = type { i32, double, double }

@p = external dso_local global [200010 x %struct.Point], align 16
@n = external dso_local global i32, align 4
@top = external dso_local global i32, align 4
@que = external dso_local global [200010 x i32], align 16
@ok = external dso_local global [200010 x i32], align 16
@ans = external dso_local global [200010 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.Point, align 8
  %5 = alloca %struct.Point, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %51, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %54

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %17
  %19 = getelementptr inbounds %struct.Point, ptr %18, i32 0, i32 1
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %21
  %23 = getelementptr inbounds %struct.Point, ptr %22, i32 0, i32 2
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %19, ptr noundef %23)
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %26
  %28 = getelementptr inbounds %struct.Point, ptr %27, i32 0, i32 1
  %29 = load double, ptr %28, align 8, !tbaa !9
  %30 = fdiv double 1.000000e+04, %29
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %32
  %34 = getelementptr inbounds %struct.Point, ptr %33, i32 0, i32 1
  store double %30, ptr %34, align 8, !tbaa !9
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %36
  %38 = getelementptr inbounds %struct.Point, ptr %37, i32 0, i32 2
  %39 = load double, ptr %38, align 8, !tbaa !12
  %40 = fdiv double 1.000000e+04, %39
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %42
  %44 = getelementptr inbounds %struct.Point, ptr %43, i32 0, i32 2
  store double %40, ptr %44, align 8, !tbaa !12
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %48
  %50 = getelementptr inbounds %struct.Point, ptr %49, i32 0, i32 0
  store i32 %46, ptr %50, align 8, !tbaa !13
  br label %51

51:                                               ; preds = %15
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !14

54:                                               ; preds = %14
  %55 = load i32, ptr @n, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds %struct.Point, ptr @p, i64 %56
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef @p, ptr noundef %57)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %125, %54
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %128

63:                                               ; preds = %58
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %82

66:                                               ; preds = %63
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %68
  %70 = getelementptr inbounds %struct.Point, ptr %69, i32 0, i32 1
  %71 = load double, ptr %70, align 8, !tbaa !9
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = sub nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %74
  %76 = getelementptr inbounds %struct.Point, ptr %75, i32 0, i32 1
  %77 = load double, ptr %76, align 8, !tbaa !9
  %78 = fsub double %71, %77
  %79 = call noundef i32 @_Z4dcmpd(double noundef %78)
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %82, label %81

81:                                               ; preds = %66
  br label %125

82:                                               ; preds = %66, %63
  br label %83

83:                                               ; preds = %116, %82
  %84 = load i32, ptr @top, align 4, !tbaa !5
  %85 = icmp sgt i32 %84, 1
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #5
  br i1 %85, label %86, label %114

86:                                               ; preds = %83
  %87 = load i32, ptr @top, align 4, !tbaa !5
  %88 = sub nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %92
  %94 = load i32, ptr @top, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 2
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %99
  call void @_ZNK5PointmiERKS_(ptr dead_on_unwind writable sret(%struct.Point) align 8 %4, ptr noundef nonnull align 8 dereferenceable(24) %93, ptr noundef nonnull align 8 dereferenceable(24) %100)
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %102
  %104 = load i32, ptr @top, align 4, !tbaa !5
  %105 = sub nsw i32 %104, 2
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %109
  call void @_ZNK5PointmiERKS_(ptr dead_on_unwind writable sret(%struct.Point) align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %103, ptr noundef nonnull align 8 dereferenceable(24) %110)
  %111 = call noundef double @_ZNK5Point3detERKS_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
  %112 = call noundef i32 @_Z4dcmpd(double noundef %111)
  %113 = icmp slt i32 %112, 0
  br label %114

114:                                              ; preds = %86, %83
  %115 = phi i1 [ false, %83 ], [ %113, %86 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  br i1 %115, label %116, label %119

116:                                              ; preds = %114
  %117 = load i32, ptr @top, align 4, !tbaa !5
  %118 = add nsw i32 %117, -1
  store i32 %118, ptr @top, align 4, !tbaa !5
  br label %83, !llvm.loop !16

119:                                              ; preds = %114
  %120 = load i32, ptr %3, align 4, !tbaa !5
  %121 = load i32, ptr @top, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr @top, align 4, !tbaa !5
  %123 = sext i32 %121 to i64
  %124 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %123
  store i32 %120, ptr %124, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %119, %81
  %126 = load i32, ptr %3, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %3, align 4, !tbaa !5
  br label %58, !llvm.loop !17

128:                                              ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %166, %128
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = load i32, ptr @top, 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 %6) #5
  br label %169

134:                                              ; preds = %129
  %135 = load i32, ptr %6, align 4, !tbaa !5
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %158

137:                                              ; preds = %134
  %138 = load i32, ptr %6, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %142
  %144 = getelementptr inbounds %struct.Point, ptr %143, i32 0, i32 2
  %145 = load double, ptr %144, align 8, !tbaa !12
  %146 = load i32, ptr %6, align 4, !tbaa !5
  %147 = sub nsw i32 %146, 1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %151
  %153 = getelementptr inbounds %struct.Point, ptr %152, i32 0, i32 2
  %154 = load double, ptr %153, align 8, !tbaa !12
  %155 = fsub double %145, %154
  %156 = call noundef i32 @_Z4dcmpd(double noundef %155)
  %157 = icmp slt i32 %156, 0
  br i1 %157, label %158, label %165

158:                                              ; preds = %137, %134
  %159 = load i32, ptr %6, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [200010 x i32], ptr @ok, i64 0, i64 %163
  store i32 1, ptr %164, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %158, %137
  br label %166

166:                                              ; preds = %165
  %167 = load i32, ptr %6, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %6, align 4, !tbaa !5
  br label %129, !llvm.loop !18

169:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %234, %169
  %171 = load i32, ptr %7, align 4, !tbaa !5
  %172 = load i32, ptr @n, align 4, !tbaa !5
  %173 = icmp slt i32 %171, %172
  br i1 %173, label %175, label %174

174:                                              ; preds = %170
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %237

175:                                              ; preds = %170
  %176 = load i32, ptr %7, align 4, !tbaa !5
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %178, label %219

178:                                              ; preds = %175
  %179 = load i32, ptr %7, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %180
  %182 = getelementptr inbounds %struct.Point, ptr %181, i32 0, i32 1
  %183 = load double, ptr %182, align 8, !tbaa !9
  %184 = load i32, ptr %7, align 4, !tbaa !5
  %185 = sub nsw i32 %184, 1
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %186
  %188 = getelementptr inbounds %struct.Point, ptr %187, i32 0, i32 1
  %189 = load double, ptr %188, align 8, !tbaa !9
  %190 = fsub double %183, %189
  %191 = call noundef i32 @_Z4dcmpd(double noundef %190)
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %219, label %193

193:                                              ; preds = %178
  %194 = load i32, ptr %7, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %195
  %197 = getelementptr inbounds %struct.Point, ptr %196, i32 0, i32 2
  %198 = load double, ptr %197, align 8, !tbaa !12
  %199 = load i32, ptr %7, align 4, !tbaa !5
  %200 = sub nsw i32 %199, 1
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %201
  %203 = getelementptr inbounds %struct.Point, ptr %202, i32 0, i32 2
  %204 = load double, ptr %203, align 8, !tbaa !12
  %205 = fsub double %198, %204
  %206 = call noundef i32 @_Z4dcmpd(double noundef %205)
  %207 = icmp ne i32 %206, 0
  br i1 %207, label %219, label %208

208:                                              ; preds = %193
  %209 = load i32, ptr %7, align 4, !tbaa !5
  %210 = sub nsw i32 %209, 1
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [200010 x i32], ptr @ok, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = load i32, ptr %7, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [200010 x i32], ptr @ok, i64 0, i64 %215
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = or i32 %217, %213
  store i32 %218, ptr %216, align 4, !tbaa !5
  br label %219

219:                                              ; preds = %208, %193, %178, %175
  %220 = load i32, ptr %7, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [200010 x i32], ptr @ok, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  %224 = icmp ne i32 %223, 0
  br i1 %224, label %225, label %233

225:                                              ; preds = %219
  %226 = load i32, ptr %7, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %227
  %229 = getelementptr inbounds %struct.Point, ptr %228, i32 0, i32 0
  %230 = load i32, ptr %229, align 8, !tbaa !13
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %231
  store i32 1, ptr %232, align 4, !tbaa !5
  br label %233

233:                                              ; preds = %225, %219
  br label %234

234:                                              ; preds = %233
  %235 = load i32, ptr %7, align 4, !tbaa !5
  %236 = add nsw i32 %235, 1
  store i32 %236, ptr %7, align 4, !tbaa !5
  br label %170, !llvm.loop !19

237:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %238

238:                                              ; preds = %253, %237
  %239 = load i32, ptr %8, align 4, !tbaa !5
  %240 = load i32, ptr @n, align 4, !tbaa !5
  %241 = icmp sle i32 %239, %240
  br i1 %241, label %243, label %242

242:                                              ; preds = %238
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %256

243:                                              ; preds = %238
  %244 = load i32, ptr %8, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %245
  %247 = load i32, ptr %246, align 4, !tbaa !5
  %248 = icmp ne i32 %247, 0
  br i1 %248, label %249, label %252

249:                                              ; preds = %243
  %250 = load i32, ptr %8, align 4, !tbaa !5
  %251 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %250)
  br label %252

252:                                              ; preds = %249, %243
  br label %253

253:                                              ; preds = %252
  %254 = load i32, ptr %8, align 4, !tbaa !5
  %255 = add nsw i32 %254, 1
  store i32 %255, ptr %8, align 4, !tbaa !5
  br label %238, !llvm.loop !20

256:                                              ; preds = %242
  %257 = call i32 @puts(ptr noundef @.str.3)
  ret i32 0
}

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

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

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

; 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 @_ZNK5PointmiERKS_(ptr dead_on_unwind noalias writable sret(%struct.Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

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

declare i32 @puts(ptr noundef) #2

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !11, i64 8}
!10 = !{!"_ZTS5Point", !6, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"double", !7, i64 0}
!12 = !{!10, !11, i64 16}
!13 = !{!10, !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !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"

%struct.Point = type { i32, double, double }

@p = external dso_local global [200010 x %struct.Point], align 16
@n = external dso_local global i32, align 4
@top = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local local_unnamed_addr global [200010 x i32], align 16
@ok = external dso_local local_unnamed_addr global [200010 x i32], align 16
@ans = external dso_local local_unnamed_addr global [200010 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca %struct.Point, align 8
  %2 = alloca %struct.Point, align 8
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre94 = sext i32 %4 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre94, %.._crit_edge_crit_edge ], [ %17, %.lr.ph ]
  %6 = getelementptr inbounds %struct.Point, ptr @p, i64 %.pre-phi
  tail call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef nonnull @p, ptr noundef nonnull %6)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph60, label %.preheader52

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %9 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv
  %10 = getelementptr inbounds i8, ptr %9, i64 8
  %11 = getelementptr inbounds i8, ptr %9, i64 16
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %10, ptr noundef nonnull %11)
  %13 = load <2 x double>, ptr %10, align 8, !tbaa !9
  %14 = fdiv <2 x double> <double 1.000000e+04, double 1.000000e+04>, %13
  store <2 x double> %14, ptr %10, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %15, ptr %9, align 8, !tbaa !11
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv.next, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader52:                                     ; preds = %70, %._crit_edge
  %19 = phi i32 [ %7, %._crit_edge ], [ %71, %70 ]
  %20 = load i32, ptr @top, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %22, label %.preheader51

22:                                               ; preds = %.preheader52
  %.pre87 = load i32, ptr @que, align 16, !tbaa !5
  %23 = sext i32 %.pre87 to i64
  %24 = getelementptr inbounds [200010 x i32], ptr @ok, i64 0, i64 %23
  store i32 1, ptr %24, align 4, !tbaa !5
  %.not = icmp eq i32 %20, 1
  br i1 %.not, label %.preheader51, label %.lr.ph62.peel.next

.lr.ph60:                                         ; preds = %._crit_edge, %70
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %70 ], [ 0, %._crit_edge ]
  %.not49 = icmp eq i64 %indvars.iv71, 0
  br i1 %.not49, label %33, label %25

25:                                               ; preds = %.lr.ph60
  %26 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv71, i32 1
  %27 = load double, ptr %26, align 8, !tbaa !15
  %28 = add nsw i64 %indvars.iv71, -1
  %29 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %28, i32 1
  %30 = load double, ptr %29, align 8, !tbaa !15
  %31 = fsub double %27, %30
  %32 = call noundef i32 @_Z4dcmpd(double noundef %31)
  %.not50 = icmp eq i32 %32, 0
  br i1 %.not50, label %70, label %33

33:                                               ; preds = %25, %.lr.ph60
  %.pr = load i32, ptr @top, align 4, !tbaa !5
  %34 = icmp sgt i32 %.pr, 1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  br i1 %34, label %.lr.ph55, label %.critedge

.lr.ph55:                                         ; preds = %33
  %35 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv71
  br label %36

36:                                               ; preds = %.lr.ph55, %61
  %37 = phi i32 [ %.pr, %.lr.ph55 ], [ %62, %61 ]
  %38 = add nsw i32 %37, -1
  %39 = zext nneg i32 %38 to i64
  %40 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %42
  %44 = add nsw i32 %37, -2
  %45 = zext nneg i32 %44 to i64
  %46 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %48
  call void @_ZNK5PointmiERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Point) align 8 %1, ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef nonnull align 8 dereferenceable(24) %49)
  %50 = load i32, ptr @top, align 4, !tbaa !5
  %51 = add nsw i32 %50, -2
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %55
  call void @_ZNK5PointmiERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Point) align 8 %2, ptr noundef nonnull align 8 dereferenceable(24) %35, ptr noundef nonnull align 8 dereferenceable(24) %56)
  %57 = call noundef double @_ZNK5Point3detERKS_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2)
  %58 = call noundef i32 @_Z4dcmpd(double noundef %57)
  %59 = icmp slt i32 %58, 0
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #5
  %60 = load i32, ptr @top, align 4, !tbaa !5
  br i1 %59, label %61, label %.loopexit

61:                                               ; preds = %36
  %62 = add nsw i32 %60, -1
  store i32 %62, ptr @top, align 4, !tbaa !5
  %63 = icmp sgt i32 %60, 2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  br i1 %63, label %36, label %.critedge, !llvm.loop !16

.critedge:                                        ; preds = %61, %33
  %64 = phi i32 [ %.pr, %33 ], [ %62, %61 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #5
  br label %.loopexit

.loopexit:                                        ; preds = %36, %.critedge
  %65 = phi i32 [ %64, %.critedge ], [ %60, %36 ]
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr @top, align 4, !tbaa !5
  %67 = sext i32 %65 to i64
  %68 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %67
  %69 = trunc nuw nsw i64 %indvars.iv71 to i32
  store i32 %69, ptr %68, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %25, %.loopexit
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = icmp slt i64 %indvars.iv.next72, %72
  br i1 %73, label %.lr.ph60, label %.preheader52, !llvm.loop !17

.preheader51.loopexit.loopexit:                   ; preds = %100
  %.pre88.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader51

.preheader51:                                     ; preds = %22, %.preheader51.loopexit.loopexit, %.preheader52
  %74 = phi i32 [ %19, %.preheader52 ], [ %.pre88.pre, %.preheader51.loopexit.loopexit ], [ %19, %22 ]
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %.lr.ph64.preheader._crit_edge, label %._crit_edge68

.lr.ph64.preheader._crit_edge:                    ; preds = %.preheader51
  %.pre91 = load i32, ptr @ok, align 16, !tbaa !5
  %.not47.peel = icmp eq i32 %.pre91, 0
  br i1 %.not47.peel, label %80, label %76

76:                                               ; preds = %.lr.ph64.preheader._crit_edge
  %77 = load i32, ptr @p, align 16, !tbaa !11
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %78
  store i32 1, ptr %79, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %76, %.lr.ph64.preheader._crit_edge
  %.not95 = icmp eq i32 %74, 1
  br i1 %.not95, label %.lr.ph67.preheader, label %.lr.ph64.peel.next

.lr.ph62.peel.next:                               ; preds = %22, %100
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %100 ], [ 1, %22 ]
  %81 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %indvars.iv74
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %83, i32 2
  %85 = load double, ptr %84, align 8, !tbaa !18
  %86 = add nsw i64 %indvars.iv74, -1
  %87 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %89, i32 2
  %91 = load double, ptr %90, align 8, !tbaa !18
  %92 = fsub double %85, %91
  %93 = call noundef i32 @_Z4dcmpd(double noundef %92)
  %94 = icmp slt i32 %93, 0
  br i1 %94, label %95, label %100

95:                                               ; preds = %.lr.ph62.peel.next
  %96 = getelementptr inbounds [200010 x i32], ptr @que, i64 0, i64 %indvars.iv74
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [200010 x i32], ptr @ok, i64 0, i64 %98
  store i32 1, ptr %99, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %.lr.ph62.peel.next, %95
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %101 = load i32, ptr @top, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = icmp slt i64 %indvars.iv.next75, %102
  br i1 %103, label %.lr.ph62.peel.next, label %.preheader51.loopexit.loopexit, !llvm.loop !19

.preheader:                                       ; preds = %134
  %.not65 = icmp slt i32 %135, 1
  br i1 %.not65, label %._crit_edge68, label %.lr.ph67.preheader

.lr.ph67.preheader:                               ; preds = %80, %.preheader
  %.ph = phi i32 [ 1, %80 ], [ %135, %.preheader ]
  br label %.lr.ph67

.lr.ph64.peel.next:                               ; preds = %80, %134
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %134 ], [ 1, %80 ]
  %104 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv78
  %105 = getelementptr inbounds i8, ptr %104, i64 8
  %106 = load double, ptr %105, align 8, !tbaa !15
  %107 = add nsw i64 %indvars.iv78, -1
  %108 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %107
  %109 = getelementptr inbounds i8, ptr %108, i64 8
  %110 = load double, ptr %109, align 8, !tbaa !15
  %111 = fsub double %106, %110
  %112 = call noundef i32 @_Z4dcmpd(double noundef %111)
  %.not45 = icmp eq i32 %112, 0
  br i1 %.not45, label %113, label %126

113:                                              ; preds = %.lr.ph64.peel.next
  %114 = getelementptr inbounds i8, ptr %104, i64 16
  %115 = load double, ptr %114, align 8, !tbaa !18
  %116 = getelementptr inbounds i8, ptr %108, i64 16
  %117 = load double, ptr %116, align 8, !tbaa !18
  %118 = fsub double %115, %117
  %119 = call noundef i32 @_Z4dcmpd(double noundef %118)
  %.not46 = icmp eq i32 %119, 0
  br i1 %.not46, label %120, label %126

120:                                              ; preds = %113
  %121 = getelementptr inbounds [200010 x i32], ptr @ok, i64 0, i64 %107
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = getelementptr inbounds [200010 x i32], ptr @ok, i64 0, i64 %indvars.iv78
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = or i32 %124, %122
  store i32 %125, ptr %123, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %120, %113, %.lr.ph64.peel.next
  %127 = getelementptr inbounds [200010 x i32], ptr @ok, i64 0, i64 %indvars.iv78
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %.not47 = icmp eq i32 %128, 0
  br i1 %.not47, label %134, label %129

129:                                              ; preds = %126
  %130 = getelementptr inbounds [200010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv78
  %131 = load i32, ptr %130, align 8, !tbaa !11
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %132
  store i32 1, ptr %133, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %126, %129
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %135 = load i32, ptr @n, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = icmp slt i64 %indvars.iv.next79, %136
  br i1 %137, label %.lr.ph64.peel.next, label %.preheader, !llvm.loop !21

._crit_edge68:                                    ; preds = %145, %.preheader51, %.preheader
  %138 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  ret i32 0

.lr.ph67:                                         ; preds = %.lr.ph67.preheader, %145
  %139 = phi i32 [ %146, %145 ], [ %.ph, %.lr.ph67.preheader ]
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %145 ], [ 1, %.lr.ph67.preheader ]
  %140 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %indvars.iv82
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %.not43 = icmp eq i32 %141, 0
  br i1 %.not43, label %145, label %142

142:                                              ; preds = %.lr.ph67
  %143 = trunc nuw nsw i64 %indvars.iv82 to i32
  %144 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %143)
  %.pre92 = load i32, ptr @n, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %.lr.ph67, %142
  %146 = phi i32 [ %139, %.lr.ph67 ], [ %.pre92, %142 ]
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %147 = sext i32 %146 to i64
  %.not.not = icmp slt i64 %indvars.iv82, %147
  br i1 %.not.not, label %.lr.ph67, label %._crit_edge68, !llvm.loop !22
}

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

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

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

; 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 @_ZNK5PointmiERKS_(ptr dead_on_unwind noalias writable sret(%struct.Point) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS5Point", !6, i64 0, !10, i64 8, !10, i64 16}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!12, !10, i64 8}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = !{!12, !10, i64 16}
!19 = distinct !{!19, !14, !20}
!20 = !{!"llvm.loop.peeled.count", i32 1}
!21 = distinct !{!21, !14, !20}
!22 = distinct !{!22, !14}


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