; LLVM IR from tangjz/acm-icpc :: codeforces (852H)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@qtot = external dso_local global i32, align 4
@etot = external dso_local global i32, align 4
@p = external dso_local global [201 x %struct.Point], align 16
@q = external dso_local global [201 x %struct.Point], align 16
@e = external dso_local global [20100 x %struct.Edge], align 16
@f = external dso_local global [201 x [51 x i64]], align 16
@ans = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRK5PointS1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #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 %struct.Point, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.Edge, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.Point, align 4
  %12 = alloca %struct.Point, align 4
  %13 = alloca %struct.Edge, align 4
  %14 = alloca %struct.Edge, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, 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
  store i32 0, ptr %1, align 4
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %32, %0
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %35

28:                                               ; preds = %23
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [201 x %struct.Point], ptr @p, i64 0, i64 %30
  call void @_ZN5Point4readEv(ptr noundef nonnull align 4 dereferenceable(8) %31)
  br label %32

32:                                               ; preds = %28
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %23, !llvm.loop !9

35:                                               ; preds = %27
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds %struct.Point, ptr @p, i64 %37
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef @p, ptr noundef %38)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %261, %35
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %264

44:                                               ; preds = %39
  store i32 0, ptr @etot, align 4, !tbaa !5
  store i32 0, ptr @qtot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %45 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %45, ptr %5, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %63, %44
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %66

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [201 x %struct.Point], ptr @p, i64 0, i64 %53
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [201 x %struct.Point], ptr @p, i64 0, i64 %56
  %58 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %54, ptr noundef nonnull align 4 dereferenceable(8) %57)
  store i64 %58, ptr %6, align 4
  %59 = load i32, ptr @qtot, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr @qtot, align 4, !tbaa !5
  %61 = sext i32 %59 to i64
  %62 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %61
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %62, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %63

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

66:                                               ; preds = %50
  %67 = load i32, ptr @qtot, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds %struct.Point, ptr @q, i64 %68
  call void @_ZSt4sortIP5PointPFbRKS0_S3_EEvT_S6_T0_(ptr noundef getelementptr inbounds (%struct.Point, ptr @q, i64 1), ptr noundef %69, ptr noundef @_Z3cmpRK5PointS1_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %148, %66
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = load i32, ptr @qtot, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %151

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #7
  %76 = getelementptr inbounds %struct.Edge, ptr %8, i32 0, i32 0
  store i32 0, ptr %76, align 4, !tbaa !13
  %77 = getelementptr inbounds %struct.Edge, ptr %8, i32 0, i32 1
  %78 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %78, ptr %77, align 4, !tbaa !16
  %79 = getelementptr inbounds %struct.Edge, ptr %8, i32 0, i32 2
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %81
  %83 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %82, ptr noundef nonnull align 4 dereferenceable(8) @q)
  store i64 %83, ptr %79, align 4
  %84 = load i32, ptr @etot, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr @etot, align 4, !tbaa !5
  %86 = sext i32 %84 to i64
  %87 = getelementptr inbounds [20100 x %struct.Edge], ptr @e, i64 0, i64 %86
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %87, ptr align 4 %8, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %90 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %90, ptr %10, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %132, %75
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = load i32, ptr @qtot, align 4, !tbaa !5
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %135

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %98
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %101
  %103 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %99, ptr noundef nonnull align 4 dereferenceable(8) %102)
  store i64 %103, ptr %11, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %105
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %108
  %110 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %106, ptr noundef nonnull align 4 dereferenceable(8) %109)
  store i64 %110, ptr %12, align 4
  %111 = call noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %12)
  %112 = icmp sle i64 %111, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br i1 %112, label %113, label %131

113:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  %114 = getelementptr inbounds %struct.Edge, ptr %13, i32 0, i32 0
  %115 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %115, ptr %114, align 4, !tbaa !13
  %116 = getelementptr inbounds %struct.Edge, ptr %13, i32 0, i32 1
  %117 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %117, ptr %116, align 4, !tbaa !16
  %118 = getelementptr inbounds %struct.Edge, ptr %13, i32 0, i32 2
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %120
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %123
  %125 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %121, ptr noundef nonnull align 4 dereferenceable(8) %124)
  store i64 %125, ptr %118, align 4
  %126 = load i32, ptr @etot, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr @etot, align 4, !tbaa !5
  %128 = sext i32 %126 to i64
  %129 = getelementptr inbounds [20100 x %struct.Edge], ptr @e, i64 0, i64 %128
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %129, ptr align 4 %13, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  %130 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %130, ptr %10, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %113, %96
  br label %132

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

135:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  %136 = getelementptr inbounds %struct.Edge, ptr %14, i32 0, i32 0
  %137 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %137, ptr %136, align 4, !tbaa !13
  %138 = getelementptr inbounds %struct.Edge, ptr %14, i32 0, i32 1
  store i32 0, ptr %138, align 4, !tbaa !16
  %139 = getelementptr inbounds %struct.Edge, ptr %14, i32 0, i32 2
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %141
  %143 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) @q, ptr noundef nonnull align 4 dereferenceable(8) %142)
  store i64 %143, ptr %139, align 4
  %144 = load i32, ptr @etot, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr @etot, align 4, !tbaa !5
  %146 = sext i32 %144 to i64
  %147 = getelementptr inbounds [20100 x %struct.Edge], ptr @e, i64 0, i64 %146
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %147, ptr align 4 %14, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  br label %148

148:                                              ; preds = %135
  %149 = load i32, ptr %7, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %7, align 4, !tbaa !5
  br label %70, !llvm.loop !19

151:                                              ; preds = %74
  %152 = load i32, ptr @etot, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds %struct.Edge, ptr @e, i64 %153
  call void @_ZSt4sortIP4EdgeEvT_S2_(ptr noundef @e, ptr noundef %154)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %177, %151
  %156 = load i32, ptr %15, align 4, !tbaa !5
  %157 = load i32, ptr @qtot, align 4, !tbaa !5
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %155
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %180

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

161:                                              ; preds = %173, %160
  %162 = load i32, ptr %16, align 4, !tbaa !5
  %163 = load i32, ptr @m, align 4, !tbaa !5
  %164 = icmp sle i32 %162, %163
  br i1 %164, label %166, label %165

165:                                              ; preds = %161
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %176

166:                                              ; preds = %161
  %167 = load i32, ptr %15, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [201 x [51 x i64]], ptr @f, i64 0, i64 %168
  %170 = load i32, ptr %16, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [51 x i64], ptr %169, i64 0, i64 %171
  store i64 -4557430888798830399, ptr %172, align 8, !tbaa !20
  br label %173

173:                                              ; preds = %166
  %174 = load i32, ptr %16, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %16, align 4, !tbaa !5
  br label %161, !llvm.loop !22

176:                                              ; preds = %165
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %15, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %15, align 4, !tbaa !5
  br label %155, !llvm.loop !23

180:                                              ; preds = %159
  store i64 0, ptr @f, align 16, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %181

181:                                              ; preds = %243, %180
  %182 = load i32, ptr %17, align 4, !tbaa !5
  %183 = load i32, ptr @etot, align 4, !tbaa !5
  %184 = icmp slt i32 %182, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %181
  store i32 23, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %246

186:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %187 = load i32, ptr %17, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [20100 x %struct.Edge], ptr @e, i64 0, i64 %188
  %190 = getelementptr inbounds %struct.Edge, ptr %189, i32 0, i32 0
  %191 = load i32, ptr %190, align 16, !tbaa !13
  store i32 %191, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %192 = load i32, ptr %17, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [20100 x %struct.Edge], ptr @e, i64 0, i64 %193
  %195 = getelementptr inbounds %struct.Edge, ptr %194, i32 0, i32 1
  %196 = load i32, ptr %195, align 4, !tbaa !16
  store i32 %196, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 1, ptr %20, align 4, !tbaa !5
  br label %197

197:                                              ; preds = %239, %186
  %198 = load i32, ptr %20, align 4, !tbaa !5
  %199 = load i32, ptr @m, align 4, !tbaa !5
  %200 = icmp sle i32 %198, %199
  br i1 %200, label %202, label %201

201:                                              ; preds = %197
  store i32 26, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %242

202:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %203 = load i32, ptr %18, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [201 x [51 x i64]], ptr @f, i64 0, i64 %204
  %206 = load i32, ptr %20, align 4, !tbaa !5
  %207 = sub nsw i32 %206, 1
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [51 x i64], ptr %205, i64 0, i64 %208
  %210 = load i64, ptr %209, align 8, !tbaa !20
  %211 = load i32, ptr %18, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %212
  %214 = load i32, ptr %19, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %215
  %217 = call noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %213, ptr noundef nonnull align 4 dereferenceable(8) %216)
  %218 = add nsw i64 %210, %217
  store i64 %218, ptr %21, align 8, !tbaa !20
  %219 = load i32, ptr %19, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [201 x [51 x i64]], ptr @f, i64 0, i64 %220
  %222 = load i32, ptr %20, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [51 x i64], ptr %221, i64 0, i64 %223
  %225 = load i64, ptr %224, align 8, !tbaa !20
  %226 = load i64, ptr %21, align 8, !tbaa !20
  %227 = icmp slt i64 %225, %226
  br i1 %227, label %228, label %237

228:                                              ; preds = %202
  %229 = load i64, ptr %21, align 8, !tbaa !20
  %230 = load i32, ptr %19, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [201 x [51 x i64]], ptr @f, i64 0, i64 %231
  %233 = load i32, ptr %20, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [51 x i64], ptr %232, i64 0, i64 %234
  store i64 %229, ptr %235, align 8, !tbaa !20
  %236 = icmp ne i64 %229, 0
  br label %237

237:                                              ; preds = %228, %202
  %238 = phi i1 [ false, %202 ], [ %236, %228 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %239

239:                                              ; preds = %237
  %240 = load i32, ptr %20, align 4, !tbaa !5
  %241 = add nsw i32 %240, 1
  store i32 %241, ptr %20, align 4, !tbaa !5
  br label %197, !llvm.loop !24

242:                                              ; preds = %201
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %243

243:                                              ; preds = %242
  %244 = load i32, ptr %17, align 4, !tbaa !5
  %245 = add nsw i32 %244, 1
  store i32 %245, ptr %17, align 4, !tbaa !5
  br label %181, !llvm.loop !25

246:                                              ; preds = %185
  %247 = load i64, ptr @ans, align 8, !tbaa !20
  %248 = load i32, ptr @m, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [51 x i64], ptr @f, i64 0, i64 %249
  %251 = load i64, ptr %250, align 8, !tbaa !20
  %252 = icmp slt i64 %247, %251
  br i1 %252, label %253, label %259

253:                                              ; preds = %246
  %254 = load i32, ptr @m, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [51 x i64], ptr @f, i64 0, i64 %255
  %257 = load i64, ptr %256, align 8, !tbaa !20
  store i64 %257, ptr @ans, align 8, !tbaa !20
  %258 = icmp ne i64 %257, 0
  br label %259

259:                                              ; preds = %253, %246
  %260 = phi i1 [ false, %246 ], [ %258, %253 ]
  br label %261

261:                                              ; preds = %259
  %262 = load i32, ptr %3, align 4, !tbaa !5
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr %3, align 4, !tbaa !5
  br label %39, !llvm.loop !26

264:                                              ; preds = %43
  %265 = load i64, ptr @ans, align 8, !tbaa !20
  %266 = ashr i64 %265, 1
  %267 = load i64, ptr @ans, align 8, !tbaa !20
  %268 = and i64 %267, 1
  %269 = getelementptr inbounds [3 x i8], ptr @.str.2, i64 0, i64 %268
  %270 = load i8, ptr %269, align 1, !tbaa !27
  %271 = sext i8 %270 to i32
  %272 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %266, i32 noundef %271)
  ret i32 0
}

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

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

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

; 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 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5PointPFbRKS0_S3_EEvT_S6_T0_(ptr noundef, ptr noundef, ptr noundef) #5

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

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 = { 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 = { 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 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4, !15, i64 8}
!15 = !{!"_ZTS5Point", !6, i64 0, !6, i64 4}
!16 = !{!14, !6, i64 4}
!17 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = !{!21, !21, i64 0}
!21 = !{!"long long", !7, i64 0}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = !{!7, !7, i64 0}


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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@qtot = external dso_local local_unnamed_addr global i32, align 4
@etot = external dso_local local_unnamed_addr global i32, align 4
@p = external dso_local global [201 x %struct.Point], align 16
@q = external dso_local global [201 x %struct.Point], align 16
@e = external dso_local global [20100 x %struct.Edge], align 16
@f = external dso_local local_unnamed_addr global [201 x [51 x i64]], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRK5PointS1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %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, ptr noundef nonnull @m)
  %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
  %.pre139 = sext i32 %4 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre139, %.._crit_edge_crit_edge ], [ %11, %.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.ph102, label %._crit_edge.._crit_edge103_crit_edge

._crit_edge.._crit_edge103_crit_edge:             ; preds = %._crit_edge
  %.pre138 = load i64, ptr @ans, align 8, !tbaa !9
  br label %._crit_edge103

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %9 = getelementptr inbounds [201 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv
  tail call void @_ZN5Point4readEv(ptr noundef nonnull align 4 dereferenceable(8) %9)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = icmp slt i64 %indvars.iv.next, %11
  br i1 %12, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge103:                                   ; preds = %121, %._crit_edge.._crit_edge103_crit_edge
  %13 = phi i64 [ %.pre138, %._crit_edge.._crit_edge103_crit_edge ], [ %122, %121 ]
  %14 = ashr i64 %13, 1
  %15 = and i64 %13, 1
  %16 = getelementptr inbounds [3 x i8], ptr @.str.2, i64 0, i64 %15
  %17 = load i8, ptr %16, align 1, !tbaa !13
  %18 = sext i8 %17 to i32
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %14, i32 noundef %18)
  ret i32 0

.lr.ph102:                                        ; preds = %._crit_edge, %121
  %20 = phi i32 [ %123, %121 ], [ %7, %._crit_edge ]
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %121 ], [ 0, %._crit_edge ]
  store i32 0, ptr @etot, align 4, !tbaa !5
  store i32 0, ptr @qtot, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv107, %21
  br i1 %22, label %.lr.ph74, label %._crit_edge75

.lr.ph74:                                         ; preds = %.lr.ph102
  %23 = getelementptr inbounds [201 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv107
  br label %29

._crit_edge75:                                    ; preds = %29, %.lr.ph102
  %24 = phi i32 [ 0, %.lr.ph102 ], [ %33, %29 ]
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds %struct.Point, ptr @q, i64 %25
  call void @_ZSt4sortIP5PointPFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @q, i64 8), ptr noundef nonnull %26, ptr noundef nonnull @_Z3cmpRK5PointS1_)
  %27 = load i32, ptr @qtot, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, 1
  br i1 %28, label %.lr.ph83, label %._crit_edge75.._crit_edge84_crit_edge

._crit_edge75.._crit_edge84_crit_edge:            ; preds = %._crit_edge75
  %.pre = load i32, ptr @etot, align 4, !tbaa !5
  br label %._crit_edge84

29:                                               ; preds = %.lr.ph74, %29
  %indvars.iv109 = phi i64 [ %indvars.iv107, %.lr.ph74 ], [ %indvars.iv.next110, %29 ]
  %30 = getelementptr inbounds [201 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv109
  %31 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %30, ptr noundef nonnull align 4 dereferenceable(8) %23)
  %32 = load i32, ptr @qtot, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr @qtot, align 4, !tbaa !5
  %34 = sext i32 %32 to i64
  %35 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %34
  store i64 %31, ptr %35, align 8
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = trunc nuw i64 %indvars.iv.next110 to i32
  %38 = icmp sgt i32 %36, %37
  br i1 %38, label %29, label %._crit_edge75, !llvm.loop !14

._crit_edge84:                                    ; preds = %._crit_edge80, %._crit_edge75.._crit_edge84_crit_edge
  %39 = phi i32 [ %.pre, %._crit_edge75.._crit_edge84_crit_edge ], [ %57, %._crit_edge80 ]
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %struct.Edge, ptr @e, i64 %40
  call void @_ZSt4sortIP4EdgeEvT_S2_(ptr noundef nonnull @e, ptr noundef nonnull %41)
  %42 = load i32, ptr @qtot, align 4, !tbaa !5
  %43 = icmp slt i32 %42, 1
  %.pre137.pre = load i32, ptr @m, align 4, !tbaa !5
  %.not7085 = icmp slt i32 %.pre137.pre, 0
  %or.cond = select i1 %43, i1 true, i1 %.not7085
  br i1 %or.cond, label %._crit_edge90, label %.preheader.preheader

.preheader.preheader:                             ; preds = %._crit_edge84
  %44 = add nuw i32 %.pre137.pre, 1
  %wide.trip.count126 = zext nneg i32 %42 to i64
  %wide.trip.count = zext i32 %44 to i64
  %min.iters.check = icmp ult i32 %.pre137.pre, 3
  %n.vec = and i64 %wide.trip.count, 4294967292
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br label %.preheader

.lr.ph83:                                         ; preds = %._crit_edge75, %._crit_edge80
  %indvars.iv117 = phi i64 [ %indvars.iv.next118, %._crit_edge80 ], [ 1, %._crit_edge75 ]
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %._crit_edge80 ], [ 2, %._crit_edge75 ]
  %45 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %indvars.iv117
  %46 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %45, ptr noundef nonnull align 4 dereferenceable(8) @q)
  %47 = load i32, ptr @etot, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr @etot, align 4, !tbaa !5
  %49 = sext i32 %47 to i64
  %50 = getelementptr inbounds [20100 x %struct.Edge], ptr @e, i64 0, i64 %49
  store i32 0, ptr %50, align 16, !tbaa !5
  %.sroa.433.0..sroa_idx = getelementptr inbounds i8, ptr %50, i64 4
  %51 = trunc nuw nsw i64 %indvars.iv117 to i32
  store i32 %51, ptr %.sroa.433.0..sroa_idx, align 4, !tbaa !5
  %.sroa.534.0..sroa_idx = getelementptr inbounds i8, ptr %50, i64 8
  store i64 %46, ptr %.sroa.534.0..sroa_idx, align 8
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %52 = load i32, ptr @qtot, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = icmp slt i64 %indvars.iv.next118, %53
  br i1 %54, label %.lr.ph79, label %._crit_edge80

._crit_edge80:                                    ; preds = %77, %.lr.ph83
  %55 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) @q, ptr noundef nonnull align 4 dereferenceable(8) %45)
  %56 = load i32, ptr @etot, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr @etot, align 4, !tbaa !5
  %58 = sext i32 %56 to i64
  %59 = getelementptr inbounds [20100 x %struct.Edge], ptr @e, i64 0, i64 %58
  store i32 %51, ptr %59, align 16, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %59, i64 4
  store i32 0, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %59, i64 8
  store i64 %55, ptr %.sroa.5.0..sroa_idx, align 8
  %60 = load i32, ptr @qtot, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next118, %61
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  br i1 %62, label %.lr.ph83, label %._crit_edge84, !llvm.loop !15

.lr.ph79:                                         ; preds = %.lr.ph83, %77
  %indvars.iv114 = phi i64 [ %indvars.iv.next115, %77 ], [ %indvars.iv112, %.lr.ph83 ]
  %.06676 = phi i32 [ %.1, %77 ], [ %51, %.lr.ph83 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %63 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %indvars.iv114
  %64 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %63, ptr noundef nonnull align 4 dereferenceable(8) %45)
  store i64 %64, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %65 = sext i32 %.06676 to i64
  %66 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %65
  %67 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %66, ptr noundef nonnull align 4 dereferenceable(8) %45)
  store i64 %67, ptr %2, align 8
  %68 = call noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
  %69 = icmp slt i64 %68, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  br i1 %69, label %70, label %77

70:                                               ; preds = %.lr.ph79
  %71 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %63, ptr noundef nonnull align 4 dereferenceable(8) %45)
  %72 = load i32, ptr @etot, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr @etot, align 4, !tbaa !5
  %74 = sext i32 %72 to i64
  %75 = getelementptr inbounds [20100 x %struct.Edge], ptr @e, i64 0, i64 %74
  store i32 %51, ptr %75, align 16, !tbaa !5
  %.sroa.423.0..sroa_idx = getelementptr inbounds i8, ptr %75, i64 4
  %76 = trunc nuw nsw i64 %indvars.iv114 to i32
  store i32 %76, ptr %.sroa.423.0..sroa_idx, align 4, !tbaa !5
  %.sroa.524.0..sroa_idx = getelementptr inbounds i8, ptr %75, i64 8
  store i64 %71, ptr %.sroa.524.0..sroa_idx, align 8
  br label %77

77:                                               ; preds = %.lr.ph79, %70
  %.1 = phi i32 [ %76, %70 ], [ %.06676, %.lr.ph79 ]
  %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
  %78 = load i32, ptr @qtot, align 4, !tbaa !5
  %79 = trunc nuw i64 %indvars.iv.next115 to i32
  %80 = icmp sgt i32 %78, %79
  br i1 %80, label %.lr.ph79, label %._crit_edge80, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge88
  %indvars.iv123 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next124, %._crit_edge88 ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader
  %indvars.iv120.ph = phi i64 [ 0, %.preheader ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.body:                                      ; preds = %.preheader, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader ]
  %81 = getelementptr inbounds [201 x [51 x i64]], ptr @f, i64 0, i64 %indvars.iv123, i64 %index
  %82 = getelementptr inbounds i8, ptr %81, i64 16
  store <2 x i64> <i64 -4557430888798830399, i64 -4557430888798830399>, ptr %81, align 8, !tbaa !9
  store <2 x i64> <i64 -4557430888798830399, i64 -4557430888798830399>, ptr %82, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %83 = icmp eq i64 %index.next, %n.vec
  br i1 %83, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge88, label %scalar.ph.preheader

._crit_edge90:                                    ; preds = %._crit_edge88, %._crit_edge84
  store i64 0, ptr @f, align 16, !tbaa !9
  %84 = load i32, ptr @etot, align 4, !tbaa !5
  %85 = icmp sgt i32 %84, 0
  br i1 %85, label %.lr.ph98, label %._crit_edge99

._crit_edge88:                                    ; preds = %scalar.ph, %middle.block
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %exitcond127.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count126
  br i1 %exitcond127.not, label %._crit_edge90, label %.preheader, !llvm.loop !20

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv120 = phi i64 [ %indvars.iv.next121, %scalar.ph ], [ %indvars.iv120.ph, %scalar.ph.preheader ]
  %86 = getelementptr inbounds [201 x [51 x i64]], ptr @f, i64 0, i64 %indvars.iv123, i64 %indvars.iv120
  store i64 -4557430888798830399, ptr %86, align 8, !tbaa !9
  %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next121, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge88, label %scalar.ph, !llvm.loop !21

._crit_edge99:                                    ; preds = %._crit_edge95, %._crit_edge90
  %87 = phi i32 [ %.pre137.pre, %._crit_edge90 ], [ %104, %._crit_edge95 ]
  %88 = load i64, ptr @ans, align 8, !tbaa !9
  %89 = sext i32 %87 to i64
  %90 = getelementptr inbounds [51 x i64], ptr @f, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = icmp slt i64 %88, %91
  br i1 %92, label %120, label %121

.lr.ph98:                                         ; preds = %._crit_edge90, %._crit_edge95
  %93 = phi i32 [ %103, %._crit_edge95 ], [ %84, %._crit_edge90 ]
  %94 = phi i32 [ %104, %._crit_edge95 ], [ %.pre137.pre, %._crit_edge90 ]
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %._crit_edge95 ], [ 0, %._crit_edge90 ]
  %.not91 = icmp slt i32 %94, 1
  br i1 %.not91, label %._crit_edge95, label %.lr.ph94

.lr.ph94:                                         ; preds = %.lr.ph98
  %95 = getelementptr inbounds [20100 x %struct.Edge], ptr @e, i64 0, i64 %indvars.iv131
  %96 = getelementptr inbounds i8, ptr %95, i64 4
  %97 = load i32, ptr %96, align 4, !tbaa !22
  %98 = load i32, ptr %95, align 16, !tbaa !25
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %99
  %101 = sext i32 %97 to i64
  %102 = getelementptr inbounds [201 x %struct.Point], ptr @q, i64 0, i64 %101
  br label %107

._crit_edge95.loopexit:                           ; preds = %117
  %.pre136 = load i32, ptr @etot, align 4, !tbaa !5
  br label %._crit_edge95

._crit_edge95:                                    ; preds = %._crit_edge95.loopexit, %.lr.ph98
  %103 = phi i32 [ %.pre136, %._crit_edge95.loopexit ], [ %93, %.lr.ph98 ]
  %104 = phi i32 [ %118, %._crit_edge95.loopexit ], [ %94, %.lr.ph98 ]
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %105 = sext i32 %103 to i64
  %106 = icmp slt i64 %indvars.iv.next132, %105
  br i1 %106, label %.lr.ph98, label %._crit_edge99, !llvm.loop !26

107:                                              ; preds = %.lr.ph94, %117
  %indvars.iv128 = phi i64 [ 1, %.lr.ph94 ], [ %indvars.iv.next129, %117 ]
  %108 = add nsw i64 %indvars.iv128, -1
  %109 = getelementptr inbounds [201 x [51 x i64]], ptr @f, i64 0, i64 %99, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !9
  %111 = call noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %100, ptr noundef nonnull align 4 dereferenceable(8) %102)
  %112 = add nsw i64 %111, %110
  %113 = getelementptr inbounds [201 x [51 x i64]], ptr @f, i64 0, i64 %101, i64 %indvars.iv128
  %114 = load i64, ptr %113, align 8, !tbaa !9
  %115 = icmp slt i64 %114, %112
  br i1 %115, label %116, label %117

116:                                              ; preds = %107
  store i64 %112, ptr %113, align 8, !tbaa !9
  br label %117

117:                                              ; preds = %116, %107
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %118 = load i32, ptr @m, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %.not.not = icmp slt i64 %indvars.iv128, %119
  br i1 %.not.not, label %107, label %._crit_edge95.loopexit, !llvm.loop !27

120:                                              ; preds = %._crit_edge99
  store i64 %91, ptr @ans, align 8, !tbaa !9
  br label %121

121:                                              ; preds = %._crit_edge99, %120
  %122 = phi i64 [ %88, %._crit_edge99 ], [ %91, %120 ]
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %123 = load i32, ptr @n, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = icmp slt i64 %indvars.iv.next108, %124
  br i1 %125, label %.lr.ph102, label %._crit_edge103, !llvm.loop !28
}

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

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

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

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

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4EdgeEvT_S2_(ptr noundef, ptr noundef) local_unnamed_addr #5

; 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 = { 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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12, !19, !18}
!22 = !{!23, !6, i64 4}
!23 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4, !24, i64 8}
!24 = !{!"_ZTS5Point", !6, i64 0, !6, i64 4}
!25 = !{!23, !6, i64 0}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}


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