; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101205A)

; 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.Asteroid = type { %"struct.Asteroid::Point", %"struct.Asteroid::Point" }
%"struct.Asteroid::Point" = type { i32, i32, i32 }
%struct.Edge = type { i32, i32 }
%struct.Event = type { double, i32, i32 }
%"struct.std::pair" = type <{ double, i32, [4 x i8] }>

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@etot = external dso_local global i32, align 4
@dsu = external dso_local global [51 x i32], align 16
@qtot = external dso_local global i32, align 4
@que = external dso_local global [51 x i32], align 16
@stim = external dso_local global i32, align 4
@vis = external dso_local global [1251 x i32], align 16
@a = external dso_local global [51 x %struct.Asteroid], align 16
@e = external dso_local global [1251 x %struct.Edge], align 16
@eve = external dso_local global [1562501 x %struct.Event], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE3las = external hidden global [51 x i32], align 16
@_ZZ4mainE3tmp = external hidden global [1251 x %"struct.std::pair"], align 16
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z9dsu_mergeii(i32 noundef, i32 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 i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.Edge, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.Asteroid::Point", align 4
  %9 = alloca { i64, i32 }, align 8
  %10 = alloca %"struct.Asteroid::Point", align 4
  %11 = alloca { i64, i32 }, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.Asteroid::Point", align 4
  %14 = alloca { i64, i32 }, align 8
  %15 = alloca %"struct.Asteroid::Point", align 4
  %16 = alloca { i64, i32 }, align 8
  %17 = alloca [3 x i32], align 4
  %18 = alloca double, align 8
  %19 = alloca %struct.Event, align 8
  %20 = alloca i64, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca %struct.Event, align 8
  %24 = alloca %struct.Event, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i8, align 1
  %34 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #11
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %579, %0
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %37 = icmp eq i32 %36, 1
  br i1 %37, label %39, label %38

38:                                               ; preds = %35
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #11
  br label %582

39:                                               ; preds = %35
  store i32 0, ptr @qtot, align 4, !tbaa !5
  store i32 0, ptr @etot, align 4, !tbaa !5
  store i32 0, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #11
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %40

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

44:                                               ; preds = %40
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #11
  br label %72

45:                                               ; preds = %40
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %47
  call void @_ZN8Asteroid4readEv(ptr noundef nonnull align 4 dereferenceable(24) %48)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #11
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %5, align 4, !tbaa !5
  br label %51

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

55:                                               ; preds = %51
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #11
  br label %68

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #11
  %57 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 0
  %58 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %58, ptr %57, align 4, !tbaa !9
  %59 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 1
  %60 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %60, ptr %59, align 4, !tbaa !11
  %61 = load i32, ptr @m, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr @m, align 4, !tbaa !5
  %63 = sext i32 %61 to i64
  %64 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %63
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %64, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #11
  br label %65

65:                                               ; preds = %56
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %5, align 4, !tbaa !5
  br label %51, !llvm.loop !13

68:                                               ; preds = %55
  br label %69

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

72:                                               ; preds = %44
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds %struct.Edge, ptr @e, i64 %74
  call void @_ZSt4sortIP4EdgeEvT_S2_(ptr noundef @e, ptr noundef %75)
  %76 = load i32, ptr @n, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = mul i64 %77, 4
  call void @llvm.memset.p0.i64(ptr align 16 @dsu, i8 -1, i64 %78, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #11
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %309, %72
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = load i32, ptr @m, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #11
  br label %312

84:                                               ; preds = %79
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %86
  %88 = getelementptr inbounds %struct.Edge, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !9
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %91
  %93 = getelementptr inbounds %struct.Edge, ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !11
  %95 = call noundef zeroext i1 @_Z9dsu_mergeii(i32 noundef %89, i32 noundef %94)
  br i1 %95, label %96, label %102

96:                                               ; preds = %84
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = load i32, ptr @qtot, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr @qtot, align 4, !tbaa !5
  %100 = sext i32 %98 to i64
  %101 = getelementptr inbounds [51 x i32], ptr @que, i64 0, i64 %100
  store i32 %97, ptr %101, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %96, %84
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #11
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %104
  %106 = getelementptr inbounds %struct.Edge, ptr %105, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !11
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %108
  %110 = getelementptr inbounds %struct.Asteroid, ptr %109, i32 0, i32 0
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %112
  %114 = getelementptr inbounds %struct.Edge, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %116
  %118 = getelementptr inbounds %struct.Asteroid, ptr %117, i32 0, i32 0
  %119 = call { i64, i32 } @_ZNK8Asteroid5PointmiERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %110, ptr noundef nonnull align 4 dereferenceable(12) %118)
  store { i64, i32 } %119, ptr %9, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 8 %9, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #11
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %121
  %123 = getelementptr inbounds %struct.Edge, ptr %122, i32 0, i32 1
  %124 = load i32, ptr %123, align 4, !tbaa !11
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %125
  %127 = getelementptr inbounds %struct.Asteroid, ptr %126, i32 0, i32 1
  %128 = load i32, ptr %7, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %129
  %131 = getelementptr inbounds %struct.Edge, ptr %130, i32 0, i32 0
  %132 = load i32, ptr %131, align 8, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %133
  %135 = getelementptr inbounds %struct.Asteroid, ptr %134, i32 0, i32 1
  %136 = call { i64, i32 } @_ZNK8Asteroid5PointmiERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %127, ptr noundef nonnull align 4 dereferenceable(12) %135)
  store { i64, i32 } %136, ptr %11, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 8 %11, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #11
  %137 = load i32, ptr %7, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %12, align 4, !tbaa !5
  br label %139

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

143:                                              ; preds = %139
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #11
  br label %308

144:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #11
  %145 = load i32, ptr %12, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %146
  %148 = getelementptr inbounds %struct.Edge, ptr %147, i32 0, i32 1
  %149 = load i32, ptr %148, align 4, !tbaa !11
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %150
  %152 = getelementptr inbounds %struct.Asteroid, ptr %151, i32 0, i32 0
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %154
  %156 = getelementptr inbounds %struct.Edge, ptr %155, i32 0, i32 0
  %157 = load i32, ptr %156, align 8, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %158
  %160 = getelementptr inbounds %struct.Asteroid, ptr %159, i32 0, i32 0
  %161 = call { i64, i32 } @_ZNK8Asteroid5PointmiERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %152, ptr noundef nonnull align 4 dereferenceable(12) %160)
  store { i64, i32 } %161, ptr %14, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 8 %14, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #11
  %162 = load i32, ptr %12, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %163
  %165 = getelementptr inbounds %struct.Edge, ptr %164, i32 0, i32 1
  %166 = load i32, ptr %165, align 4, !tbaa !11
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %167
  %169 = getelementptr inbounds %struct.Asteroid, ptr %168, i32 0, i32 1
  %170 = load i32, ptr %12, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %171
  %173 = getelementptr inbounds %struct.Edge, ptr %172, i32 0, i32 0
  %174 = load i32, ptr %173, align 8, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %175
  %177 = getelementptr inbounds %struct.Asteroid, ptr %176, i32 0, i32 1
  %178 = call { i64, i32 } @_ZNK8Asteroid5PointmiERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %169, ptr noundef nonnull align 4 dereferenceable(12) %177)
  store { i64, i32 } %178, ptr %16, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 8 %16, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #11
  %179 = call noundef i32 @_ZNK8Asteroid5Point4len2Ev(ptr noundef nonnull align 4 dereferenceable(12) %13)
  %180 = call noundef i32 @_ZNK8Asteroid5Point4len2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8)
  %181 = sub nsw i32 %179, %180
  store i32 %181, ptr %17, align 4, !tbaa !5
  %182 = getelementptr inbounds i32, ptr %17, i64 1
  %183 = call noundef i32 @_ZNK8Asteroid5Point3dotERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %15)
  %184 = call noundef i32 @_ZNK8Asteroid5Point3dotERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %10)
  %185 = sub nsw i32 %183, %184
  %186 = shl i32 %185, 1
  store i32 %186, ptr %182, align 4, !tbaa !5
  %187 = getelementptr inbounds i32, ptr %17, i64 2
  %188 = call noundef i32 @_ZNK8Asteroid5Point4len2Ev(ptr noundef nonnull align 4 dereferenceable(12) %15)
  %189 = call noundef i32 @_ZNK8Asteroid5Point4len2Ev(ptr noundef nonnull align 4 dereferenceable(12) %10)
  %190 = sub nsw i32 %188, %189
  store i32 %190, ptr %187, align 4, !tbaa !5
  %191 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 2
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = icmp ne i32 %192, 0
  br i1 %193, label %225, label %194

194:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #11
  %195 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 1
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = icmp ne i32 %196, 0
  br i1 %197, label %198, label %207

198:                                              ; preds = %194
  %199 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 0
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = sub nsw i32 0, %200
  %202 = sitofp i32 %201 to double
  %203 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 1
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %205 = sitofp i32 %204 to double
  %206 = fdiv double %202, %205
  br label %208

207:                                              ; preds = %194
  br label %208

208:                                              ; preds = %207, %198
  %209 = phi double [ %206, %198 ], [ -1.000000e+00, %207 ]
  store double %209, ptr %18, align 8, !tbaa !16
  %210 = load double, ptr %18, align 8, !tbaa !16
  %211 = call noundef i32 @_Z3sgnd(double noundef %210)
  %212 = icmp sgt i32 %211, 0
  br i1 %212, label %213, label %224

213:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #11
  %214 = getelementptr inbounds %struct.Event, ptr %19, i32 0, i32 0
  %215 = load double, ptr %18, align 8, !tbaa !16
  store double %215, ptr %214, align 8, !tbaa !18
  %216 = getelementptr inbounds %struct.Event, ptr %19, i32 0, i32 1
  %217 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %217, ptr %216, align 8, !tbaa !20
  %218 = getelementptr inbounds %struct.Event, ptr %19, i32 0, i32 2
  %219 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %219, ptr %218, align 4, !tbaa !21
  %220 = load i32, ptr @etot, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr @etot, align 4, !tbaa !5
  %222 = sext i32 %220 to i64
  %223 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %222
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %223, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #11
  br label %224

224:                                              ; preds = %213, %208
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #11
  br label %304

225:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #11
  %226 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 1
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = mul nsw i64 1, %228
  %230 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 1
  %231 = load i32, ptr %230, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = mul nsw i64 %229, %232
  %234 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 0
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = mul nsw i64 4, %236
  %238 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 2
  %239 = load i32, ptr %238, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = mul nsw i64 %237, %240
  %242 = sub nsw i64 %233, %241
  store i64 %242, ptr %20, align 8, !tbaa !23
  %243 = load i64, ptr %20, align 8, !tbaa !23
  %244 = icmp sgt i64 %243, 0
  br i1 %244, label %245, label %303

245:                                              ; preds = %225
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #11
  %246 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 1
  %247 = load i32, ptr %246, align 4, !tbaa !5
  %248 = sub nsw i32 0, %247
  %249 = sitofp i32 %248 to double
  %250 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 2
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = shl i32 %251, 1
  %253 = sitofp i32 %252 to double
  %254 = fdiv double %249, %253
  store double %254, ptr %21, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #11
  %255 = load i64, ptr %20, align 8, !tbaa !23
  %256 = sitofp i64 %255 to x86_fp80
  %257 = call x86_fp80 @sqrtl(x86_fp80 noundef %256) #11
  %258 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 2
  %259 = load i32, ptr %258, align 4, !tbaa !5
  %260 = shl i32 %259, 1
  %261 = sitofp i32 %260 to double
  %262 = fpext double %261 to x86_fp80
  %263 = fdiv x86_fp80 %257, %262
  %264 = fptrunc x86_fp80 %263 to double
  store double %264, ptr %22, align 8, !tbaa !16
  %265 = load double, ptr %21, align 8, !tbaa !16
  %266 = load double, ptr %22, align 8, !tbaa !16
  %267 = fsub double %265, %266
  %268 = call noundef i32 @_Z3sgnd(double noundef %267)
  %269 = icmp sgt i32 %268, 0
  br i1 %269, label %270, label %283

270:                                              ; preds = %245
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #11
  %271 = getelementptr inbounds %struct.Event, ptr %23, i32 0, i32 0
  %272 = load double, ptr %21, align 8, !tbaa !16
  %273 = load double, ptr %22, align 8, !tbaa !16
  %274 = fsub double %272, %273
  store double %274, ptr %271, align 8, !tbaa !18
  %275 = getelementptr inbounds %struct.Event, ptr %23, i32 0, i32 1
  %276 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %276, ptr %275, align 8, !tbaa !20
  %277 = getelementptr inbounds %struct.Event, ptr %23, i32 0, i32 2
  %278 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %278, ptr %277, align 4, !tbaa !21
  %279 = load i32, ptr @etot, align 4, !tbaa !5
  %280 = add nsw i32 %279, 1
  store i32 %280, ptr @etot, align 4, !tbaa !5
  %281 = sext i32 %279 to i64
  %282 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %281
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %282, ptr align 8 %23, i64 16, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #11
  br label %283

283:                                              ; preds = %270, %245
  %284 = load double, ptr %21, align 8, !tbaa !16
  %285 = load double, ptr %22, align 8, !tbaa !16
  %286 = fadd double %284, %285
  %287 = call noundef i32 @_Z3sgnd(double noundef %286)
  %288 = icmp sgt i32 %287, 0
  br i1 %288, label %289, label %302

289:                                              ; preds = %283
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #11
  %290 = getelementptr inbounds %struct.Event, ptr %24, i32 0, i32 0
  %291 = load double, ptr %21, align 8, !tbaa !16
  %292 = load double, ptr %22, align 8, !tbaa !16
  %293 = fadd double %291, %292
  store double %293, ptr %290, align 8, !tbaa !18
  %294 = getelementptr inbounds %struct.Event, ptr %24, i32 0, i32 1
  %295 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %295, ptr %294, align 8, !tbaa !20
  %296 = getelementptr inbounds %struct.Event, ptr %24, i32 0, i32 2
  %297 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %297, ptr %296, align 4, !tbaa !21
  %298 = load i32, ptr @etot, align 4, !tbaa !5
  %299 = add nsw i32 %298, 1
  store i32 %299, ptr @etot, align 4, !tbaa !5
  %300 = sext i32 %298 to i64
  %301 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %300
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %301, ptr align 8 %24, i64 16, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #11
  br label %302

302:                                              ; preds = %289, %283
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #11
  br label %303

303:                                              ; preds = %302, %225
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #11
  br label %304

304:                                              ; preds = %303, %224
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #11
  br label %305

305:                                              ; preds = %304
  %306 = load i32, ptr %12, align 4, !tbaa !5
  %307 = add nsw i32 %306, 1
  store i32 %307, ptr %12, align 4, !tbaa !5
  br label %139, !llvm.loop !25

308:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #11
  br label %309

309:                                              ; preds = %308
  %310 = load i32, ptr %7, align 4, !tbaa !5
  %311 = add nsw i32 %310, 1
  store i32 %311, ptr %7, align 4, !tbaa !5
  br label %79, !llvm.loop !26

312:                                              ; preds = %83
  %313 = load i32, ptr @qtot, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds i32, ptr @que, i64 %314
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %315)
  %316 = load i32, ptr @etot, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds %struct.Event, ptr @eve, i64 %317
  call void @_ZSt4sortIP5EventEvT_S2_(ptr noundef @eve, ptr noundef %318)
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #11
  store i32 1, ptr %25, align 4, !tbaa !5
  store i32 0, ptr @stim, align 4, !tbaa !5
  %319 = load i32, ptr @m, align 4, !tbaa !5
  %320 = sext i32 %319 to i64
  %321 = mul i64 %320, 4
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 %321, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #11
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %322

322:                                              ; preds = %568, %312
  %323 = load i32, ptr %26, align 4, !tbaa !5
  %324 = load i32, ptr @etot, align 4, !tbaa !5
  %325 = icmp slt i32 %323, %324
  br i1 %325, label %327, label %326

326:                                              ; preds = %322
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #11
  br label %575

327:                                              ; preds = %322
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #11
  store i32 0, ptr %27, align 4, !tbaa !5
  %328 = load i32, ptr @qtot, align 4, !tbaa !5
  %329 = sext i32 %328 to i64
  %330 = mul i64 %329, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @_ZZ4mainE3las, ptr align 16 @que, i64 %330, i1 false)
  %331 = load i32, ptr @stim, align 4, !tbaa !5
  %332 = add nsw i32 %331, 1
  store i32 %332, ptr @stim, align 4, !tbaa !5
  br label %333

333:                                              ; preds = %336, %327
  %334 = load i32, ptr @qtot, align 4, !tbaa !5
  %335 = icmp sgt i32 %334, 0
  br i1 %335, label %336, label %352

336:                                              ; preds = %333
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #11
  %337 = load i32, ptr @qtot, align 4, !tbaa !5
  %338 = add nsw i32 %337, -1
  store i32 %338, ptr @qtot, align 4, !tbaa !5
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [51 x i32], ptr @que, i64 0, i64 %339
  %341 = load i32, ptr %340, align 4, !tbaa !5
  store i32 %341, ptr %28, align 4, !tbaa !5
  %342 = load i32, ptr @stim, align 4, !tbaa !5
  %343 = load i32, ptr %28, align 4, !tbaa !5
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds [1251 x i32], ptr @vis, i64 0, i64 %344
  store i32 %342, ptr %345, align 4, !tbaa !5
  %346 = load i32, ptr %28, align 4, !tbaa !5
  %347 = load i32, ptr %27, align 4, !tbaa !5
  %348 = add nsw i32 %347, 1
  store i32 %348, ptr %27, align 4, !tbaa !5
  %349 = sext i32 %347 to i64
  %350 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %349
  %351 = getelementptr inbounds %"struct.std::pair", ptr %350, i32 0, i32 1
  store i32 %346, ptr %351, align 8, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #11
  br label %333, !llvm.loop !29

352:                                              ; preds = %333
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #11
  %353 = load i32, ptr %26, align 4, !tbaa !5
  %354 = sext i32 %353 to i64
  %355 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %354
  %356 = getelementptr inbounds %struct.Event, ptr %355, i32 0, i32 0
  %357 = load double, ptr %356, align 16, !tbaa !18
  store double %357, ptr %29, align 8, !tbaa !16
  br label %358

358:                                              ; preds = %437, %352
  %359 = load i32, ptr %26, align 4, !tbaa !5
  %360 = load i32, ptr @etot, align 4, !tbaa !5
  %361 = icmp slt i32 %359, %360
  br i1 %361, label %362, label %373

362:                                              ; preds = %358
  %363 = load double, ptr %29, align 8, !tbaa !16
  %364 = load i32, ptr %26, align 4, !tbaa !5
  %365 = sext i32 %364 to i64
  %366 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %365
  %367 = getelementptr inbounds %struct.Event, ptr %366, i32 0, i32 0
  %368 = load double, ptr %367, align 16, !tbaa !18
  %369 = fsub double %363, %368
  %370 = call noundef i32 @_Z3sgnd(double noundef %369)
  %371 = icmp ne i32 %370, 0
  %372 = xor i1 %371, true
  br label %373

373:                                              ; preds = %362, %358
  %374 = phi i1 [ false, %358 ], [ %372, %362 ]
  br i1 %374, label %376, label %375

375:                                              ; preds = %373
  store i32 21, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #11
  br label %440

376:                                              ; preds = %373
  %377 = load i32, ptr %26, align 4, !tbaa !5
  %378 = sext i32 %377 to i64
  %379 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %378
  %380 = getelementptr inbounds %struct.Event, ptr %379, i32 0, i32 1
  %381 = load i32, ptr %380, align 8, !tbaa !20
  %382 = sext i32 %381 to i64
  %383 = getelementptr inbounds [1251 x i32], ptr @vis, i64 0, i64 %382
  %384 = load i32, ptr %383, align 4, !tbaa !5
  %385 = load i32, ptr @stim, align 4, !tbaa !5
  %386 = icmp ne i32 %384, %385
  br i1 %386, label %387, label %406

387:                                              ; preds = %376
  %388 = load i32, ptr @stim, align 4, !tbaa !5
  %389 = load i32, ptr %26, align 4, !tbaa !5
  %390 = sext i32 %389 to i64
  %391 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %390
  %392 = getelementptr inbounds %struct.Event, ptr %391, i32 0, i32 1
  %393 = load i32, ptr %392, align 8, !tbaa !20
  %394 = sext i32 %393 to i64
  %395 = getelementptr inbounds [1251 x i32], ptr @vis, i64 0, i64 %394
  store i32 %388, ptr %395, align 4, !tbaa !5
  %396 = load i32, ptr %26, align 4, !tbaa !5
  %397 = sext i32 %396 to i64
  %398 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %397
  %399 = getelementptr inbounds %struct.Event, ptr %398, i32 0, i32 1
  %400 = load i32, ptr %399, align 8, !tbaa !20
  %401 = load i32, ptr %27, align 4, !tbaa !5
  %402 = add nsw i32 %401, 1
  store i32 %402, ptr %27, align 4, !tbaa !5
  %403 = sext i32 %401 to i64
  %404 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %403
  %405 = getelementptr inbounds %"struct.std::pair", ptr %404, i32 0, i32 1
  store i32 %400, ptr %405, align 8, !tbaa !27
  br label %406

406:                                              ; preds = %387, %376
  %407 = load i32, ptr %26, align 4, !tbaa !5
  %408 = sext i32 %407 to i64
  %409 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %408
  %410 = getelementptr inbounds %struct.Event, ptr %409, i32 0, i32 2
  %411 = load i32, ptr %410, align 4, !tbaa !21
  %412 = sext i32 %411 to i64
  %413 = getelementptr inbounds [1251 x i32], ptr @vis, i64 0, i64 %412
  %414 = load i32, ptr %413, align 4, !tbaa !5
  %415 = load i32, ptr @stim, align 4, !tbaa !5
  %416 = icmp ne i32 %414, %415
  br i1 %416, label %417, label %436

417:                                              ; preds = %406
  %418 = load i32, ptr @stim, align 4, !tbaa !5
  %419 = load i32, ptr %26, align 4, !tbaa !5
  %420 = sext i32 %419 to i64
  %421 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %420
  %422 = getelementptr inbounds %struct.Event, ptr %421, i32 0, i32 2
  %423 = load i32, ptr %422, align 4, !tbaa !21
  %424 = sext i32 %423 to i64
  %425 = getelementptr inbounds [1251 x i32], ptr @vis, i64 0, i64 %424
  store i32 %418, ptr %425, align 4, !tbaa !5
  %426 = load i32, ptr %26, align 4, !tbaa !5
  %427 = sext i32 %426 to i64
  %428 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %427
  %429 = getelementptr inbounds %struct.Event, ptr %428, i32 0, i32 2
  %430 = load i32, ptr %429, align 4, !tbaa !21
  %431 = load i32, ptr %27, align 4, !tbaa !5
  %432 = add nsw i32 %431, 1
  store i32 %432, ptr %27, align 4, !tbaa !5
  %433 = sext i32 %431 to i64
  %434 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %433
  %435 = getelementptr inbounds %"struct.std::pair", ptr %434, i32 0, i32 1
  store i32 %430, ptr %435, align 8, !tbaa !27
  br label %436

436:                                              ; preds = %417, %406
  br label %437

437:                                              ; preds = %436
  %438 = load i32, ptr %26, align 4, !tbaa !5
  %439 = add nsw i32 %438, 1
  store i32 %439, ptr %26, align 4, !tbaa !5
  br label %358, !llvm.loop !30

440:                                              ; preds = %375
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #11
  %441 = load i32, ptr %26, align 4, !tbaa !5
  %442 = sub nsw i32 %441, 1
  %443 = sext i32 %442 to i64
  %444 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %443
  %445 = getelementptr inbounds %struct.Event, ptr %444, i32 0, i32 0
  %446 = load double, ptr %445, align 16, !tbaa !18
  %447 = load i32, ptr %26, align 4, !tbaa !5
  %448 = load i32, ptr @etot, align 4, !tbaa !5
  %449 = icmp slt i32 %447, %448
  br i1 %449, label %450, label %463

450:                                              ; preds = %440
  %451 = load i32, ptr %26, align 4, !tbaa !5
  %452 = sext i32 %451 to i64
  %453 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %452
  %454 = getelementptr inbounds %struct.Event, ptr %453, i32 0, i32 0
  %455 = load double, ptr %454, align 16, !tbaa !18
  %456 = load i32, ptr %26, align 4, !tbaa !5
  %457 = sub nsw i32 %456, 1
  %458 = sext i32 %457 to i64
  %459 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %458
  %460 = getelementptr inbounds %struct.Event, ptr %459, i32 0, i32 0
  %461 = load double, ptr %460, align 16, !tbaa !18
  %462 = fsub double %455, %461
  br label %464

463:                                              ; preds = %440
  br label %464

464:                                              ; preds = %463, %450
  %465 = phi double [ %462, %450 ], [ 1.000000e+00, %463 ]
  %466 = call double @llvm.fmuladd.f64(double %465, double 5.000000e-01, double %446)
  store double %466, ptr %30, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #11
  store i32 0, ptr %31, align 4, !tbaa !5
  br label %467

467:                                              ; preds = %485, %464
  %468 = load i32, ptr %31, align 4, !tbaa !5
  %469 = load i32, ptr %27, align 4, !tbaa !5
  %470 = icmp slt i32 %468, %469
  br i1 %470, label %472, label %471

471:                                              ; preds = %467
  store i32 24, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #11
  br label %488

472:                                              ; preds = %467
  %473 = load i32, ptr %31, align 4, !tbaa !5
  %474 = sext i32 %473 to i64
  %475 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %474
  %476 = getelementptr inbounds %"struct.std::pair", ptr %475, i32 0, i32 1
  %477 = load i32, ptr %476, align 8, !tbaa !27
  %478 = sext i32 %477 to i64
  %479 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %478
  %480 = call noundef double @_ZNK4Edge4len2ERKd(ptr noundef nonnull align 4 dereferenceable(8) %479, ptr noundef nonnull align 8 dereferenceable(8) %30)
  %481 = load i32, ptr %31, align 4, !tbaa !5
  %482 = sext i32 %481 to i64
  %483 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %482
  %484 = getelementptr inbounds %"struct.std::pair", ptr %483, i32 0, i32 0
  store double %480, ptr %484, align 16, !tbaa !31
  br label %485

485:                                              ; preds = %472
  %486 = load i32, ptr %31, align 4, !tbaa !5
  %487 = add nsw i32 %486, 1
  store i32 %487, ptr %31, align 4, !tbaa !5
  br label %467, !llvm.loop !32

488:                                              ; preds = %471
  %489 = load i32, ptr %27, align 4, !tbaa !5
  %490 = sext i32 %489 to i64
  %491 = getelementptr inbounds %"struct.std::pair", ptr @_ZZ4mainE3tmp, i64 %490
  call void @_ZSt4sortIPSt4pairIdiEEvT_S3_(ptr noundef @_ZZ4mainE3tmp, ptr noundef %491)
  %492 = load i32, ptr @n, align 4, !tbaa !5
  %493 = sext i32 %492 to i64
  %494 = mul i64 %493, 4
  call void @llvm.memset.p0.i64(ptr align 16 @dsu, i8 -1, i64 %494, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #11
  store i32 0, ptr %32, align 4, !tbaa !5
  br label %495

495:                                              ; preds = %531, %488
  %496 = load i32, ptr %32, align 4, !tbaa !5
  %497 = load i32, ptr %27, align 4, !tbaa !5
  %498 = icmp slt i32 %496, %497
  br i1 %498, label %500, label %499

499:                                              ; preds = %495
  store i32 27, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #11
  br label %534

500:                                              ; preds = %495
  %501 = load i32, ptr %32, align 4, !tbaa !5
  %502 = sext i32 %501 to i64
  %503 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %502
  %504 = getelementptr inbounds %"struct.std::pair", ptr %503, i32 0, i32 1
  %505 = load i32, ptr %504, align 8, !tbaa !27
  %506 = sext i32 %505 to i64
  %507 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %506
  %508 = getelementptr inbounds %struct.Edge, ptr %507, i32 0, i32 0
  %509 = load i32, ptr %508, align 8, !tbaa !9
  %510 = load i32, ptr %32, align 4, !tbaa !5
  %511 = sext i32 %510 to i64
  %512 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %511
  %513 = getelementptr inbounds %"struct.std::pair", ptr %512, i32 0, i32 1
  %514 = load i32, ptr %513, align 8, !tbaa !27
  %515 = sext i32 %514 to i64
  %516 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %515
  %517 = getelementptr inbounds %struct.Edge, ptr %516, i32 0, i32 1
  %518 = load i32, ptr %517, align 4, !tbaa !11
  %519 = call noundef zeroext i1 @_Z9dsu_mergeii(i32 noundef %509, i32 noundef %518)
  br i1 %519, label %520, label %530

520:                                              ; preds = %500
  %521 = load i32, ptr %32, align 4, !tbaa !5
  %522 = sext i32 %521 to i64
  %523 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %522
  %524 = getelementptr inbounds %"struct.std::pair", ptr %523, i32 0, i32 1
  %525 = load i32, ptr %524, align 8, !tbaa !27
  %526 = load i32, ptr @qtot, align 4, !tbaa !5
  %527 = add nsw i32 %526, 1
  store i32 %527, ptr @qtot, align 4, !tbaa !5
  %528 = sext i32 %526 to i64
  %529 = getelementptr inbounds [51 x i32], ptr @que, i64 0, i64 %528
  store i32 %525, ptr %529, align 4, !tbaa !5
  br label %530

530:                                              ; preds = %520, %500
  br label %531

531:                                              ; preds = %530
  %532 = load i32, ptr %32, align 4, !tbaa !5
  %533 = add nsw i32 %532, 1
  store i32 %533, ptr %32, align 4, !tbaa !5
  br label %495, !llvm.loop !33

534:                                              ; preds = %499
  %535 = load i32, ptr @qtot, align 4, !tbaa !5
  %536 = sext i32 %535 to i64
  %537 = getelementptr inbounds i32, ptr @que, i64 %536
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %537)
  call void @llvm.lifetime.start.p0(i64 1, ptr %33) #11
  store i8 1, ptr %33, align 1, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #11
  store i32 0, ptr %34, align 4, !tbaa !5
  br label %538

538:                                              ; preds = %565, %534
  %539 = load i8, ptr %33, align 1, !tbaa !34, !range !36, !noundef !37
  %540 = trunc i8 %539 to i1
  br i1 %540, label %541, label %545

541:                                              ; preds = %538
  %542 = load i32, ptr %34, align 4, !tbaa !5
  %543 = load i32, ptr @qtot, align 4, !tbaa !5
  %544 = icmp slt i32 %542, %543
  br label %545

545:                                              ; preds = %541, %538
  %546 = phi i1 [ false, %538 ], [ %544, %541 ]
  br i1 %546, label %548, label %547

547:                                              ; preds = %545
  store i32 30, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #11
  br label %568

548:                                              ; preds = %545
  %549 = load i32, ptr %34, align 4, !tbaa !5
  %550 = sext i32 %549 to i64
  %551 = getelementptr inbounds [51 x i32], ptr @_ZZ4mainE3las, i64 0, i64 %550
  %552 = load i32, ptr %551, align 4, !tbaa !5
  %553 = load i32, ptr %34, align 4, !tbaa !5
  %554 = sext i32 %553 to i64
  %555 = getelementptr inbounds [51 x i32], ptr @que, i64 0, i64 %554
  %556 = load i32, ptr %555, align 4, !tbaa !5
  %557 = icmp eq i32 %552, %556
  %558 = zext i1 %557 to i32
  %559 = load i8, ptr %33, align 1, !tbaa !34, !range !36, !noundef !37
  %560 = trunc i8 %559 to i1
  %561 = zext i1 %560 to i32
  %562 = and i32 %561, %558
  %563 = icmp ne i32 %562, 0
  %564 = zext i1 %563 to i8
  store i8 %564, ptr %33, align 1, !tbaa !34
  br label %565

565:                                              ; preds = %548
  %566 = load i32, ptr %34, align 4, !tbaa !5
  %567 = add nsw i32 %566, 1
  store i32 %567, ptr %34, align 4, !tbaa !5
  br label %538, !llvm.loop !38

568:                                              ; preds = %547
  %569 = load i8, ptr %33, align 1, !tbaa !34, !range !36, !noundef !37
  %570 = trunc i8 %569 to i1
  %571 = xor i1 %570, true
  %572 = zext i1 %571 to i32
  %573 = load i32, ptr %25, align 4, !tbaa !5
  %574 = add nsw i32 %573, %572
  store i32 %574, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #11
  br label %322, !llvm.loop !39

575:                                              ; preds = %326
  %576 = load i32, ptr %2, align 4, !tbaa !5
  %577 = load i32, ptr %25, align 4, !tbaa !5
  %578 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %576, i32 noundef %577)
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #11
  br label %579

579:                                              ; preds = %575
  %580 = load i32, ptr %2, align 4, !tbaa !5
  %581 = add nsw i32 %580, 1
  store i32 %581, ptr %2, align 4, !tbaa !5
  br label %35, !llvm.loop !40

582:                                              ; preds = %38
  ret i32 0
}

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { i64, i32 } @_ZNK8Asteroid5PointmiERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK8Asteroid5Point4len2Ev(ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8Asteroid5Point3dotERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #7 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnd(double noundef) #8

; Function Attrs: nounwind
declare x86_fp80 @sqrtl(x86_fp80 noundef) #9

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #10

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

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

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

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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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: write) }
attributes #7 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind "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 #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { 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 = !{!"_ZTS4Edge", !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 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = !{!19, !17, i64 0}
!19 = !{!"_ZTS5Event", !17, i64 0, !6, i64 8, !6, i64 12}
!20 = !{!19, !6, i64 8}
!21 = !{!19, !6, i64 12}
!22 = !{i64 0, i64 8, !16, i64 8, i64 4, !5, i64 12, i64 4, !5}
!23 = !{!24, !24, i64 0}
!24 = !{!"long long", !7, i64 0}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14}
!27 = !{!28, !6, i64 8}
!28 = !{!"_ZTSSt4pairIdiE", !17, i64 0, !6, i64 8}
!29 = distinct !{!29, !14}
!30 = distinct !{!30, !14}
!31 = !{!28, !17, i64 0}
!32 = distinct !{!32, !14}
!33 = distinct !{!33, !14}
!34 = !{!35, !35, i64 0}
!35 = !{!"bool", !7, i64 0}
!36 = !{i8 0, i8 2}
!37 = !{}
!38 = distinct !{!38, !14}
!39 = distinct !{!39, !14}
!40 = distinct !{!40, !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"

%struct.Asteroid = type { %"struct.Asteroid::Point", %"struct.Asteroid::Point" }
%"struct.Asteroid::Point" = type { i32, i32, i32 }
%struct.Edge = type { i32, i32 }
%struct.Event = type { double, i32, i32 }
%"struct.std::pair" = type <{ double, i32, [4 x i8] }>

@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@etot = external dso_local local_unnamed_addr global i32, align 4
@dsu = external dso_local local_unnamed_addr global [51 x i32], align 16
@qtot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [51 x i32], align 16
@stim = external dso_local local_unnamed_addr global i32, align 4
@vis = external dso_local local_unnamed_addr global [1251 x i32], align 16
@a = external dso_local global [51 x %struct.Asteroid], align 16
@e = external dso_local global [1251 x %struct.Edge], align 16
@eve = external dso_local global [1562501 x %struct.Event], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE3las = external hidden local_unnamed_addr global [51 x i32], align 16
@_ZZ4mainE3tmp = external hidden global [1251 x %"struct.std::pair"], align 16
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca %"struct.Asteroid::Point", align 8
  %2 = alloca %"struct.Asteroid::Point", align 8
  %3 = alloca %"struct.Asteroid::Point", align 8
  %4 = alloca %"struct.Asteroid::Point", align 8
  %5 = alloca double, align 8
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %7 = icmp eq i32 %6, 1
  br i1 %7, label %.lr.ph184, label %._crit_edge185

.lr.ph184:                                        ; preds = %0
  %.sroa.290.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 8
  %.sroa.286.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  %.sroa.273.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  br label %8

._crit_edge185:                                   ; preds = %._crit_edge180, %0
  ret i32 0

8:                                                ; preds = %.lr.ph184, %._crit_edge180
  %.0119182 = phi i32 [ 1, %.lr.ph184 ], [ %155, %._crit_edge180 ]
  store i32 0, ptr @qtot, align 4, !tbaa !5
  store i32 0, ptr @etot, align 4, !tbaa !5
  store i32 0, ptr @m, align 4, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph140, label %._crit_edge

.loopexit:                                        ; preds = %.lr.ph, %middle.block
  %indvars.iv.next.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next, %.lr.ph ]
  %11 = trunc nsw i64 %indvars.iv.next.lcssa to i32
  store i32 %11, ptr @m, align 4, !tbaa !5
  br i1 %23, label %.lr.ph140, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph140, %.loopexit, %8
  %12 = phi i32 [ 0, %8 ], [ %m.promoted, %.lr.ph140 ], [ %11, %.loopexit ]
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds %struct.Edge, ptr @e, i64 %13
  call void @_ZSt4sortIP4EdgeEvT_S2_(ptr noundef nonnull @e, ptr noundef nonnull %14)
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = shl nsw i64 %16, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @dsu, i8 -1, i64 %17, i1 false)
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph147, label %._crit_edge148

.lr.ph140:                                        ; preds = %8, %.loopexit
  %indvars.iv191 = phi i64 [ %indvars.iv.next192, %.loopexit ], [ 0, %8 ]
  %20 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %indvars.iv191
  call void @_ZN8Asteroid4readEv(ptr noundef nonnull align 4 dereferenceable(24) %20)
  %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %m.promoted = load i32, ptr @m, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = icmp slt i64 %indvars.iv.next192, %22
  br i1 %23, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph140
  %24 = trunc i64 %indvars.iv191 to i32
  %25 = sext i32 %m.promoted to i64
  %26 = trunc nuw nsw i64 %indvars.iv.next192 to i32
  %27 = trunc nuw nsw i64 %indvars.iv191 to i32
  %reass.sub = sub i32 %21, %24
  %28 = add i32 %reass.sub, -2
  %29 = zext i32 %28 to i64
  %30 = add nuw nsw i64 %29, 1
  %min.iters.check = icmp ult i32 %28, 3
  br i1 %min.iters.check, label %.lr.ph.preheader253, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %30, 8589934588
  %ind.end = add nsw i64 %n.vec, %25
  %.cast = trunc i64 %n.vec to i32
  %ind.end249 = add i32 %26, %.cast
  %.splatinsert = insertelement <2 x i32> poison, i32 %26, i64 0
  %.splat = shufflevector <2 x i32> %.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer
  %induction = add <2 x i32> %.splat, <i32 0, i32 1>
  %broadcast.splatinsert = insertelement <2 x i32> poison, i32 %27, i64 0
  %broadcast.splat = shufflevector <2 x i32> %broadcast.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i32> %vec.ind, <i32 2, i32 2>
  %offset.idx = add i64 %index, %25
  %31 = add i64 %offset.idx, 2
  %32 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %offset.idx
  %33 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %31
  %interleaved.vec = shufflevector <2 x i32> %broadcast.splat, <2 x i32> %vec.ind, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
  store <4 x i32> %interleaved.vec, ptr %32, align 8, !tbaa !5
  %interleaved.vec252 = shufflevector <2 x i32> %broadcast.splat, <2 x i32> %step.add, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
  store <4 x i32> %interleaved.vec252, ptr %33, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
  %34 = icmp eq i64 %index.next, %n.vec
  br i1 %34, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %30, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph.preheader253

.lr.ph.preheader253:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ %25, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  %.0125138.ph = phi i32 [ %26, %.lr.ph.preheader ], [ %ind.end249, %middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader253, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader253 ]
  %.0125138 = phi i32 [ %36, %.lr.ph ], [ %.0125138.ph, %.lr.ph.preheader253 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %35 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %indvars.iv
  store i32 %27, ptr %35, align 8, !tbaa !5
  %.sroa.4105.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 4
  store i32 %.0125138, ptr %.sroa.4105.0..sroa_idx, align 4, !tbaa !5
  %36 = add nuw nsw i32 %.0125138, 1
  %exitcond.not = icmp eq i32 %36, %21
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !14

._crit_edge148:                                   ; preds = %._crit_edge144, %._crit_edge
  %37 = load i32, ptr @qtot, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr @que, i64 %38
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %39)
  %40 = load i32, ptr @etot, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds %struct.Event, ptr @eve, i64 %41
  call void @_ZSt4sortIP5EventEvT_S2_(ptr noundef nonnull @eve, ptr noundef nonnull %42)
  store i32 0, ptr @stim, align 4, !tbaa !5
  %43 = load i32, ptr @m, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = shl nsw i64 %44, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @vis, i8 0, i64 %45, i1 false)
  %46 = load i32, ptr @etot, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph179.preheader, label %._crit_edge180

.lr.ph179.preheader:                              ; preds = %._crit_edge148
  %.pre = load i32, ptr @qtot, align 4, !tbaa !5
  br label %.lr.ph179

.lr.ph147:                                        ; preds = %._crit_edge, %._crit_edge144
  %indvars.iv199 = phi i64 [ %indvars.iv.next200, %._crit_edge144 ], [ 0, %._crit_edge ]
  %indvars.iv194 = phi i64 [ %indvars.iv.next195, %._crit_edge144 ], [ 1, %._crit_edge ]
  %48 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %indvars.iv199
  %49 = load i32, ptr %48, align 8, !tbaa !15
  %50 = getelementptr inbounds i8, ptr %48, i64 4
  %51 = load i32, ptr %50, align 4, !tbaa !17
  %52 = call noundef zeroext i1 @_Z9dsu_mergeii(i32 noundef %49, i32 noundef %51)
  br i1 %52, label %53, label %59

53:                                               ; preds = %.lr.ph147
  %54 = load i32, ptr @qtot, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr @qtot, align 4, !tbaa !5
  %56 = sext i32 %54 to i64
  %57 = getelementptr inbounds [51 x i32], ptr @que, i64 0, i64 %56
  %58 = trunc nuw nsw i64 %indvars.iv199 to i32
  store i32 %58, ptr %57, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %53, %.lr.ph147
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %1) #11
  %60 = load i32, ptr %50, align 4, !tbaa !17
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %61
  %63 = load i32, ptr %48, align 8, !tbaa !15
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %64
  %66 = call { i64, i32 } @_ZNK8Asteroid5PointmiERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %62, ptr noundef nonnull align 4 dereferenceable(12) %65)
  %.fca.0.extract87 = extractvalue { i64, i32 } %66, 0
  %.fca.1.extract88 = extractvalue { i64, i32 } %66, 1
  store i64 %.fca.0.extract87, ptr %1, align 8
  store i32 %.fca.1.extract88, ptr %.sroa.290.0..sroa_idx, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #11
  %67 = load i32, ptr %50, align 4, !tbaa !17
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %68, i32 1
  %70 = load i32, ptr %48, align 8, !tbaa !15
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %71, i32 1
  %73 = call { i64, i32 } @_ZNK8Asteroid5PointmiERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %69, ptr noundef nonnull align 4 dereferenceable(12) %72)
  %.fca.0.extract83 = extractvalue { i64, i32 } %73, 0
  %.fca.1.extract84 = extractvalue { i64, i32 } %73, 1
  store i64 %.fca.0.extract83, ptr %2, align 8
  store i32 %.fca.1.extract84, ptr %.sroa.286.0..sroa_idx, align 8
  %indvars.iv.next200 = add nuw nsw i64 %indvars.iv199, 1
  %74 = load i32, ptr @m, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next200, %75
  br i1 %76, label %.lr.ph143.preheader, label %._crit_edge144

.lr.ph143.preheader:                              ; preds = %59
  %77 = trunc nuw nsw i64 %indvars.iv199 to i32
  %.sink237 = trunc i64 %indvars.iv199 to i32
  br label %.lr.ph143

._crit_edge144.loopexit:                          ; preds = %150
  %.pre231 = sext i32 %151 to i64
  br label %._crit_edge144

._crit_edge144:                                   ; preds = %._crit_edge144.loopexit, %59
  %.pre-phi = phi i64 [ %.pre231, %._crit_edge144.loopexit ], [ %75, %59 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %1) #11
  %78 = icmp slt i64 %indvars.iv.next200, %.pre-phi
  %indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1
  br i1 %78, label %.lr.ph147, label %._crit_edge148, !llvm.loop !18

.lr.ph143:                                        ; preds = %.lr.ph143.preheader, %150
  %indvars.iv196 = phi i64 [ %indvars.iv194, %.lr.ph143.preheader ], [ %indvars.iv.next197, %150 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #11
  %79 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %indvars.iv196
  %80 = getelementptr inbounds i8, ptr %79, i64 4
  %81 = load i32, ptr %80, align 4, !tbaa !17
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %82
  %84 = load i32, ptr %79, align 8, !tbaa !15
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %85
  %87 = call { i64, i32 } @_ZNK8Asteroid5PointmiERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %83, ptr noundef nonnull align 4 dereferenceable(12) %86)
  %.fca.0.extract70 = extractvalue { i64, i32 } %87, 0
  %.fca.1.extract71 = extractvalue { i64, i32 } %87, 1
  store i64 %.fca.0.extract70, ptr %3, align 8
  store i32 %.fca.1.extract71, ptr %.sroa.273.0..sroa_idx, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #11
  %88 = load i32, ptr %80, align 4, !tbaa !17
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %89, i32 1
  %91 = load i32, ptr %79, align 8, !tbaa !15
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [51 x %struct.Asteroid], ptr @a, i64 0, i64 %92, i32 1
  %94 = call { i64, i32 } @_ZNK8Asteroid5PointmiERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %90, ptr noundef nonnull align 4 dereferenceable(12) %93)
  %.fca.0.extract = extractvalue { i64, i32 } %94, 0
  %.fca.1.extract = extractvalue { i64, i32 } %94, 1
  store i64 %.fca.0.extract, ptr %4, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %95 = call noundef i32 @_ZNK8Asteroid5Point4len2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3)
  %96 = call noundef i32 @_ZNK8Asteroid5Point4len2Ev(ptr noundef nonnull align 4 dereferenceable(12) %1)
  %97 = sub nsw i32 %95, %96
  %98 = call noundef i32 @_ZNK8Asteroid5Point3dotERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %4)
  %99 = call noundef i32 @_ZNK8Asteroid5Point3dotERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
  %100 = sub nsw i32 %98, %99
  %101 = shl i32 %100, 1
  %102 = call noundef i32 @_ZNK8Asteroid5Point4len2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4)
  %103 = call noundef i32 @_ZNK8Asteroid5Point4len2Ev(ptr noundef nonnull align 4 dereferenceable(12) %2)
  %104 = sub nsw i32 %102, %103
  %.not136 = icmp eq i32 %102, %103
  br i1 %.not136, label %105, label %113

105:                                              ; preds = %.lr.ph143
  %.not137 = icmp eq i32 %101, 0
  %106 = sub nsw i32 0, %97
  %107 = sitofp i32 %106 to double
  %108 = sitofp i32 %101 to double
  %109 = fdiv double %107, %108
  %110 = select i1 %.not137, double -1.000000e+00, double %109
  %111 = call noundef i32 @_Z3sgnd(double noundef %110)
  %112 = icmp sgt i32 %111, 0
  br i1 %112, label %.sink.split, label %150

113:                                              ; preds = %.lr.ph143
  %114 = sext i32 %101 to i64
  %115 = mul nsw i64 %114, %114
  %116 = sext i32 %97 to i64
  %117 = shl nsw i64 %116, 2
  %118 = sext i32 %104 to i64
  %119 = mul nsw i64 %117, %118
  %120 = sub nsw i64 %115, %119
  %121 = icmp sgt i64 %120, 0
  br i1 %121, label %122, label %150

122:                                              ; preds = %113
  %123 = sub nsw i32 0, %101
  %124 = sitofp i32 %123 to double
  %125 = shl i32 %104, 1
  %126 = sitofp i32 %125 to double
  %127 = fdiv double %124, %126
  %128 = uitofp nneg i64 %120 to x86_fp80
  %sqrt = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %128)
  %129 = sitofp i32 %125 to x86_fp80
  %130 = fdiv x86_fp80 %sqrt, %129
  %131 = fptrunc x86_fp80 %130 to double
  %132 = fsub double %127, %131
  %133 = call noundef i32 @_Z3sgnd(double noundef %132)
  %134 = icmp sgt i32 %133, 0
  br i1 %134, label %135, label %141

135:                                              ; preds = %122
  %136 = load i32, ptr @etot, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr @etot, align 4, !tbaa !5
  %138 = sext i32 %136 to i64
  %139 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %138
  store double %132, ptr %139, align 16, !tbaa !19
  %.sroa.442.0..sroa_idx = getelementptr inbounds i8, ptr %139, i64 8
  store i32 %77, ptr %.sroa.442.0..sroa_idx, align 8, !tbaa !5
  %.sroa.543.0..sroa_idx = getelementptr inbounds i8, ptr %139, i64 12
  %140 = trunc nuw nsw i64 %indvars.iv196 to i32
  store i32 %140, ptr %.sroa.543.0..sroa_idx, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %135, %122
  %142 = fadd double %127, %131
  %143 = call noundef i32 @_Z3sgnd(double noundef %142)
  %144 = icmp sgt i32 %143, 0
  br i1 %144, label %.sink.split, label %150

.sink.split:                                      ; preds = %141, %105
  %.sink239 = phi double [ %110, %105 ], [ %142, %141 ]
  %145 = load i32, ptr @etot, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr @etot, align 4, !tbaa !5
  %147 = sext i32 %145 to i64
  %148 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %147
  store double %.sink239, ptr %148, align 16, !tbaa !19
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %148, i64 8
  store i32 %.sink237, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %148, i64 12
  %149 = trunc nuw nsw i64 %indvars.iv196 to i32
  store i32 %149, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %.sink.split, %113, %141, %105
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #11
  %indvars.iv.next197 = add nuw nsw i64 %indvars.iv196, 1
  %151 = load i32, ptr @m, align 4, !tbaa !5
  %152 = trunc nuw i64 %indvars.iv.next197 to i32
  %153 = icmp sgt i32 %151, %152
  br i1 %153, label %.lr.ph143, label %._crit_edge144.loopexit, !llvm.loop !21

._crit_edge180:                                   ; preds = %._crit_edge174, %._crit_edge148
  %.0123.lcssa = phi i32 [ 1, %._crit_edge148 ], [ %270, %._crit_edge174 ]
  %154 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.0119182, i32 noundef %.0123.lcssa)
  %155 = add nuw nsw i32 %.0119182, 1
  %156 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %157 = icmp eq i32 %156, 1
  br i1 %157, label %8, label %._crit_edge185, !llvm.loop !22

.lr.ph179:                                        ; preds = %.lr.ph179.preheader, %._crit_edge174
  %158 = phi i32 [ %271, %._crit_edge174 ], [ %46, %.lr.ph179.preheader ]
  %qtot.promoted = phi i32 [ %250, %._crit_edge174 ], [ %.pre, %.lr.ph179.preheader ]
  %.0121177 = phi i32 [ %.1122.lcssa, %._crit_edge174 ], [ 0, %.lr.ph179.preheader ]
  %.0123176 = phi i32 [ %270, %._crit_edge174 ], [ 1, %.lr.ph179.preheader ]
  %159 = sext i32 %qtot.promoted to i64
  %160 = shl nsw i64 %159, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @_ZZ4mainE3las, ptr nonnull align 16 @que, i64 %160, i1 false)
  %161 = load i32, ptr @stim, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr @stim, align 4, !tbaa !5
  %163 = icmp sgt i32 %qtot.promoted, 0
  br i1 %163, label %.lr.ph151.preheader, label %182

.lr.ph151.preheader:                              ; preds = %.lr.ph179
  %164 = zext nneg i32 %qtot.promoted to i64
  %xtraiter = and i64 %164, 1
  %165 = icmp eq i32 %qtot.promoted, 1
  br i1 %165, label %._crit_edge152.unr-lcssa, label %.lr.ph151.preheader.new

.lr.ph151.preheader.new:                          ; preds = %.lr.ph151.preheader
  %unroll_iter = and i64 %164, 2147483646
  br label %.lr.ph151

.lr.ph151:                                        ; preds = %.lr.ph151, %.lr.ph151.preheader.new
  %indvars.iv204 = phi i64 [ %164, %.lr.ph151.preheader.new ], [ %indvars.iv.next205.1, %.lr.ph151 ]
  %indvars.iv202 = phi i64 [ 0, %.lr.ph151.preheader.new ], [ %indvars.iv.next203.1, %.lr.ph151 ]
  %niter = phi i64 [ 0, %.lr.ph151.preheader.new ], [ %niter.next.1, %.lr.ph151 ]
  %indvars.iv.next205 = add nsw i64 %indvars.iv204, -1
  %166 = getelementptr inbounds [51 x i32], ptr @que, i64 0, i64 %indvars.iv.next205
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [1251 x i32], ptr @vis, i64 0, i64 %168
  store i32 %162, ptr %169, align 4, !tbaa !5
  %indvars.iv.next203 = or disjoint i64 %indvars.iv202, 1
  %170 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %indvars.iv202, i32 1
  store i32 %167, ptr %170, align 8, !tbaa !23
  %indvars.iv.next205.1 = add nsw i64 %indvars.iv204, -2
  %171 = getelementptr inbounds [51 x i32], ptr @que, i64 0, i64 %indvars.iv.next205.1
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [1251 x i32], ptr @vis, i64 0, i64 %173
  store i32 %162, ptr %174, align 4, !tbaa !5
  %indvars.iv.next203.1 = add nuw nsw i64 %indvars.iv202, 2
  %175 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %indvars.iv.next203, i32 1
  store i32 %172, ptr %175, align 8, !tbaa !23
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge152.unr-lcssa, label %.lr.ph151, !llvm.loop !25

._crit_edge152.unr-lcssa:                         ; preds = %.lr.ph151, %.lr.ph151.preheader
  %indvars.iv.next205.lcssa.ph = phi i64 [ poison, %.lr.ph151.preheader ], [ %indvars.iv.next205.1, %.lr.ph151 ]
  %indvars.iv204.unr = phi i64 [ %164, %.lr.ph151.preheader ], [ %indvars.iv.next205.1, %.lr.ph151 ]
  %indvars.iv202.unr = phi i64 [ 0, %.lr.ph151.preheader ], [ %indvars.iv.next203.1, %.lr.ph151 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge152, label %.lr.ph151.epil

.lr.ph151.epil:                                   ; preds = %._crit_edge152.unr-lcssa
  %indvars.iv.next205.epil = add nsw i64 %indvars.iv204.unr, -1
  %176 = getelementptr inbounds [51 x i32], ptr @que, i64 0, i64 %indvars.iv.next205.epil
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [1251 x i32], ptr @vis, i64 0, i64 %178
  store i32 %162, ptr %179, align 4, !tbaa !5
  %180 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %indvars.iv202.unr, i32 1
  store i32 %177, ptr %180, align 8, !tbaa !23
  br label %._crit_edge152

._crit_edge152:                                   ; preds = %._crit_edge152.unr-lcssa, %.lr.ph151.epil
  %indvars.iv.next205.lcssa = phi i64 [ %indvars.iv.next205.lcssa.ph, %._crit_edge152.unr-lcssa ], [ %indvars.iv.next205.epil, %.lr.ph151.epil ]
  %181 = trunc nuw nsw i64 %indvars.iv.next205.lcssa to i32
  store i32 %181, ptr @qtot, align 4, !tbaa !5
  br label %182

182:                                              ; preds = %._crit_edge152, %.lr.ph179
  %.0120.lcssa = phi i32 [ %qtot.promoted, %._crit_edge152 ], [ 0, %.lr.ph179 ]
  %183 = sext i32 %.0121177 to i64
  %184 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %183
  %185 = load double, ptr %184, align 16, !tbaa !26
  %186 = icmp slt i32 %.0121177, %158
  br i1 %186, label %.lr.ph157, label %.critedge

.lr.ph157:                                        ; preds = %182, %218
  %indvars.iv210 = phi i64 [ %indvars.iv.next211, %218 ], [ %183, %182 ]
  %.1155 = phi i32 [ %.3, %218 ], [ %.0120.lcssa, %182 ]
  %187 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %indvars.iv210
  %188 = load double, ptr %187, align 16, !tbaa !26
  %189 = fsub double %185, %188
  %190 = call noundef i32 @_Z3sgnd(double noundef %189)
  %.not = icmp eq i32 %190, 0
  br i1 %.not, label %197, label %.lr.ph157..critedge.loopexit_crit_edge

.lr.ph157..critedge.loopexit_crit_edge:           ; preds = %.lr.ph157
  %.pre229.pre = load i32, ptr @etot, align 4, !tbaa !5
  br label %.critedge.loopexit

.critedge.loopexit:                               ; preds = %218, %.lr.ph157..critedge.loopexit_crit_edge
  %.pre229 = phi i32 [ %.pre229.pre, %.lr.ph157..critedge.loopexit_crit_edge ], [ %219, %218 ]
  %.1122.lcssa.ph.in = phi i64 [ %indvars.iv210, %.lr.ph157..critedge.loopexit_crit_edge ], [ %indvars.iv.next211, %218 ]
  %.1.lcssa.ph = phi i32 [ %.1155, %.lr.ph157..critedge.loopexit_crit_edge ], [ %.3, %218 ]
  %.1122.lcssa.ph = trunc i64 %.1122.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %182
  %191 = phi i32 [ %158, %182 ], [ %.pre229, %.critedge.loopexit ]
  %.1122.lcssa = phi i32 [ %.0121177, %182 ], [ %.1122.lcssa.ph, %.critedge.loopexit ]
  %.1.lcssa = phi i32 [ %.0120.lcssa, %182 ], [ %.1.lcssa.ph, %.critedge.loopexit ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #11
  %192 = add nsw i32 %.1122.lcssa, -1
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %193
  %195 = load double, ptr %194, align 16, !tbaa !26
  %196 = icmp slt i32 %.1122.lcssa, %191
  br i1 %196, label %222, label %227

197:                                              ; preds = %.lr.ph157
  %198 = getelementptr inbounds i8, ptr %187, i64 8
  %199 = load i32, ptr %198, align 8, !tbaa !28
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [1251 x i32], ptr @vis, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = load i32, ptr @stim, align 4, !tbaa !5
  %.not134 = icmp eq i32 %202, %203
  br i1 %.not134, label %208, label %204

204:                                              ; preds = %197
  store i32 %203, ptr %201, align 4, !tbaa !5
  %205 = add nsw i32 %.1155, 1
  %206 = sext i32 %.1155 to i64
  %207 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %206, i32 1
  store i32 %199, ptr %207, align 8, !tbaa !23
  br label %208

208:                                              ; preds = %204, %197
  %.2 = phi i32 [ %205, %204 ], [ %.1155, %197 ]
  %209 = getelementptr inbounds i8, ptr %187, i64 12
  %210 = load i32, ptr %209, align 4, !tbaa !29
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [1251 x i32], ptr @vis, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %.not135 = icmp eq i32 %213, %203
  br i1 %.not135, label %218, label %214

214:                                              ; preds = %208
  store i32 %203, ptr %212, align 4, !tbaa !5
  %215 = add nsw i32 %.2, 1
  %216 = sext i32 %.2 to i64
  %217 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %216, i32 1
  store i32 %210, ptr %217, align 8, !tbaa !23
  br label %218

218:                                              ; preds = %208, %214
  %.3 = phi i32 [ %215, %214 ], [ %.2, %208 ]
  %indvars.iv.next211 = add nsw i64 %indvars.iv210, 1
  %219 = load i32, ptr @etot, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = icmp slt i64 %indvars.iv.next211, %220
  br i1 %221, label %.lr.ph157, label %.critedge.loopexit, !llvm.loop !30

222:                                              ; preds = %.critedge
  %223 = sext i32 %.1122.lcssa to i64
  %224 = getelementptr inbounds [1562501 x %struct.Event], ptr @eve, i64 0, i64 %223
  %225 = load double, ptr %224, align 16, !tbaa !26
  %226 = fsub double %225, %195
  br label %227

227:                                              ; preds = %.critedge, %222
  %228 = phi double [ %226, %222 ], [ 1.000000e+00, %.critedge ]
  %229 = call double @llvm.fmuladd.f64(double %228, double 5.000000e-01, double %195)
  store double %229, ptr %5, align 8, !tbaa !19
  %230 = icmp sgt i32 %.1.lcssa, 0
  br i1 %230, label %.lr.ph165.preheader, label %._crit_edge170.critedge

.lr.ph165.preheader:                              ; preds = %227
  %wide.trip.count217 = zext nneg i32 %.1.lcssa to i64
  br label %.lr.ph165

._crit_edge166:                                   ; preds = %.lr.ph165
  %231 = zext nneg i32 %.1.lcssa to i64
  %232 = getelementptr inbounds %"struct.std::pair", ptr @_ZZ4mainE3tmp, i64 %231
  call void @_ZSt4sortIPSt4pairIdiEEvT_S3_(ptr noundef nonnull @_ZZ4mainE3tmp, ptr noundef nonnull %232)
  %233 = load i32, ptr @n, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = shl nsw i64 %234, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @dsu, i8 -1, i64 %235, i1 false)
  br i1 %230, label %.lr.ph169.preheader, label %._crit_edge170

.lr.ph169.preheader:                              ; preds = %._crit_edge166
  %wide.trip.count223 = zext nneg i32 %.1.lcssa to i64
  br label %.lr.ph169

.lr.ph165:                                        ; preds = %.lr.ph165.preheader, %.lr.ph165
  %indvars.iv213 = phi i64 [ 0, %.lr.ph165.preheader ], [ %indvars.iv.next214, %.lr.ph165 ]
  %236 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %indvars.iv213
  %237 = getelementptr inbounds i8, ptr %236, i64 8
  %238 = load i32, ptr %237, align 8, !tbaa !23
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %239
  %241 = call noundef double @_ZNK4Edge4len2ERKd(ptr noundef nonnull align 4 dereferenceable(8) %240, ptr noundef nonnull align 8 dereferenceable(8) %5)
  store double %241, ptr %236, align 16, !tbaa !31
  %indvars.iv.next214 = add nuw nsw i64 %indvars.iv213, 1
  %exitcond218.not = icmp eq i64 %indvars.iv.next214, %wide.trip.count217
  br i1 %exitcond218.not, label %._crit_edge166, label %.lr.ph165, !llvm.loop !32

._crit_edge170.critedge:                          ; preds = %227
  %242 = sext i32 %.1.lcssa to i64
  %243 = getelementptr inbounds %"struct.std::pair", ptr @_ZZ4mainE3tmp, i64 %242
  call void @_ZSt4sortIPSt4pairIdiEEvT_S3_(ptr noundef nonnull @_ZZ4mainE3tmp, ptr noundef nonnull %243)
  %244 = load i32, ptr @n, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = shl nsw i64 %245, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @dsu, i8 -1, i64 %246, i1 false)
  br label %._crit_edge170

._crit_edge170:                                   ; preds = %267, %._crit_edge170.critedge, %._crit_edge166
  %247 = load i32, ptr @qtot, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds i32, ptr @que, i64 %248
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %249)
  %250 = load i32, ptr @qtot, align 4
  %251 = icmp sgt i32 %250, 0
  br i1 %251, label %.lr.ph173.preheader, label %._crit_edge174

.lr.ph173.preheader:                              ; preds = %._crit_edge170
  %252 = zext nneg i32 %250 to i64
  br label %.lr.ph173

.lr.ph169:                                        ; preds = %.lr.ph169.preheader, %267
  %indvars.iv219 = phi i64 [ 0, %.lr.ph169.preheader ], [ %indvars.iv.next220, %267 ]
  %253 = getelementptr inbounds [1251 x %"struct.std::pair"], ptr @_ZZ4mainE3tmp, i64 0, i64 %indvars.iv219, i32 1
  %254 = load i32, ptr %253, align 8, !tbaa !23
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [1251 x %struct.Edge], ptr @e, i64 0, i64 %255
  %257 = load i32, ptr %256, align 8, !tbaa !15
  %258 = getelementptr inbounds i8, ptr %256, i64 4
  %259 = load i32, ptr %258, align 4, !tbaa !17
  %260 = call noundef zeroext i1 @_Z9dsu_mergeii(i32 noundef %257, i32 noundef %259)
  br i1 %260, label %261, label %267

261:                                              ; preds = %.lr.ph169
  %262 = load i32, ptr %253, align 8, !tbaa !23
  %263 = load i32, ptr @qtot, align 4, !tbaa !5
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr @qtot, align 4, !tbaa !5
  %265 = sext i32 %263 to i64
  %266 = getelementptr inbounds [51 x i32], ptr @que, i64 0, i64 %265
  store i32 %262, ptr %266, align 4, !tbaa !5
  br label %267

267:                                              ; preds = %.lr.ph169, %261
  %indvars.iv.next220 = add nuw nsw i64 %indvars.iv219, 1
  %exitcond224.not = icmp eq i64 %indvars.iv.next220, %wide.trip.count223
  br i1 %exitcond224.not, label %._crit_edge170, label %.lr.ph169, !llvm.loop !33

._crit_edge174:                                   ; preds = %.lr.ph173, %._crit_edge170
  %.0116.lcssa = phi i1 [ true, %._crit_edge170 ], [ %277, %.lr.ph173 ]
  %268 = xor i1 %.0116.lcssa, true
  %269 = zext i1 %268 to i32
  %270 = add nuw nsw i32 %.0123176, %269
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #11
  %271 = load i32, ptr @etot, align 4, !tbaa !5
  %272 = icmp slt i32 %.1122.lcssa, %271
  br i1 %272, label %.lr.ph179, label %._crit_edge180, !llvm.loop !34

.lr.ph173:                                        ; preds = %.lr.ph173.preheader, %.lr.ph173
  %indvars.iv225 = phi i64 [ 0, %.lr.ph173.preheader ], [ %indvars.iv.next226, %.lr.ph173 ]
  %273 = getelementptr inbounds [51 x i32], ptr @_ZZ4mainE3las, i64 0, i64 %indvars.iv225
  %274 = load i32, ptr %273, align 4, !tbaa !5
  %275 = getelementptr inbounds [51 x i32], ptr @que, i64 0, i64 %indvars.iv225
  %276 = load i32, ptr %275, align 4, !tbaa !5
  %277 = icmp eq i32 %274, %276
  %indvars.iv.next226 = add nuw nsw i64 %indvars.iv225, 1
  %278 = icmp ult i64 %indvars.iv.next226, %252
  %279 = select i1 %277, i1 %278, i1 false
  br i1 %279, label %.lr.ph173, label %._crit_edge174, !llvm.loop !35
}

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

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

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

; Function Attrs: mustprogress 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) #4

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { i64, i32 } @_ZNK8Asteroid5PointmiERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK8Asteroid5Point4len2Ev(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8Asteroid5Point3dotERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #7 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnd(double noundef) local_unnamed_addr #8

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #9

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare x86_fp80 @llvm.sqrt.f80(x86_fp80) #10

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

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

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


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