; LLVM IR from tangjz/acm-icpc :: codechef/OCT13 (KMHAMHA)

; 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.Point = type { i32, i32 }

@g = external dso_local global [1001 x %"class.std::vector"], align 16
@n = external dso_local global i32, align 4
@match = external dso_local global [1001 x i32], align 16
@vis = external dso_local global [1001 x i8], align 16
@x = external dso_local global [1001 x %struct.Point], align 16
@y = external dso_local global [1001 x %struct.Point], align 16
@point = external dso_local global [1001 x [2 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

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

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

14:                                               ; preds = %157, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = add nsw i32 %15, -1
  store i32 %16, ptr %2, align 4, !tbaa !5
  %17 = icmp ne i32 %15, 0
  br i1 %17, label %18, label %160

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %40, %18
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %24, label %43

24:                                               ; preds = %20
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %26 = getelementptr inbounds %struct.Point, ptr %9, i32 0, i32 0
  %27 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %27, ptr %26, align 4, !tbaa !9
  %28 = getelementptr inbounds %struct.Point, ptr %9, i32 0, i32 1
  %29 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %29, ptr %28, align 4, !tbaa !11
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1001 x %struct.Point], ptr @x, i64 0, i64 %31
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %32, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %33 = getelementptr inbounds %struct.Point, ptr %10, i32 0, i32 0
  %34 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %34, ptr %33, align 4, !tbaa !9
  %35 = getelementptr inbounds %struct.Point, ptr %10, i32 0, i32 1
  %36 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %36, ptr %35, align 4, !tbaa !11
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [1001 x %struct.Point], ptr @y, i64 0, i64 %38
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %39, ptr align 4 %10, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %40

40:                                               ; preds = %24
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %3, align 4, !tbaa !5
  br label %20, !llvm.loop !13

43:                                               ; preds = %20
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds %struct.Point, ptr @x, i64 %45
  call void @_ZSt4sortIP5PointPFbRKS0_S3_EEvT_S6_T0_(ptr noundef @x, ptr noundef %46, ptr noundef @_Z3cmpRK5PointS1_)
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds %struct.Point, ptr @y, i64 %48
  call void @_ZSt4sortIP5PointPFbRKS0_S3_EEvT_S6_T0_(ptr noundef @y, ptr noundef %49, ptr noundef @_Z3cmpRK5PointS1_)
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %105, %43
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %54, label %108

54:                                               ; preds = %50
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [1001 x %struct.Point], ptr @x, i64 0, i64 %57
  %59 = getelementptr inbounds %struct.Point, ptr %58, i32 0, i32 1
  %60 = load i32, ptr %59, align 4, !tbaa !11
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1001 x [2 x i32]], ptr @point, i64 0, i64 %61
  %63 = getelementptr inbounds [2 x i32], ptr %62, i64 0, i64 0
  store i32 %55, ptr %63, align 8, !tbaa !5
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1001 x %struct.Point], ptr @y, i64 0, i64 %66
  %68 = getelementptr inbounds %struct.Point, ptr %67, i32 0, i32 1
  %69 = load i32, ptr %68, align 4, !tbaa !11
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1001 x [2 x i32]], ptr @point, i64 0, i64 %70
  %72 = getelementptr inbounds [2 x i32], ptr %71, i64 0, i64 1
  store i32 %64, ptr %72, align 4, !tbaa !5
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [1001 x %struct.Point], ptr @x, i64 0, i64 %74
  %76 = getelementptr inbounds %struct.Point, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 8, !tbaa !9
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1001 x %struct.Point], ptr @x, i64 0, i64 %80
  %82 = getelementptr inbounds %struct.Point, ptr %81, i32 0, i32 0
  %83 = load i32, ptr %82, align 8, !tbaa !9
  %84 = icmp ne i32 %77, %83
  br i1 %84, label %85, label %88

85:                                               ; preds = %54
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %6, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %85, %54
  %89 = load i32, ptr %3, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [1001 x %struct.Point], ptr @y, i64 0, i64 %90
  %92 = getelementptr inbounds %struct.Point, ptr %91, i32 0, i32 0
  %93 = load i32, ptr %92, align 8, !tbaa !9
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1001 x %struct.Point], ptr @y, i64 0, i64 %96
  %98 = getelementptr inbounds %struct.Point, ptr %97, i32 0, i32 0
  %99 = load i32, ptr %98, align 8, !tbaa !9
  %100 = icmp ne i32 %93, %99
  br i1 %100, label %101, label %104

101:                                              ; preds = %88
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %7, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %101, %88
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %3, align 4, !tbaa !5
  br label %50, !llvm.loop !15

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

109:                                              ; preds = %118, %108
  %110 = load i32, ptr %11, align 4, !tbaa !5
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = icmp sle i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %121

114:                                              ; preds = %109
  %115 = load i32, ptr %11, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %116
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %117) #8
  br label %118

118:                                              ; preds = %114
  %119 = load i32, ptr %11, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %11, align 4, !tbaa !5
  br label %109, !llvm.loop !16

121:                                              ; preds = %113
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %138, %121
  %123 = load i32, ptr %3, align 4, !tbaa !5
  %124 = load i32, ptr @n, align 4, !tbaa !5
  %125 = icmp slt i32 %123, %124
  br i1 %125, label %126, label %141

126:                                              ; preds = %122
  %127 = load i32, ptr %3, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [1001 x [2 x i32]], ptr @point, i64 0, i64 %128
  %130 = getelementptr inbounds [2 x i32], ptr %129, i64 0, i64 0
  %131 = load i32, ptr %130, align 8, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %132
  %134 = load i32, ptr %3, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [1001 x [2 x i32]], ptr @point, i64 0, i64 %135
  %137 = getelementptr inbounds [2 x i32], ptr %136, i64 0, i64 1
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %133, ptr noundef nonnull align 4 dereferenceable(4) %137)
  br label %138

138:                                              ; preds = %126
  %139 = load i32, ptr %3, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %3, align 4, !tbaa !5
  br label %122, !llvm.loop !17

141:                                              ; preds = %122
  call void @llvm.memset.p0.i64(ptr align 16 @match, i8 -1, i64 4004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %154, %141
  %143 = load i32, ptr %12, align 4, !tbaa !5
  %144 = load i32, ptr %6, align 4, !tbaa !5
  %145 = icmp sle i32 %143, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %157

147:                                              ; preds = %142
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 1001, i1 false)
  %148 = load i32, ptr %12, align 4, !tbaa !5
  %149 = call noundef zeroext i1 @_Z3dfsi(i32 noundef %148)
  br i1 %149, label %150, label %153

150:                                              ; preds = %147
  %151 = load i32, ptr %8, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %8, align 4, !tbaa !5
  br label %153

153:                                              ; preds = %150, %147
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %12, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %12, align 4, !tbaa !5
  br label %142, !llvm.loop !18

157:                                              ; preds = %146
  %158 = load i32, ptr %8, align 4, !tbaa !5
  %159 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %158)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %14, !llvm.loop !19

160:                                              ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  ret i32 0
}

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

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

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

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

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

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

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

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

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

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


; 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.Point = type { i32, i32 }

@g = external dso_local global [1001 x %"class.std::vector"], align 16
@n = external dso_local global i32, align 4
@match = external dso_local local_unnamed_addr global [1001 x i32], align 16
@vis = external dso_local local_unnamed_addr global [1001 x i8], align 16
@x = external dso_local global [1001 x %struct.Point], align 16
@y = external dso_local global [1001 x %struct.Point], align 16
@point = external dso_local global [1001 x [2 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = add nsw i32 %5, -1
  store i32 %6, ptr %1, align 4, !tbaa !5
  %.not62 = icmp eq i32 %5, 0
  br i1 %.not62, label %._crit_edge65, label %.lr.ph64

.lr.ph64:                                         ; preds = %0, %54
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %.lr.ph64.._crit_edge_crit_edge

.lr.ph64.._crit_edge_crit_edge:                   ; preds = %.lr.ph64
  %.pre81 = sext i32 %8 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph64, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph64 ]
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = getelementptr inbounds [1001 x %struct.Point], ptr @x, i64 0, i64 %indvars.iv
  store i32 %11, ptr %12, align 8, !tbaa !5
  %.sroa.47.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 4
  %13 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %13, ptr %.sroa.47.0..sroa_idx, align 4, !tbaa !5
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = getelementptr inbounds [1001 x %struct.Point], ptr @y, i64 0, i64 %indvars.iv
  store i32 %14, ptr %15, align 8, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 4
  store i32 %13, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %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 !9

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph64.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre81, %.lr.ph64.._crit_edge_crit_edge ], [ %17, %.lr.ph ]
  %19 = getelementptr inbounds %struct.Point, ptr @x, i64 %.pre-phi
  call void @_ZSt4sortIP5PointPFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull @x, ptr noundef nonnull %19, ptr noundef nonnull @_Z3cmpRK5PointS1_)
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds %struct.Point, ptr @y, i64 %21
  call void @_ZSt4sortIP5PointPFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull @y, ptr noundef nonnull %22, ptr noundef nonnull @_Z3cmpRK5PointS1_)
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph54.preheader, label %.preheader48

.lr.ph54.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %23 to i64
  %.pre = load i32, ptr @x, align 16, !tbaa !11
  %.pre80 = load i32, ptr @y, align 16, !tbaa !11
  br label %.lr.ph54

.preheader48:                                     ; preds = %.lr.ph54, %._crit_edge
  %.036.lcssa = phi i32 [ 0, %._crit_edge ], [ %spec.select, %.lr.ph54 ]
  %25 = add nuw i32 %.036.lcssa, 1
  %wide.trip.count74 = zext i32 %25 to i64
  br label %44

.lr.ph54:                                         ; preds = %.lr.ph54.preheader, %.lr.ph54
  %26 = phi i32 [ %.pre80, %.lr.ph54.preheader ], [ %40, %.lr.ph54 ]
  %27 = phi i32 [ %.pre, %.lr.ph54.preheader ], [ %37, %.lr.ph54 ]
  %indvars.iv68 = phi i64 [ 0, %.lr.ph54.preheader ], [ %indvars.iv.next69, %.lr.ph54 ]
  %.03651 = phi i32 [ 0, %.lr.ph54.preheader ], [ %spec.select, %.lr.ph54 ]
  %.03850 = phi i32 [ 0, %.lr.ph54.preheader ], [ %.139, %.lr.ph54 ]
  %28 = getelementptr inbounds [1001 x %struct.Point], ptr @x, i64 0, i64 %indvars.iv68, i32 1
  %29 = load i32, ptr %28, align 4, !tbaa !13
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [1001 x [2 x i32]], ptr @point, i64 0, i64 %30
  store i32 %.03651, ptr %31, align 8, !tbaa !5
  %32 = getelementptr inbounds [1001 x %struct.Point], ptr @y, i64 0, i64 %indvars.iv68, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !13
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [1001 x [2 x i32]], ptr @point, i64 0, i64 %34, i64 1
  store i32 %.03850, ptr %35, align 4, !tbaa !5
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %36 = getelementptr inbounds [1001 x %struct.Point], ptr @x, i64 0, i64 %indvars.iv.next69
  %37 = load i32, ptr %36, align 8, !tbaa !11
  %.not45 = icmp ne i32 %27, %37
  %38 = zext i1 %.not45 to i32
  %spec.select = add nuw nsw i32 %.03651, %38
  %39 = getelementptr inbounds [1001 x %struct.Point], ptr @y, i64 0, i64 %indvars.iv.next69
  %40 = load i32, ptr %39, align 8, !tbaa !11
  %.not46 = icmp ne i32 %26, %40
  %41 = zext i1 %.not46 to i32
  %.139 = add nuw nsw i32 %.03850, %41
  %exitcond.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count
  br i1 %exitcond.not, label %.preheader48, label %.lr.ph54, !llvm.loop !14

.preheader:                                       ; preds = %44
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.lr.ph58, label %._crit_edge59

44:                                               ; preds = %.preheader48, %44
  %indvars.iv71 = phi i64 [ 0, %.preheader48 ], [ %indvars.iv.next72, %44 ]
  %45 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %indvars.iv71
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #7
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
  br i1 %exitcond75.not, label %.preheader, label %44, !llvm.loop !15

.lr.ph58:                                         ; preds = %.preheader, %.lr.ph58
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %.lr.ph58 ], [ 0, %.preheader ]
  %46 = getelementptr inbounds [1001 x [2 x i32]], ptr @point, i64 0, i64 %indvars.iv76
  %47 = load i32, ptr %46, align 8, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %48
  %50 = getelementptr inbounds i8, ptr %46, i64 4
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %49, ptr noundef nonnull align 4 dereferenceable(4) %50)
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = icmp slt i64 %indvars.iv.next77, %52
  br i1 %53, label %.lr.ph58, label %._crit_edge59, !llvm.loop !16

._crit_edge59:                                    ; preds = %.lr.ph58, %.preheader
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) @match, i8 -1, i64 4004, i1 false)
  br label %58

54:                                               ; preds = %58
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.select47)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %56 = load i32, ptr %1, align 4, !tbaa !5
  %57 = add nsw i32 %56, -1
  store i32 %57, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %56, 0
  br i1 %.not, label %._crit_edge65, label %.lr.ph64, !llvm.loop !17

58:                                               ; preds = %._crit_edge59, %58
  %.061 = phi i32 [ 0, %._crit_edge59 ], [ %61, %58 ]
  %.04060 = phi i32 [ 0, %._crit_edge59 ], [ %spec.select47, %58 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) @vis, i8 0, i64 1001, i1 false)
  %59 = call noundef zeroext i1 @_Z3dfsi(i32 noundef %.061)
  %60 = zext i1 %59 to i32
  %spec.select47 = add nuw nsw i32 %.04060, %60
  %61 = add nuw i32 %.061, 1
  %exitcond79.not = icmp eq i32 %.061, %.036.lcssa
  br i1 %exitcond79.not, label %54, label %58, !llvm.loop !18

._crit_edge65:                                    ; preds = %54, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

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

; 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 uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

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

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

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

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

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


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