; LLVM IR from eyangch/competitive-programming :: USACOtraining/5.1 (fc)

; 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.std::pair" = type { double, double }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::_Setprecision" = type { i32 }

@N = external dso_local global i32, align 4
@pt = external dso_local global [10000 x %"struct.std::pair"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca double, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca %"struct.std::pair", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca %"struct.std::_Setprecision", align 4
  store i32 0, ptr %1, align 4
  %22 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %23 = getelementptr i8, ptr %22, i64 -24
  %24 = load i64, ptr %23, align 8
  %25 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %24
  %26 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %25, ptr noundef null)
  %27 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %28 = load ptr, ptr @stdin, align 8, !tbaa !8
  %29 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %28)
  %30 = load ptr, ptr @stdout, align 8, !tbaa !8
  %31 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %30)
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !11
  br label %33

33:                                               ; preds = %49, %0
  %34 = load i32, ptr %2, align 4, !tbaa !11
  %35 = load i32, ptr @N, align 4, !tbaa !11
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %52

38:                                               ; preds = %33
  %39 = load i32, ptr %2, align 4, !tbaa !11
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [10000 x %"struct.std::pair"], ptr @pt, i64 0, i64 %40
  %42 = getelementptr inbounds %"struct.std::pair", ptr %41, i32 0, i32 0
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %42)
  %44 = load i32, ptr %2, align 4, !tbaa !11
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [10000 x %"struct.std::pair"], ptr @pt, i64 0, i64 %45
  %47 = getelementptr inbounds %"struct.std::pair", ptr %46, i32 0, i32 1
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull align 8 dereferenceable(8) %47)
  br label %49

49:                                               ; preds = %38
  %50 = load i32, ptr %2, align 4, !tbaa !11
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %2, align 4, !tbaa !11
  br label %33, !llvm.loop !13

52:                                               ; preds = %37
  %53 = load i32, ptr @N, align 4, !tbaa !11
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds %"struct.std::pair", ptr @pt, i64 %54
  call void @_ZSt4sortIPSt4pairIddEEvT_S3_(ptr noundef @pt, ptr noundef %55)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #8
  call void @_ZNSt6vectorISt4pairIddESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #8
  call void @_ZNSt6vectorISt4pairIddESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !11
  br label %56

56:                                               ; preds = %136, %52
  %57 = load i32, ptr %5, align 4, !tbaa !11
  %58 = load i32, ptr @N, align 4, !tbaa !11
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

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

61:                                               ; preds = %56
  br label %62

62:                                               ; preds = %91, %61
  %63 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  %64 = icmp uge i64 %63, 2
  br i1 %64, label %65, label %89

65:                                               ; preds = %62
  %66 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  %67 = sub i64 %66, 2
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %67) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %68, i64 16, i1 false)
  %69 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  %70 = sub i64 %69, 1
  %71 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %70) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %71, i64 16, i1 false)
  %72 = load i32, ptr %5, align 4, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [10000 x %"struct.std::pair"], ptr @pt, i64 0, i64 %73
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 16 %74, i64 16, i1 false)
  %75 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 0
  %76 = load double, ptr %75, align 8
  %77 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 1
  %78 = load double, ptr %77, align 8
  %79 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  %80 = load double, ptr %79, align 8
  %81 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  %82 = load double, ptr %81, align 8
  %83 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  %84 = load double, ptr %83, align 8
  %85 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  %86 = load double, ptr %85, align 8
  %87 = call noundef double @_Z3ccwSt4pairIddES0_S0_(double %76, double %78, double %80, double %82, double %84, double %86)
  %88 = fcmp oge double %87, -1.000000e-03
  br label %89

89:                                               ; preds = %65, %62
  %90 = phi i1 [ false, %62 ], [ %88, %65 ]
  br i1 %90, label %91, label %92

91:                                               ; preds = %89
  call void @_ZNSt6vectorISt4pairIddESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  br label %62, !llvm.loop !15

92:                                               ; preds = %89
  %93 = load i32, ptr %5, align 4, !tbaa !11
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [10000 x %"struct.std::pair"], ptr @pt, i64 0, i64 %94
  invoke void @_ZNSt6vectorISt4pairIddESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(16) %95)
          to label %96 unwind label %127

96:                                               ; preds = %92
  br label %97

97:                                               ; preds = %126, %96
  %98 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %99 = icmp uge i64 %98, 2
  br i1 %99, label %100, label %124

100:                                              ; preds = %97
  %101 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %102 = sub i64 %101, 2
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %102) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %103, i64 16, i1 false)
  %104 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %105 = sub i64 %104, 1
  %106 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %105) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %106, i64 16, i1 false)
  %107 = load i32, ptr %5, align 4, !tbaa !11
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [10000 x %"struct.std::pair"], ptr @pt, i64 0, i64 %108
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 16 %109, i64 16, i1 false)
  %110 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  %111 = load double, ptr %110, align 8
  %112 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  %113 = load double, ptr %112, align 8
  %114 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  %115 = load double, ptr %114, align 8
  %116 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  %117 = load double, ptr %116, align 8
  %118 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %119 = load double, ptr %118, align 8
  %120 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %121 = load double, ptr %120, align 8
  %122 = call noundef double @_Z3ccwSt4pairIddES0_S0_(double %111, double %113, double %115, double %117, double %119, double %121)
  %123 = fcmp ole double %122, 1.000000e-03
  br label %124

124:                                              ; preds = %100, %97
  %125 = phi i1 [ false, %97 ], [ %123, %100 ]
  br i1 %125, label %126, label %131

126:                                              ; preds = %124
  call void @_ZNSt6vectorISt4pairIddESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  br label %97, !llvm.loop !16

127:                                              ; preds = %131, %92
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %9, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %217

131:                                              ; preds = %124
  %132 = load i32, ptr %5, align 4, !tbaa !11
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [10000 x %"struct.std::pair"], ptr @pt, i64 0, i64 %133
  invoke void @_ZNSt6vectorISt4pairIddESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(16) %134)
          to label %135 unwind label %127

135:                                              ; preds = %131
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %5, align 4, !tbaa !11
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %5, align 4, !tbaa !11
  br label %56, !llvm.loop !17

139:                                              ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store double 0.000000e+00, ptr %14, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 1, ptr %15, align 4, !tbaa !11
  br label %140

140:                                              ; preds = %165, %139
  %141 = load i32, ptr %15, align 4, !tbaa !11
  %142 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  %143 = trunc i64 %142 to i32
  %144 = icmp slt i32 %141, %143
  br i1 %144, label %146, label %145

145:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %168

146:                                              ; preds = %140
  %147 = load i32, ptr %15, align 4, !tbaa !11
  %148 = sub nsw i32 %147, 1
  %149 = sext i32 %148 to i64
  %150 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %149) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %150, i64 16, i1 false)
  %151 = load i32, ptr %15, align 4, !tbaa !11
  %152 = sext i32 %151 to i64
  %153 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %152) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %153, i64 16, i1 false)
  %154 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %155 = load double, ptr %154, align 8
  %156 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %157 = load double, ptr %156, align 8
  %158 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %159 = load double, ptr %158, align 8
  %160 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %161 = load double, ptr %160, align 8
  %162 = call noundef double @_Z4distSt4pairIddES0_(double %155, double %157, double %159, double %161)
  %163 = load double, ptr %14, align 8, !tbaa !18
  %164 = fadd double %163, %162
  store double %164, ptr %14, align 8, !tbaa !18
  br label %165

165:                                              ; preds = %146
  %166 = load i32, ptr %15, align 4, !tbaa !11
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %15, align 4, !tbaa !11
  br label %140, !llvm.loop !20

168:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 1, ptr %18, align 4, !tbaa !11
  br label %169

169:                                              ; preds = %194, %168
  %170 = load i32, ptr %18, align 4, !tbaa !11
  %171 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %172 = trunc i64 %171 to i32
  %173 = icmp slt i32 %170, %172
  br i1 %173, label %175, label %174

174:                                              ; preds = %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %197

175:                                              ; preds = %169
  %176 = load i32, ptr %18, align 4, !tbaa !11
  %177 = sub nsw i32 %176, 1
  %178 = sext i32 %177 to i64
  %179 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %178) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %179, i64 16, i1 false)
  %180 = load i32, ptr %18, align 4, !tbaa !11
  %181 = sext i32 %180 to i64
  %182 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %181) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %182, i64 16, i1 false)
  %183 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %184 = load double, ptr %183, align 8
  %185 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %186 = load double, ptr %185, align 8
  %187 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %188 = load double, ptr %187, align 8
  %189 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %190 = load double, ptr %189, align 8
  %191 = call noundef double @_Z4distSt4pairIddES0_(double %184, double %186, double %188, double %190)
  %192 = load double, ptr %14, align 8, !tbaa !18
  %193 = fadd double %192, %191
  store double %193, ptr %14, align 8, !tbaa !18
  br label %194

194:                                              ; preds = %175
  %195 = load i32, ptr %18, align 4, !tbaa !11
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %18, align 4, !tbaa !11
  br label %169, !llvm.loop !21

197:                                              ; preds = %174
  %198 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt5fixedRSt8ios_base)
          to label %199 unwind label %213

199:                                              ; preds = %197
  %200 = invoke i32 @_ZSt12setprecisioni(i32 noundef 2)
          to label %201 unwind label %213

201:                                              ; preds = %199
  %202 = getelementptr inbounds %"struct.std::_Setprecision", ptr %21, i32 0, i32 0
  store i32 %200, ptr %202, align 4
  %203 = getelementptr inbounds %"struct.std::_Setprecision", ptr %21, i32 0, i32 0
  %204 = load i32, ptr %203, align 4
  %205 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %198, i32 %204)
          to label %206 unwind label %213

206:                                              ; preds = %201
  %207 = load double, ptr %14, align 8, !tbaa !18
  %208 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %205, double noundef %207)
          to label %209 unwind label %213

209:                                              ; preds = %206
  %210 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %208, ptr noundef @.str.4)
          to label %211 unwind label %213

211:                                              ; preds = %209
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @_ZNSt6vectorISt4pairIddESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #8
  call void @_ZNSt6vectorISt4pairIddESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #8
  %212 = load i32, ptr %1, align 4
  ret i32 %212

213:                                              ; preds = %209, %206, %201, %199, %197
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %9, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %217

217:                                              ; preds = %213, %127
  call void @_ZNSt6vectorISt4pairIddESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #8
  call void @_ZNSt6vectorISt4pairIddESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #8
  br label %218

218:                                              ; preds = %217
  %219 = load ptr, ptr %9, align 8
  %220 = load i32, ptr %10, align 4
  %221 = insertvalue { ptr, i32 } poison, ptr %219, 0
  %222 = insertvalue { ptr, i32 } %221, i32 %220, 1
  resume { ptr, i32 } %222
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #0 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #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) #6

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt5fixedRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt12setprecisioni(i32 noundef) #7

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !10, i64 0}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !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.std::pair" = type { double, double }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<double, double>, std::allocator<std::pair<double, double>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@N = external dso_local global i32, align 4
@pt = external dso_local global [10000 x %"struct.std::pair"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = load ptr, ptr @stdin, align 8, !tbaa !8
  %10 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %9)
  %11 = load ptr, ptr @stdout, align 8, !tbaa !8
  %12 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %11)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %14 = load i32, ptr @N, align 4, !tbaa !11
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = sext i32 %14 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %24, %.lr.ph ]
  %16 = getelementptr inbounds %"struct.std::pair", ptr @pt, i64 %.pre-phi
  tail call void @_ZSt4sortIPSt4pairIddEEvT_S3_(ptr noundef nonnull @pt, ptr noundef nonnull %16)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  call void @_ZNSt6vectorISt4pairIddESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #7
  call void @_ZNSt6vectorISt4pairIddESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %17 = load i32, ptr @N, align 4, !tbaa !11
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.preheader54, label %.preheader52

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %19 = getelementptr inbounds [10000 x %"struct.std::pair"], ptr @pt, i64 0, i64 %indvars.iv
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %21 = getelementptr inbounds i8, ptr %19, i64 8
  %22 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr @N, align 4, !tbaa !11
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader54:                                     ; preds = %._crit_edge, %61
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %61 ], [ 0, %._crit_edge ]
  %26 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %27 = icmp ugt i64 %26, 1
  br i1 %27, label %.lr.ph56, label %.critedge

.lr.ph56:                                         ; preds = %.preheader54
  %28 = getelementptr inbounds [10000 x %"struct.std::pair"], ptr @pt, i64 0, i64 %indvars.iv74
  %.sroa.228.0..sroa_idx = getelementptr inbounds i8, ptr %28, i64 8
  br label %32

.preheader52:                                     ; preds = %61, %._crit_edge
  %29 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %30 = trunc i64 %29 to i32
  %31 = icmp sgt i32 %30, 1
  br i1 %31, label %.lr.ph63, label %.preheader

32:                                               ; preds = %.lr.ph56, %41
  %33 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %34 = add i64 %33, -2
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %34) #7
  %.sroa.031.0.copyload = load double, ptr %35, align 8
  %.sroa.232.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 8
  %.sroa.232.0.copyload = load double, ptr %.sroa.232.0..sroa_idx, align 8
  %36 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %37 = add i64 %36, -1
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %37) #7
  %.sroa.029.0.copyload = load double, ptr %38, align 8
  %.sroa.230.0..sroa_idx = getelementptr inbounds i8, ptr %38, i64 8
  %.sroa.230.0.copyload = load double, ptr %.sroa.230.0..sroa_idx, align 8
  %.sroa.027.0.copyload = load double, ptr %28, align 16
  %.sroa.228.0.copyload = load double, ptr %.sroa.228.0..sroa_idx, align 8
  %39 = call noundef double @_Z3ccwSt4pairIddES0_S0_(double %.sroa.031.0.copyload, double %.sroa.232.0.copyload, double %.sroa.029.0.copyload, double %.sroa.230.0.copyload, double %.sroa.027.0.copyload, double %.sroa.228.0.copyload)
  %40 = fcmp ult double %39, -1.000000e-03
  br i1 %40, label %.critedge, label %41

41:                                               ; preds = %32
  call void @_ZNSt6vectorISt4pairIddESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %42 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %43 = icmp ugt i64 %42, 1
  br i1 %43, label %32, label %.critedge, !llvm.loop !15

.critedge:                                        ; preds = %32, %41, %.preheader54
  %44 = getelementptr inbounds [10000 x %"struct.std::pair"], ptr @pt, i64 0, i64 %indvars.iv74
  invoke void @_ZNSt6vectorISt4pairIddESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(16) %44)
          to label %.preheader53 unwind label %59

.preheader53:                                     ; preds = %.critedge
  %45 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %46 = icmp ugt i64 %45, 1
  br i1 %46, label %.lr.ph58, label %.critedge2

.lr.ph58:                                         ; preds = %.preheader53
  %.sroa.220.0..sroa_idx = getelementptr inbounds i8, ptr %44, i64 8
  br label %47

47:                                               ; preds = %.lr.ph58, %56
  %48 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %49 = add i64 %48, -2
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %49) #7
  %.sroa.023.0.copyload = load double, ptr %50, align 8
  %.sroa.224.0..sroa_idx = getelementptr inbounds i8, ptr %50, i64 8
  %.sroa.224.0.copyload = load double, ptr %.sroa.224.0..sroa_idx, align 8
  %51 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %52 = add i64 %51, -1
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %52) #7
  %.sroa.021.0.copyload = load double, ptr %53, align 8
  %.sroa.222.0..sroa_idx = getelementptr inbounds i8, ptr %53, i64 8
  %.sroa.222.0.copyload = load double, ptr %.sroa.222.0..sroa_idx, align 8
  %.sroa.019.0.copyload = load double, ptr %44, align 16
  %.sroa.220.0.copyload = load double, ptr %.sroa.220.0..sroa_idx, align 8
  %54 = call noundef double @_Z3ccwSt4pairIddES0_S0_(double %.sroa.023.0.copyload, double %.sroa.224.0.copyload, double %.sroa.021.0.copyload, double %.sroa.222.0.copyload, double %.sroa.019.0.copyload, double %.sroa.220.0.copyload)
  %55 = fcmp ugt double %54, 1.000000e-03
  br i1 %55, label %.critedge2, label %56

56:                                               ; preds = %47
  call void @_ZNSt6vectorISt4pairIddESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %57 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %58 = icmp ugt i64 %57, 1
  br i1 %58, label %47, label %.critedge2, !llvm.loop !16

59:                                               ; preds = %.critedge2, %.critedge
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %95

.critedge2:                                       ; preds = %47, %56, %.preheader53
  invoke void @_ZNSt6vectorISt4pairIddESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(16) %44)
          to label %61 unwind label %59

61:                                               ; preds = %.critedge2
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %62 = load i32, ptr @N, align 4, !tbaa !11
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next75, %63
  br i1 %64, label %.preheader54, label %.preheader52, !llvm.loop !17

.preheader:                                       ; preds = %.lr.ph63, %.preheader52
  %.047.lcssa = phi double [ 0.000000e+00, %.preheader52 ], [ %72, %.lr.ph63 ]
  %65 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %66 = trunc i64 %65 to i32
  %67 = icmp sgt i32 %66, 1
  br i1 %67, label %.lr.ph67, label %._crit_edge68

.lr.ph63:                                         ; preds = %.preheader52, %.lr.ph63
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %.lr.ph63 ], [ 1, %.preheader52 ]
  %.04762 = phi double [ %72, %.lr.ph63 ], [ 0.000000e+00, %.preheader52 ]
  %68 = add nsw i64 %indvars.iv77, -1
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %68) #7
  %.sroa.011.0.copyload = load double, ptr %69, align 8
  %.sroa.212.0..sroa_idx = getelementptr inbounds i8, ptr %69, i64 8
  %.sroa.212.0.copyload = load double, ptr %.sroa.212.0..sroa_idx, align 8
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv77) #7
  %.sroa.09.0.copyload = load double, ptr %70, align 8
  %.sroa.210.0..sroa_idx = getelementptr inbounds i8, ptr %70, i64 8
  %.sroa.210.0.copyload = load double, ptr %.sroa.210.0..sroa_idx, align 8
  %71 = call noundef double @_Z4distSt4pairIddES0_(double %.sroa.011.0.copyload, double %.sroa.212.0.copyload, double %.sroa.09.0.copyload, double %.sroa.210.0.copyload)
  %72 = fadd double %.04762, %71
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %73 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %sext = shl i64 %73, 32
  %74 = ashr exact i64 %sext, 32
  %75 = icmp slt i64 %indvars.iv.next78, %74
  br i1 %75, label %.lr.ph63, label %.preheader, !llvm.loop !18

._crit_edge68:                                    ; preds = %.lr.ph67, %.preheader
  %.1.lcssa = phi double [ %.047.lcssa, %.preheader ], [ %81, %.lr.ph67 ]
  %76 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt5fixedRSt8ios_base)
          to label %85 unwind label %93

.lr.ph67:                                         ; preds = %.preheader, %.lr.ph67
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %.lr.ph67 ], [ 1, %.preheader ]
  %.166 = phi double [ %81, %.lr.ph67 ], [ %.047.lcssa, %.preheader ]
  %77 = add nsw i64 %indvars.iv80, -1
  %78 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %77) #7
  %.sroa.04.0.copyload = load double, ptr %78, align 8
  %.sroa.25.0..sroa_idx = getelementptr inbounds i8, ptr %78, i64 8
  %.sroa.25.0.copyload = load double, ptr %.sroa.25.0..sroa_idx, align 8
  %79 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIddESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv80) #7
  %.sroa.03.0.copyload = load double, ptr %79, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %79, i64 8
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8
  %80 = call noundef double @_Z4distSt4pairIddES0_(double %.sroa.04.0.copyload, double %.sroa.25.0.copyload, double %.sroa.03.0.copyload, double %.sroa.2.0.copyload)
  %81 = fadd double %.166, %80
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %82 = call noundef i64 @_ZNKSt6vectorISt4pairIddESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %sext83 = shl i64 %82, 32
  %83 = ashr exact i64 %sext83, 32
  %84 = icmp slt i64 %indvars.iv.next81, %83
  br i1 %84, label %.lr.ph67, label %._crit_edge68, !llvm.loop !19

85:                                               ; preds = %._crit_edge68
  %86 = call i32 @_ZSt12setprecisioni(i32 noundef 2)
  %87 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %76, i32 %86)
          to label %88 unwind label %93

88:                                               ; preds = %85
  %89 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %87, double noundef %.1.lcssa)
          to label %90 unwind label %93

90:                                               ; preds = %88
  %91 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull @.str.4)
          to label %92 unwind label %93

92:                                               ; preds = %90
  call void @_ZNSt6vectorISt4pairIddESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @_ZNSt6vectorISt4pairIddESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  ret i32 0

93:                                               ; preds = %90, %88, %85, %._crit_edge68
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %95

95:                                               ; preds = %93, %59
  %.pn = phi { ptr, i32 } [ %60, %59 ], [ %94, %93 ]
  call void @_ZNSt6vectorISt4pairIddESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @_ZNSt6vectorISt4pairIddESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #0 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt5fixedRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt12setprecisioni(i32 noundef) local_unnamed_addr #6

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

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

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


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