; LLVM IR from tangjz/acm-icpc :: codeforces/gym/104022F.ll (Z5solvev)

; 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.std::pair" = type { i32, i32 }
%"class.std::mersenne_twister_engine" = type { [312 x i64], i64 }
%"class.std::random_device" = type { %union.anon }
%union.anon = type { %"class.std::mersenne_twister_engine.0" }
%"class.std::mersenne_twister_engine.0" = type { [624 x i64], i64 }
%class.anon = type { i8 }
%class.anon.1 = type { ptr, ptr, ptr, ptr }

@_ZL2pi = external hidden global double, align 8
@_ZZ5solvevE3ord = external hidden global [250001 x i32], align 16
@_ZZ5solvevE3dot = external hidden global [501 x [501 x i32]], align 16
@_ZZ5solvevE3det = external hidden global [501 x [501 x i32]], align 16
@_ZZ5solvevE1p = external hidden global [501 x %struct.Point], align 16
@_ZZ5solvevE1e = external hidden global [250001 x %struct.Point], align 16
@_ZZ5solvevE5edges = external hidden global [250001 x %"struct.std::pair"], align 16
@_ZZ5solvevE3rnd = external hidden global %"class.std::mersenne_twister_engine", align 8
@_ZGVZ5solvevE3rnd = external hidden global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::random_device", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.Point, align 4
  %11 = alloca %class.anon, align 1
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca i32, align 4
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca %class.anon.1, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #2
  store i32 0, ptr %2, align 4, !tbaa !5
  %22 = load atomic i8, ptr @_ZGVZ5solvevE3rnd acquire, align 8
  %23 = icmp eq i8 %22, 0
  br i1 %23, label %24, label %33, !prof !9

24:                                               ; preds = %0
  %25 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ5solvevE3rnd) #2
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %33

27:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 5000, ptr %3) #2
  invoke void @_ZNSt13random_deviceC2Ev(ptr noundef nonnull align 8 dereferenceable(5000) %3)
          to label %28 unwind label %40

28:                                               ; preds = %27
  %29 = invoke noundef i32 @_ZNSt13random_deviceclEv(ptr noundef nonnull align 8 dereferenceable(5000) %3)
          to label %30 unwind label %44

30:                                               ; preds = %28
  %31 = zext i32 %29 to i64
  invoke void @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEC2Em(ptr noundef nonnull align 8 dereferenceable(2504) @_ZZ5solvevE3rnd, i64 noundef %31)
          to label %32 unwind label %44

32:                                               ; preds = %30
  call void @_ZNSt13random_deviceD2Ev(ptr noundef nonnull align 8 dereferenceable(5000) %3) #2
  call void @llvm.lifetime.end.p0(i64 5000, ptr %3) #2
  call void @__cxa_guard_release(ptr @_ZGVZ5solvevE3rnd) #2
  br label %33

33:                                               ; preds = %32, %24, %0
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %53, %33
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %49, label %39

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

40:                                               ; preds = %27
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %4, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %5, align 4
  br label %48

44:                                               ; preds = %30, %28
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %4, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %5, align 4
  call void @_ZNSt13random_deviceD2Ev(ptr noundef nonnull align 8 dereferenceable(5000) %3) #2
  br label %48

48:                                               ; preds = %44, %40
  call void @llvm.lifetime.end.p0(i64 5000, ptr %3) #2
  call void @__cxa_guard_abort(ptr @_ZGVZ5solvevE3rnd) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #2
  br label %268

49:                                               ; preds = %35
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [501 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %51
  call void @_ZN5Point4readEv(ptr noundef nonnull align 4 dereferenceable(8) %52)
  br label %53

53:                                               ; preds = %49
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %6, align 4, !tbaa !5
  br label %35, !llvm.loop !10

56:                                               ; preds = %39
  %57 = load i32, ptr %1, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds %struct.Point, ptr @_ZZ5solvevE1p, i64 %58
  call void @_ZSt7shuffleIP5PointRSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEEvT_S5_OT0_(ptr noundef @_ZZ5solvevE1p, ptr noundef %59, ptr noundef nonnull align 8 dereferenceable(2504) @_ZZ5solvevE3rnd)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %161, %56
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = load i32, ptr %1, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

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

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %157, %65
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  br label %160

71:                                               ; preds = %66
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = load i32, ptr %9, align 4, !tbaa !5
  %74 = icmp eq i32 %72, %73
  br i1 %74, label %75, label %88

75:                                               ; preds = %71
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3det, i64 0, i64 %77
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [501 x i32], ptr %78, i64 0, i64 %80
  store i32 0, ptr %81, align 4, !tbaa !5
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3dot, i64 0, i64 %83
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [501 x i32], ptr %84, i64 0, i64 %86
  store i32 0, ptr %87, align 4, !tbaa !5
  br label %157

88:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  %89 = load i32, ptr %9, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [501 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %90
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [501 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %93
  %95 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %91, ptr noundef nonnull align 4 dereferenceable(8) %94)
  store i64 %95, ptr %10, align 4
  %96 = load i32, ptr %2, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %2, align 4, !tbaa !5
  %98 = sext i32 %96 to i64
  %99 = getelementptr inbounds [250001 x %struct.Point], ptr @_ZZ5solvevE1e, i64 0, i64 %98
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %99, ptr align 4 %10, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %103, label %113

103:                                              ; preds = %88
  %104 = load i32, ptr %2, align 4, !tbaa !5
  %105 = sub nsw i32 %104, 1
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [250001 x %struct.Point], ptr @_ZZ5solvevE1e, i64 0, i64 %106
  %108 = load i32, ptr %2, align 4, !tbaa !5
  %109 = sub nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [250001 x %struct.Point], ptr @_ZZ5solvevE1e, i64 0, i64 %110
  %112 = call noundef i32 @_ZNK5Point3dotERKS_(ptr noundef nonnull align 4 dereferenceable(8) %107, ptr noundef nonnull align 4 dereferenceable(8) %111)
  br label %121

113:                                              ; preds = %88
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3dot, i64 0, i64 %115
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [501 x i32], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %113, %103
  %122 = phi i32 [ %112, %103 ], [ %120, %113 ]
  %123 = load i32, ptr %7, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3dot, i64 0, i64 %124
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [501 x i32], ptr %125, i64 0, i64 %127
  store i32 %122, ptr %128, align 4, !tbaa !5
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %132, label %140

132:                                              ; preds = %121
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [501 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %134
  %136 = load i32, ptr %9, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [501 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %137
  %139 = call noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %135, ptr noundef nonnull align 4 dereferenceable(8) %138)
  br label %149

140:                                              ; preds = %121
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3det, i64 0, i64 %142
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [501 x i32], ptr %143, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = sub nsw i32 0, %147
  br label %149

149:                                              ; preds = %140, %132
  %150 = phi i32 [ %139, %132 ], [ %148, %140 ]
  %151 = load i32, ptr %7, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3det, i64 0, i64 %152
  %154 = load i32, ptr %9, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [501 x i32], ptr %153, i64 0, i64 %155
  store i32 %150, ptr %156, align 4, !tbaa !5
  br label %157

157:                                              ; preds = %149, %75
  %158 = load i32, ptr %9, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %9, align 4, !tbaa !5
  br label %66, !llvm.loop !13

160:                                              ; preds = %70
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %7, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %7, align 4, !tbaa !5
  br label %60, !llvm.loop !14

164:                                              ; preds = %64
  %165 = load i32, ptr %2, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds i32, ptr @_ZZ5solvevE3ord, i64 %166
  call void @_ZSt4iotaIPiiEvT_S1_T0_(ptr noundef @_ZZ5solvevE3ord, ptr noundef %167, i32 noundef 0)
  %168 = load i32, ptr %2, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds i32, ptr @_ZZ5solvevE3ord, i64 %169
  call void @"_ZSt4sortIPiZ5solvevE3$_0EvT_S2_T0_"(ptr noundef @_ZZ5solvevE3ord, ptr noundef %170)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %171

171:                                              ; preds = %213, %164
  %172 = load i32, ptr %12, align 4, !tbaa !5
  %173 = load i32, ptr %2, align 4, !tbaa !5
  %174 = icmp slt i32 %172, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %171
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  br label %216

176:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #2
  %177 = load i32, ptr %12, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [250001 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = load i32, ptr %1, align 4, !tbaa !5
  %182 = sub nsw i32 %181, 1
  %183 = sdiv i32 %180, %182
  store i32 %183, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #2
  %184 = load i32, ptr %12, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [250001 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = load i32, ptr %1, align 4, !tbaa !5
  %189 = sub nsw i32 %188, 1
  %190 = srem i32 %187, %189
  store i32 %190, ptr %15, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %191 = load i32, ptr %12, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [250001 x %"struct.std::pair"], ptr @_ZZ5solvevE5edges, i64 0, i64 %192
  %194 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %193, ptr noundef nonnull align 4 dereferenceable(8) %13) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #2
  %195 = load i32, ptr %12, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [250001 x %"struct.std::pair"], ptr @_ZZ5solvevE5edges, i64 0, i64 %196
  %198 = getelementptr inbounds %"struct.std::pair", ptr %197, i32 0, i32 1
  %199 = load i32, ptr %198, align 4, !tbaa !15
  %200 = load i32, ptr %12, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [250001 x %"struct.std::pair"], ptr @_ZZ5solvevE5edges, i64 0, i64 %201
  %203 = getelementptr inbounds %"struct.std::pair", ptr %202, i32 0, i32 0
  %204 = load i32, ptr %203, align 8, !tbaa !17
  %205 = icmp sge i32 %199, %204
  %206 = zext i1 %205 to i32
  %207 = load i32, ptr %12, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [250001 x %"struct.std::pair"], ptr @_ZZ5solvevE5edges, i64 0, i64 %208
  %210 = getelementptr inbounds %"struct.std::pair", ptr %209, i32 0, i32 1
  %211 = load i32, ptr %210, align 4, !tbaa !15
  %212 = add nsw i32 %211, %206
  store i32 %212, ptr %210, align 4, !tbaa !15
  br label %213

213:                                              ; preds = %176
  %214 = load i32, ptr %12, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %12, align 4, !tbaa !5
  br label %171, !llvm.loop !18

216:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #2
  store double 0.000000e+00, ptr %16, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #2
  %217 = load i32, ptr %1, align 4, !tbaa !5
  %218 = sitofp i32 %217 to double
  %219 = load double, ptr @_ZL2pi, align 8, !tbaa !19
  %220 = fmul double 2.000000e+00, %219
  %221 = fdiv double %218, %220
  store double %221, ptr %17, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #2
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %222

222:                                              ; preds = %262, %216
  %223 = load i32, ptr %18, align 4, !tbaa !5
  %224 = load i32, ptr %1, align 4, !tbaa !5
  %225 = icmp slt i32 %223, %224
  br i1 %225, label %227, label %226

226:                                              ; preds = %222
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #2
  br label %265

227:                                              ; preds = %222
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #2
  %228 = load double, ptr %16, align 8, !tbaa !19
  %229 = fadd double %228, 1.000000e-09
  store double %229, ptr %19, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #2
  %230 = load double, ptr %17, align 8, !tbaa !19
  store double %230, ptr %20, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #2
  %231 = getelementptr inbounds %class.anon.1, ptr %21, i32 0, i32 0
  store ptr %1, ptr %231, align 8, !tbaa !21
  %232 = getelementptr inbounds %class.anon.1, ptr %21, i32 0, i32 1
  store ptr %18, ptr %232, align 8, !tbaa !21
  %233 = getelementptr inbounds %class.anon.1, ptr %21, i32 0, i32 2
  store ptr %2, ptr %233, align 8, !tbaa !21
  %234 = getelementptr inbounds %class.anon.1, ptr %21, i32 0, i32 3
  store ptr %19, ptr %234, align 8, !tbaa !21
  %235 = load double, ptr %19, align 8, !tbaa !19
  %236 = load double, ptr %20, align 8, !tbaa !19
  %237 = fcmp ogt double %235, %236
  br i1 %237, label %240, label %238

238:                                              ; preds = %227
  %239 = call noundef zeroext i1 @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(32) %21)
  br i1 %239, label %241, label %240

240:                                              ; preds = %238, %227
  store i32 16, ptr %8, align 4
  br label %259

241:                                              ; preds = %238
  br label %242

242:                                              ; preds = %257, %241
  %243 = load double, ptr %20, align 8, !tbaa !19
  %244 = load double, ptr %16, align 8, !tbaa !19
  %245 = fsub double %243, %244
  %246 = fcmp oge double %245, 1.000000e-09
  br i1 %246, label %247, label %258

247:                                              ; preds = %242
  %248 = load double, ptr %16, align 8, !tbaa !19
  %249 = load double, ptr %20, align 8, !tbaa !19
  %250 = fadd double %248, %249
  %251 = fdiv double %250, 2.000000e+00
  store double %251, ptr %19, align 8, !tbaa !19
  %252 = call noundef zeroext i1 @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(32) %21)
  br i1 %252, label %253, label %255

253:                                              ; preds = %247
  %254 = load double, ptr %19, align 8, !tbaa !19
  store double %254, ptr %16, align 8, !tbaa !19
  br label %257

255:                                              ; preds = %247
  %256 = load double, ptr %19, align 8, !tbaa !19
  store double %256, ptr %20, align 8, !tbaa !19
  br label %257

257:                                              ; preds = %255, %253
  br label %242, !llvm.loop !23

258:                                              ; preds = %242
  store i32 0, ptr %8, align 4
  br label %259

259:                                              ; preds = %258, %240
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #2
  %260 = load i32, ptr %8, align 4
  switch i32 %260, label %273 [
    i32 0, label %261
    i32 16, label %262
  ]

261:                                              ; preds = %259
  br label %262

262:                                              ; preds = %261, %259
  %263 = load i32, ptr %18, align 4, !tbaa !5
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr %18, align 4, !tbaa !5
  br label %222, !llvm.loop !24

265:                                              ; preds = %226
  %266 = load double, ptr %16, align 8, !tbaa !19
  %267 = fdiv double %266, 2.000000e+00
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #2
  ret double %267

268:                                              ; preds = %48
  %269 = load ptr, ptr %4, align 8
  %270 = load i32, ptr %5, align 4
  %271 = insertvalue { ptr, i32 } poison, ptr %269, 0
  %272 = insertvalue { ptr, i32 } %271, i32 %270, 1
  resume { ptr, i32 } %272

273:                                              ; preds = %259
  unreachable
}

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

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNSt13random_deviceclEv(ptr noundef nonnull align 8 dereferenceable(5000)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEC2Em(ptr noundef nonnull align 8 dereferenceable(2504), i64 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13random_deviceD2Ev(ptr noundef nonnull align 8 dereferenceable(5000)) unnamed_addr #3 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: nounwind
declare void @__cxa_guard_abort(ptr) #2

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #2

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: mustprogress uwtable
declare dso_local void @_ZSt7shuffleIP5PointRSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEEvT_S5_OT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(2504)) #0

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPiiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPiZ5solvevE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(32)) #7 align 2

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

!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 = !{!"branch_weights", i32 1, i32 1048575}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = !{!16, !6, i64 4}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!16, !6, i64 0}
!18 = distinct !{!18, !11}
!19 = !{!20, !20, i64 0}
!20 = !{!"double", !7, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"any pointer", !7, i64 0}
!23 = distinct !{!23, !11}
!24 = distinct !{!24, !11}


; 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.std::pair" = type { i32, i32 }
%"class.std::mersenne_twister_engine" = type { [312 x i64], i64 }
%"class.std::random_device" = type { %union.anon }
%union.anon = type { %"class.std::mersenne_twister_engine.0" }
%"class.std::mersenne_twister_engine.0" = type { [624 x i64], i64 }
%class.anon.1 = type { ptr, ptr, ptr, ptr }

@_ZL2pi = external hidden local_unnamed_addr global double, align 8
@_ZZ5solvevE3ord = external hidden global [250001 x i32], align 16
@_ZZ5solvevE3dot = external hidden local_unnamed_addr global [501 x [501 x i32]], align 16
@_ZZ5solvevE3det = external hidden local_unnamed_addr global [501 x [501 x i32]], align 16
@_ZZ5solvevE1p = external hidden global [501 x %struct.Point], align 16
@_ZZ5solvevE1e = external hidden global [250001 x %struct.Point], align 16
@_ZZ5solvevE5edges = external hidden global [250001 x %"struct.std::pair"], align 16
@_ZZ5solvevE3rnd = external hidden global %"class.std::mersenne_twister_engine", align 8
@_ZGVZ5solvevE3rnd = external hidden global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::random_device", align 8
  %4 = alloca %"struct.std::pair", align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca %class.anon.1, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  %10 = load atomic i8, ptr @_ZGVZ5solvevE3rnd acquire, align 8
  %11 = icmp eq i8 %10, 0
  br i1 %11, label %12, label %20, !prof !9

12:                                               ; preds = %0
  %13 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ5solvevE3rnd) #7
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %20, label %14

14:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 5000, ptr nonnull %3) #7
  invoke void @_ZNSt13random_deviceC2Ev(ptr noundef nonnull align 8 dereferenceable(5000) %3)
          to label %15 unwind label %27

15:                                               ; preds = %14
  %16 = invoke noundef i32 @_ZNSt13random_deviceclEv(ptr noundef nonnull align 8 dereferenceable(5000) %3)
          to label %17 unwind label %29

17:                                               ; preds = %15
  %18 = zext i32 %16 to i64
  invoke void @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEC2Em(ptr noundef nonnull align 8 dereferenceable(2504) @_ZZ5solvevE3rnd, i64 noundef %18)
          to label %19 unwind label %29

19:                                               ; preds = %17
  call void @_ZNSt13random_deviceD2Ev(ptr noundef nonnull align 8 dereferenceable(5000) %3) #7
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %3) #7
  call void @__cxa_guard_release(ptr nonnull @_ZGVZ5solvevE3rnd) #7
  br label %20

20:                                               ; preds = %19, %12, %0
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %20
  %.pre92 = sext i32 %22 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre92, %.._crit_edge_crit_edge ], [ %34, %.lr.ph ]
  %24 = getelementptr inbounds %struct.Point, ptr @_ZZ5solvevE1p, i64 %.pre-phi
  call void @_ZSt7shuffleIP5PointRSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEEvT_S5_OT0_(ptr noundef nonnull @_ZZ5solvevE1p, ptr noundef nonnull %24, ptr noundef nonnull align 8 dereferenceable(2504) @_ZZ5solvevE3rnd)
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.preheader57, label %._crit_edge63

27:                                               ; preds = %14
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %31

29:                                               ; preds = %17, %15
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt13random_deviceD2Ev(ptr noundef nonnull align 8 dereferenceable(5000) %3) #7
  br label %31

31:                                               ; preds = %29, %27
  %.pn = phi { ptr, i32 } [ %30, %29 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %3) #7
  call void @__cxa_guard_abort(ptr nonnull @_ZGVZ5solvevE3rnd) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn

.lr.ph:                                           ; preds = %20, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %20 ]
  %32 = getelementptr inbounds [501 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %indvars.iv
  call void @_ZN5Point4readEv(ptr noundef nonnull align 4 dereferenceable(8) %32)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = load i32, ptr %1, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = icmp slt i64 %indvars.iv.next, %34
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !10

.preheader57:                                     ; preds = %._crit_edge, %._crit_edge61
  %36 = phi i32 [ %45, %._crit_edge61 ], [ %25, %._crit_edge ]
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %._crit_edge61 ], [ 0, %._crit_edge ]
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %.lr.ph60, label %._crit_edge61

.lr.ph60:                                         ; preds = %.preheader57
  %38 = getelementptr inbounds [501 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %indvars.iv86
  %39 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3det, i64 0, i64 %indvars.iv86, i64 %indvars.iv86
  %40 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3dot, i64 0, i64 %indvars.iv86, i64 %indvars.iv86
  br label %48

._crit_edge63:                                    ; preds = %._crit_edge61, %._crit_edge
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr @_ZZ5solvevE3ord, i64 %42
  call void @_ZSt4iotaIPiiEvT_S1_T0_(ptr noundef nonnull @_ZZ5solvevE3ord, ptr noundef nonnull %43, i32 noundef 0)
  call void @"_ZSt4sortIPiZ5solvevE3$_0EvT_S2_T0_"(ptr noundef nonnull @_ZZ5solvevE3ord, ptr noundef nonnull %43)
  %44 = icmp sgt i32 %41, 0
  br i1 %44, label %.lr.ph66, label %._crit_edge67

._crit_edge61:                                    ; preds = %75, %.preheader57
  %45 = phi i32 [ %36, %.preheader57 ], [ %76, %75 ]
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next87, %46
  br i1 %47, label %.preheader57, label %._crit_edge63, !llvm.loop !12

48:                                               ; preds = %.lr.ph60, %75
  %49 = phi i32 [ %36, %.lr.ph60 ], [ %76, %75 ]
  %50 = phi i32 [ %36, %.lr.ph60 ], [ %77, %75 ]
  %indvars.iv83 = phi i64 [ 0, %.lr.ph60 ], [ %indvars.iv.next84, %75 ]
  %51 = icmp eq i64 %indvars.iv86, %indvars.iv83
  br i1 %51, label %52, label %53

52:                                               ; preds = %48
  store i32 0, ptr %39, align 4, !tbaa !5
  store i32 0, ptr %40, align 4, !tbaa !5
  br label %75

53:                                               ; preds = %48
  %54 = getelementptr inbounds [501 x %struct.Point], ptr @_ZZ5solvevE1p, i64 0, i64 %indvars.iv83
  %55 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %54, ptr noundef nonnull align 4 dereferenceable(8) %38)
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %2, align 4, !tbaa !5
  %58 = sext i32 %56 to i64
  %59 = getelementptr inbounds [250001 x %struct.Point], ptr @_ZZ5solvevE1e, i64 0, i64 %58
  store i64 %55, ptr %59, align 8
  %60 = icmp ult i64 %indvars.iv86, %indvars.iv83
  br i1 %60, label %61, label %65

61:                                               ; preds = %53
  %62 = call noundef i32 @_ZNK5Point3dotERKS_(ptr noundef nonnull align 4 dereferenceable(8) %59, ptr noundef nonnull align 4 dereferenceable(8) %59)
  %63 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3dot, i64 0, i64 %indvars.iv86, i64 %indvars.iv83
  store i32 %62, ptr %63, align 4, !tbaa !5
  %64 = call noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %38, ptr noundef nonnull align 4 dereferenceable(8) %54)
  br label %72

65:                                               ; preds = %53
  %66 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3dot, i64 0, i64 %indvars.iv83, i64 %indvars.iv86
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3dot, i64 0, i64 %indvars.iv86, i64 %indvars.iv83
  store i32 %67, ptr %68, align 4, !tbaa !5
  %69 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3det, i64 0, i64 %indvars.iv83, i64 %indvars.iv86
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = sub nsw i32 0, %70
  br label %72

72:                                               ; preds = %65, %61
  %73 = phi i32 [ %64, %61 ], [ %71, %65 ]
  %74 = getelementptr inbounds [501 x [501 x i32]], ptr @_ZZ5solvevE3det, i64 0, i64 %indvars.iv86, i64 %indvars.iv83
  store i32 %73, ptr %74, align 4, !tbaa !5
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %72, %52
  %76 = phi i32 [ %.pre, %72 ], [ %49, %52 ]
  %77 = phi i32 [ %.pre, %72 ], [ %50, %52 ]
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv.next84, %78
  br i1 %79, label %48, label %._crit_edge61, !llvm.loop !14

._crit_edge67:                                    ; preds = %.lr.ph66, %._crit_edge63
  %80 = load i32, ptr %1, align 4, !tbaa !5
  %81 = sitofp i32 %80 to double
  %82 = load double, ptr @_ZL2pi, align 8, !tbaa !15
  %83 = fmul double %82, 2.000000e+00
  %84 = fdiv double %81, %83
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  %85 = icmp sgt i32 %80, 0
  br i1 %85, label %.lr.ph74, label %._crit_edge75

.lr.ph74:                                         ; preds = %._crit_edge67
  %86 = getelementptr inbounds i8, ptr %9, i64 8
  %87 = getelementptr inbounds i8, ptr %9, i64 16
  %88 = getelementptr inbounds i8, ptr %9, i64 24
  br label %105

.lr.ph66:                                         ; preds = %._crit_edge63, %.lr.ph66
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %.lr.ph66 ], [ 0, %._crit_edge63 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %89 = getelementptr inbounds [250001 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %indvars.iv89
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = load i32, ptr %1, align 4, !tbaa !5
  %92 = add nsw i32 %91, -1
  %93 = sdiv i32 %90, %92
  store i32 %93, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %94 = srem i32 %90, %92
  store i32 %94, ptr %6, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %95 = getelementptr inbounds [250001 x %"struct.std::pair"], ptr @_ZZ5solvevE5edges, i64 0, i64 %indvars.iv89
  %96 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %95, ptr noundef nonnull align 4 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %97 = getelementptr inbounds i8, ptr %95, i64 4
  %98 = load i32, ptr %97, align 4, !tbaa !17
  %99 = load i32, ptr %95, align 8, !tbaa !19
  %100 = icmp sge i32 %98, %99
  %101 = zext i1 %100 to i32
  %102 = add nsw i32 %98, %101
  store i32 %102, ptr %97, align 4, !tbaa !17
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %103 = icmp slt i64 %indvars.iv.next90, %42
  br i1 %103, label %.lr.ph66, label %._crit_edge67, !llvm.loop !20

._crit_edge75.loopexit:                           ; preds = %.loopexit
  %104 = fmul double %.3, 5.000000e-01
  br label %._crit_edge75

._crit_edge75:                                    ; preds = %._crit_edge75.loopexit, %._crit_edge67
  %.047.lcssa = phi double [ 0.000000e+00, %._crit_edge67 ], [ %104, %._crit_edge75.loopexit ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret double %.047.lcssa

105:                                              ; preds = %.lr.ph74, %.loopexit
  %.04772 = phi double [ 0.000000e+00, %.lr.ph74 ], [ %.3, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %106 = fadd double %.04772, 1.000000e-09
  store double %106, ptr %8, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #7
  store ptr %1, ptr %9, align 8, !tbaa !21
  store ptr %7, ptr %86, align 8, !tbaa !21
  store ptr %2, ptr %87, align 8, !tbaa !21
  store ptr %8, ptr %88, align 8, !tbaa !21
  %107 = fcmp ogt double %106, %84
  br i1 %107, label %.loopexit, label %108

108:                                              ; preds = %105
  %109 = call noundef zeroext i1 @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(32) %9)
  %110 = fsub double %84, %.04772
  %111 = fcmp oge double %110, 1.000000e-09
  %or.cond.not = select i1 %109, i1 %111, i1 false
  br i1 %or.cond.not, label %.lr.ph70, label %.loopexit

.lr.ph70:                                         ; preds = %108, %.lr.ph70
  %.069 = phi double [ %.1, %.lr.ph70 ], [ %84, %108 ]
  %.14868 = phi double [ %.2, %.lr.ph70 ], [ %.04772, %108 ]
  %112 = fadd double %.14868, %.069
  %113 = fmul double %112, 5.000000e-01
  store double %113, ptr %8, align 8, !tbaa !15
  %114 = call noundef zeroext i1 @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(32) %9)
  %115 = load double, ptr %8, align 8
  %.2 = select i1 %114, double %115, double %.14868
  %.1 = select i1 %114, double %.069, double %115
  %116 = fsub double %.1, %.2
  %117 = fcmp ult double %116, 1.000000e-09
  br i1 %117, label %.loopexit, label %.lr.ph70, !llvm.loop !23

.loopexit:                                        ; preds = %.lr.ph70, %105, %108
  %.3 = phi double [ %.04772, %108 ], [ %.04772, %105 ], [ %.2, %.lr.ph70 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %7, align 4, !tbaa !5
  %120 = load i32, ptr %1, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %105, label %._crit_edge75.loopexit, !llvm.loop !24
}

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

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNSt13random_deviceclEv(ptr noundef nonnull align 8 dereferenceable(5000)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEC2Em(ptr noundef nonnull align 8 dereferenceable(2504), i64 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13random_deviceD2Ev(ptr noundef nonnull align 8 dereferenceable(5000)) unnamed_addr #3 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: nofree nounwind
declare void @__cxa_guard_abort(ptr) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #2

; 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: mustprogress uwtable
declare dso_local void @_ZSt7shuffleIP5PointRSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEEvT_S5_OT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(2504)) local_unnamed_addr #0

; 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 #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPiiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPiZ5solvevE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #6 align 2

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 = { nofree nounwind }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 #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 = !{!"branch_weights", i32 1, i32 1048575}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11, !13}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !11}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!18, !6, i64 4}
!18 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!19 = !{!18, !6, i64 0}
!20 = distinct !{!20, !11}
!21 = !{!22, !22, i64 0}
!22 = !{!"any pointer", !7, i64 0}
!23 = distinct !{!23, !11}
!24 = distinct !{!24, !11}


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