; LLVM IR from tangjz/acm-icpc :: usaco/dec22-gold/B.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.std::pair" = type { i32, %struct.Point }
%struct.Point = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.2" = type { i8 }
%"struct.std::pair.5" = type { i32, i32 }
%class.anon = type { ptr, ptr, ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.7" = type { ptr }

@seg = external dso_local global [4019 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6segIdxii(i32 noundef, i32 noundef) #1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #2 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::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca %"class.std::allocator", align 1
  %12 = alloca %"class.std::vector.0", align 8
  %13 = alloca %"class.std::allocator.2", align 1
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair.5", align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %struct.Point, align 4
  %22 = alloca %struct.Point, align 4
  %23 = alloca %class.anon, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca %struct.Point, align 4
  %29 = alloca i8, align 1
  %30 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %31 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %32 = alloca ptr, align 8
  %33 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %34 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %35 = alloca ptr, align 8
  %36 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #7
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %39, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %40 unwind label %49

40:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #7
  %41 = load i32, ptr %1, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %42, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %43 unwind label %53

43:                                               ; preds = %40
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %63, %43
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = load i32, ptr %1, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %57, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %70

49:                                               ; preds = %0
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %5, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  br label %358

53:                                               ; preds = %40
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %5, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  br label %357

57:                                               ; preds = %44
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %59) #7
  %61 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %60)
          to label %62 unwind label %66

62:                                               ; preds = %57
  br label %63

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

66:                                               ; preds = %57
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %5, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %356

70:                                               ; preds = %48
  %71 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
          to label %72 unwind label %84

72:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #7
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %74, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %75 unwind label %88

75:                                               ; preds = %72
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #7
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #7
  call void @_ZNSaISt4pairIiiEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %77, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %78 unwind label %92

78:                                               ; preds = %75
  call void @_ZNSt15__new_allocatorISt4pairIiiEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %106, %78
  %80 = load i32, ptr %14, align 4, !tbaa !5
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %96, label %83

83:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %118

84:                                               ; preds = %70
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %5, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %6, align 4
  br label %356

88:                                               ; preds = %72
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %5, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #7
  br label %355

92:                                               ; preds = %75
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %5, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %6, align 4
  call void @_ZNSt15__new_allocatorISt4pairIiiEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  br label %354

96:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %97 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %15, ptr noundef %16)
          to label %98 unwind label %109

98:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %99 = load i32, ptr %15, align 4, !tbaa !5
  %100 = add nsw i32 %99, -1
  store i32 %100, ptr %15, align 4, !tbaa !5
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %101 unwind label %113

101:                                              ; preds = %98
  %102 = load i32, ptr %14, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %103) #7
  %105 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %104, ptr noundef nonnull align 4 dereferenceable(8) %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %106

106:                                              ; preds = %101
  %107 = load i32, ptr %14, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %14, align 4, !tbaa !5
  br label %79, !llvm.loop !11

109:                                              ; preds = %96
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %5, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %6, align 4
  br label %117

113:                                              ; preds = %98
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %5, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %117

117:                                              ; preds = %113, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %353

118:                                              ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %327, %118
  %120 = load i32, ptr %18, align 4, !tbaa !5
  %121 = icmp slt i32 %120, 2
  br i1 %121, label %123, label %122

122:                                              ; preds = %119
  store i32 8, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %331

123:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %286, %123
  %125 = load i32, ptr %20, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  %127 = load i32, ptr %1, align 4, !tbaa !5
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %124
  store i32 11, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %291

130:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr %23) #7
  %131 = getelementptr inbounds %class.anon, ptr %23, i32 0, i32 0
  store ptr %20, ptr %131, align 8, !tbaa !12
  %132 = getelementptr inbounds %class.anon, ptr %23, i32 0, i32 1
  store ptr %1, ptr %132, align 8, !tbaa !12
  %133 = getelementptr inbounds %class.anon, ptr %23, i32 0, i32 2
  store ptr %21, ptr %133, align 8, !tbaa !12
  %134 = getelementptr inbounds %class.anon, ptr %23, i32 0, i32 3
  store ptr %22, ptr %134, align 8, !tbaa !12
  %135 = getelementptr inbounds %class.anon, ptr %23, i32 0, i32 4
  store ptr %7, ptr %135, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %136 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %136, ptr %24, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %150, %130
  %138 = load i32, ptr %24, align 4, !tbaa !5
  %139 = load i32, ptr %1, align 4, !tbaa !5
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  store i32 14, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %153

142:                                              ; preds = %137
  %143 = load i32, ptr %24, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %144) #7
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = load i32, ptr %24, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %148) #7
  store i32 %146, ptr %149, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %142
  %151 = load i32, ptr %24, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %24, align 4, !tbaa !5
  br label %137, !llvm.loop !14

153:                                              ; preds = %141
  invoke void @"_ZZ5solvevENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(40) %23)
          to label %154 unwind label %166

154:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %155 = load i32, ptr %20, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  %157 = load i32, ptr %1, align 4, !tbaa !5
  %158 = sub nsw i32 %157, 1
  %159 = invoke noundef i32 @_Z6segIdxii(i32 noundef %156, i32 noundef %158)
          to label %160 unwind label %170

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

161:                                              ; preds = %281, %160
  %162 = load i32, ptr %26, align 4, !tbaa !5
  %163 = load i32, ptr %2, align 4, !tbaa !5
  %164 = icmp slt i32 %162, %163
  br i1 %164, label %174, label %165

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

166:                                              ; preds = %153
  %167 = landingpad { ptr, i32 }
          cleanup
  %168 = extractvalue { ptr, i32 } %167, 0
  store ptr %168, ptr %5, align 8
  %169 = extractvalue { ptr, i32 } %167, 1
  store i32 %169, ptr %6, align 4
  br label %290

170:                                              ; preds = %154
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %5, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %6, align 4
  br label %289

174:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %175 = load i32, ptr %26, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %176) #7
  store ptr %177, ptr %27, align 8, !tbaa !12
  %178 = load ptr, ptr %27, align 8, !tbaa !12
  %179 = getelementptr inbounds %"struct.std::pair.5", ptr %178, i32 0, i32 0
  %180 = load i32, ptr %179, align 4, !tbaa !15
  %181 = load i32, ptr %20, align 4, !tbaa !5
  %182 = icmp sge i32 %180, %181
  br i1 %182, label %183, label %270

183:                                              ; preds = %174
  %184 = load ptr, ptr %27, align 8, !tbaa !12
  %185 = getelementptr inbounds %"struct.std::pair.5", ptr %184, i32 0, i32 1
  %186 = load i32, ptr %185, align 4, !tbaa !17
  %187 = load ptr, ptr %27, align 8, !tbaa !12
  %188 = getelementptr inbounds %"struct.std::pair.5", ptr %187, i32 0, i32 0
  %189 = load i32, ptr %188, align 4, !tbaa !15
  %190 = sext i32 %189 to i64
  %191 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %190) #7
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = add nsw i32 %192, %186
  store i32 %193, ptr %191, align 4, !tbaa !5
  %194 = load ptr, ptr %27, align 8, !tbaa !12
  %195 = getelementptr inbounds %"struct.std::pair.5", ptr %194, i32 0, i32 0
  %196 = load i32, ptr %195, align 4, !tbaa !15
  %197 = load i32, ptr %20, align 4, !tbaa !5
  %198 = icmp eq i32 %196, %197
  br i1 %198, label %199, label %205

199:                                              ; preds = %183
  invoke void @"_ZZ5solvevENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(40) %23)
          to label %200 unwind label %201

200:                                              ; preds = %199
  br label %269

201:                                              ; preds = %258, %214, %205, %199
  %202 = landingpad { ptr, i32 }
          cleanup
  %203 = extractvalue { ptr, i32 } %202, 0
  store ptr %203, ptr %5, align 8
  %204 = extractvalue { ptr, i32 } %202, 1
  store i32 %204, ptr %6, align 4
  br label %284

205:                                              ; preds = %183
  %206 = load i32, ptr %20, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  %208 = load i32, ptr %1, align 4, !tbaa !5
  %209 = sub nsw i32 %208, 1
  %210 = load ptr, ptr %27, align 8, !tbaa !12
  %211 = getelementptr inbounds %"struct.std::pair.5", ptr %210, i32 0, i32 0
  %212 = load i32, ptr %211, align 4, !tbaa !15
  %213 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_Z6segAskiii(i32 noundef %207, i32 noundef %209, i32 noundef %212)
          to label %214 unwind label %201

214:                                              ; preds = %205
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %213, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %215 = getelementptr inbounds %struct.Point, ptr %28, i32 0, i32 0
  %216 = load ptr, ptr %27, align 8, !tbaa !12
  %217 = getelementptr inbounds %"struct.std::pair.5", ptr %216, i32 0, i32 0
  %218 = load i32, ptr %217, align 4, !tbaa !15
  %219 = load i32, ptr %20, align 4, !tbaa !5
  %220 = sub nsw i32 %218, %219
  store i32 %220, ptr %215, align 4, !tbaa !19
  %221 = getelementptr inbounds %struct.Point, ptr %28, i32 0, i32 1
  %222 = load ptr, ptr %27, align 8, !tbaa !12
  %223 = getelementptr inbounds %"struct.std::pair.5", ptr %222, i32 0, i32 0
  %224 = load i32, ptr %223, align 4, !tbaa !15
  %225 = sext i32 %224 to i64
  %226 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %225) #7
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = load i32, ptr %20, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %229) #7
  %231 = load i32, ptr %230, align 4, !tbaa !5
  %232 = sub nsw i32 %227, %231
  store i32 %232, ptr %221, align 4, !tbaa !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %28, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  %233 = invoke noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %234 unwind label %201

234:                                              ; preds = %214
  %235 = icmp sge i64 %233, 0
  br i1 %235, label %236, label %268

236:                                              ; preds = %234
  %237 = load ptr, ptr %27, align 8, !tbaa !12
  %238 = getelementptr inbounds %"struct.std::pair.5", ptr %237, i32 0, i32 0
  %239 = load i32, ptr %238, align 4, !tbaa !15
  %240 = add nsw i32 %239, 1
  %241 = load i32, ptr %1, align 4, !tbaa !5
  %242 = icmp slt i32 %240, %241
  br i1 %242, label %243, label %258

243:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #7
  store i8 0, ptr %29, align 1, !tbaa !22
  %244 = load i32, ptr %20, align 4, !tbaa !5
  %245 = add nsw i32 %244, 1
  %246 = load i32, ptr %1, align 4, !tbaa !5
  %247 = sub nsw i32 %246, 1
  %248 = load ptr, ptr %27, align 8, !tbaa !12
  %249 = getelementptr inbounds %"struct.std::pair.5", ptr %248, i32 0, i32 0
  %250 = load i32, ptr %249, align 4, !tbaa !15
  %251 = add nsw i32 %250, 1
  %252 = invoke noundef i32 @_Z6segDeliiiRK5PointRb(i32 noundef %245, i32 noundef %247, i32 noundef %251, ptr noundef nonnull align 4 dereferenceable(8) %22, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %253 unwind label %254

253:                                              ; preds = %243
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #7
  br label %258

254:                                              ; preds = %243
  %255 = landingpad { ptr, i32 }
          cleanup
  %256 = extractvalue { ptr, i32 } %255, 0
  store ptr %256, ptr %5, align 8
  %257 = extractvalue { ptr, i32 } %255, 1
  store i32 %257, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #7
  br label %284

258:                                              ; preds = %253, %236
  %259 = load i32, ptr %20, align 4, !tbaa !5
  %260 = add nsw i32 %259, 1
  %261 = load i32, ptr %1, align 4, !tbaa !5
  %262 = sub nsw i32 %261, 1
  %263 = load ptr, ptr %27, align 8, !tbaa !12
  %264 = getelementptr inbounds %"struct.std::pair.5", ptr %263, i32 0, i32 0
  %265 = load i32, ptr %264, align 4, !tbaa !15
  %266 = invoke noundef i32 @_Z6segAddiiiRK5Point(i32 noundef %260, i32 noundef %262, i32 noundef %265, ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %267 unwind label %201

267:                                              ; preds = %258
  br label %268

268:                                              ; preds = %267, %234
  br label %269

269:                                              ; preds = %268, %200
  br label %270

270:                                              ; preds = %269, %174
  %271 = load i32, ptr %25, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [4019 x %"struct.std::pair"], ptr @seg, i64 0, i64 %272
  %274 = getelementptr inbounds %"struct.std::pair", ptr %273, i32 0, i32 0
  %275 = load i32, ptr %274, align 4, !tbaa !24
  %276 = load i32, ptr %26, align 4, !tbaa !5
  %277 = sext i32 %276 to i64
  %278 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %277) #7
  %279 = load i32, ptr %278, align 4, !tbaa !5
  %280 = add nsw i32 %279, %275
  store i32 %280, ptr %278, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %281

281:                                              ; preds = %270
  %282 = load i32, ptr %26, align 4, !tbaa !5
  %283 = add nsw i32 %282, 1
  store i32 %283, ptr %26, align 4, !tbaa !5
  br label %161, !llvm.loop !26

284:                                              ; preds = %254, %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %289

285:                                              ; preds = %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %286

286:                                              ; preds = %285
  %287 = load i32, ptr %20, align 4, !tbaa !5
  %288 = add nsw i32 %287, 1
  store i32 %288, ptr %20, align 4, !tbaa !5
  br label %124, !llvm.loop !27

289:                                              ; preds = %284, %170
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %290

290:                                              ; preds = %289, %166
  call void @llvm.lifetime.end.p0(i64 40, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %330

291:                                              ; preds = %129
  %292 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  %293 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  store ptr %292, ptr %293, align 8
  %294 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  %295 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %31, i32 0, i32 0
  store ptr %294, ptr %295, align 8
  %296 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  %297 = load ptr, ptr %296, align 8
  %298 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %31, i32 0, i32 0
  %299 = load ptr, ptr %298, align 8
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %297, ptr %299)
          to label %300 unwind label %310

300:                                              ; preds = %291
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  store ptr %12, ptr %32, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %301 = load ptr, ptr %32, align 8, !tbaa !12
  %302 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %301) #7
  %303 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %33, i32 0, i32 0
  store ptr %302, ptr %303, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  %304 = load ptr, ptr %32, align 8, !tbaa !12
  %305 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %304) #7
  %306 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %34, i32 0, i32 0
  store ptr %305, ptr %306, align 8
  br label %307

307:                                              ; preds = %324, %300
  %308 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull align 8 dereferenceable(8) %34) #7
  br i1 %308, label %314, label %309

309:                                              ; preds = %307
  store i32 20, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br label %326

310:                                              ; preds = %291
  %311 = landingpad { ptr, i32 }
          cleanup
  %312 = extractvalue { ptr, i32 } %311, 0
  store ptr %312, ptr %5, align 8
  %313 = extractvalue { ptr, i32 } %311, 1
  store i32 %313, ptr %6, align 4
  br label %330

314:                                              ; preds = %307
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #7
  %315 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #7
  store ptr %315, ptr %35, align 8, !tbaa !12
  %316 = load i32, ptr %1, align 4, !tbaa !5
  %317 = sub nsw i32 %316, 1
  %318 = load ptr, ptr %35, align 8, !tbaa !12
  %319 = getelementptr inbounds %"struct.std::pair.5", ptr %318, i32 0, i32 0
  %320 = load i32, ptr %319, align 4, !tbaa !15
  %321 = sub nsw i32 %317, %320
  %322 = load ptr, ptr %35, align 8, !tbaa !12
  %323 = getelementptr inbounds %"struct.std::pair.5", ptr %322, i32 0, i32 0
  store i32 %321, ptr %323, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  br label %324

324:                                              ; preds = %314
  %325 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #7
  br label %307

326:                                              ; preds = %309
  br label %327

327:                                              ; preds = %326
  %328 = load i32, ptr %18, align 4, !tbaa !5
  %329 = add nsw i32 %328, 1
  store i32 %329, ptr %18, align 4, !tbaa !5
  br label %119, !llvm.loop !28

330:                                              ; preds = %310, %290
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %353

331:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  store i32 0, ptr %36, align 4, !tbaa !5
  br label %332

332:                                              ; preds = %345, %331
  %333 = load i32, ptr %36, align 4, !tbaa !5
  %334 = load i32, ptr %2, align 4, !tbaa !5
  %335 = icmp slt i32 %333, %334
  br i1 %335, label %337, label %336

336:                                              ; preds = %332
  store i32 22, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  br label %352

337:                                              ; preds = %332
  %338 = load i32, ptr %36, align 4, !tbaa !5
  %339 = sext i32 %338 to i64
  %340 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %339) #7
  %341 = load i32, ptr %340, align 4, !tbaa !5
  %342 = ashr i32 %341, 1
  %343 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %342)
          to label %344 unwind label %348

344:                                              ; preds = %337
  br label %345

345:                                              ; preds = %344
  %346 = load i32, ptr %36, align 4, !tbaa !5
  %347 = add nsw i32 %346, 1
  store i32 %347, ptr %36, align 4, !tbaa !5
  br label %332, !llvm.loop !29

348:                                              ; preds = %337
  %349 = landingpad { ptr, i32 }
          cleanup
  %350 = extractvalue { ptr, i32 } %349, 0
  store ptr %350, ptr %5, align 8
  %351 = extractvalue { ptr, i32 } %349, 1
  store i32 %351, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  br label %353

352:                                              ; preds = %336
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #7
  ret void

353:                                              ; preds = %348, %330, %117
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  br label %354

354:                                              ; preds = %353, %92
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  br label %355

355:                                              ; preds = %354, %88
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #7
  br label %356

356:                                              ; preds = %355, %84, %66
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  br label %357

357:                                              ; preds = %356, %53
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  br label %358

358:                                              ; preds = %357, %49
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #7
  br label %359

359:                                              ; preds = %358
  %360 = load ptr, ptr %5, align 8
  %361 = load i32, ptr %6, align 4
  %362 = insertvalue { ptr, i32 } poison, ptr %360, 0
  %363 = insertvalue { ptr, i32 } %362, i32 %361, 1
  resume { ptr, i32 } %363
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt4pairIiiEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(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 @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #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 uwtable
declare hidden void @"_ZZ5solvevENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(40)) #5 align 2

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt4pairIiiEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

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

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


; 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 { i32, %struct.Point }
%struct.Point = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.2" = type { i8 }
%"struct.std::pair.5" = type { i32, i32 }
%class.anon = type { ptr, ptr, ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.7" = type { ptr }

@seg = external dso_local local_unnamed_addr global [4019 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6segIdxii(i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #2 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::allocator", align 1
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca %"class.std::vector.0", align 8
  %10 = alloca %"class.std::allocator.2", align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair.5", align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.Point, align 8
  %16 = alloca %struct.Point, align 4
  %17 = alloca %class.anon, align 8
  %18 = alloca i8, align 1
  %19 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %23, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %24 unwind label %33

24:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %26, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %27 unwind label %35

27:                                               ; preds = %24
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  %28 = load i32, ptr %1, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %27
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #6
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %32, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %42 unwind label %52

33:                                               ; preds = %0
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  br label %188

35:                                               ; preds = %24
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  br label %187

.lr.ph:                                           ; preds = %27, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %27 ]
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv) #6
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %37)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = load i32, ptr %1, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next, %40
  br i1 %41, label %.lr.ph, label %._crit_edge, !llvm.loop !9

42:                                               ; preds = %._crit_edge
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #6
  call void @_ZNSaISt4pairIiiEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %44, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %45 unwind label %54

45:                                               ; preds = %42
  call void @_ZNSt15__new_allocatorISt4pairIiiEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph64, label %.preheader60

.preheader60:                                     ; preds = %.lr.ph64, %45
  %48 = getelementptr inbounds i8, ptr %17, i64 8
  %49 = getelementptr inbounds i8, ptr %17, i64 16
  %50 = getelementptr inbounds i8, ptr %17, i64 24
  %51 = getelementptr inbounds i8, ptr %17, i64 32
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %16, i64 4
  br label %66

52:                                               ; preds = %._crit_edge
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  br label %186

54:                                               ; preds = %42
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt4pairIiiEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  br label %185

.lr.ph64:                                         ; preds = %45, %.lr.ph64
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph64 ], [ 0, %45 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %56 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %11, ptr noundef nonnull %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %57 = load i32, ptr %11, align 4, !tbaa !5
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr %11, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %59 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %indvars.iv85) #6
  %60 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %59, ptr noundef nonnull align 4 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next86, %62
  br i1 %63, label %.lr.ph64, label %.preheader60, !llvm.loop !11

.preheader:                                       ; preds = %._crit_edge79
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %.lr.ph82, label %._crit_edge83

66:                                               ; preds = %.preheader60, %._crit_edge79
  %67 = phi i1 [ true, %.preheader60 ], [ false, %._crit_edge79 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %69 = icmp sgt i32 %68, 1
  br i1 %69, label %.lr.ph75, label %._crit_edge76

._crit_edge76:                                    ; preds = %._crit_edge72, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  %70 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %71 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %70, ptr %71)
          to label %164 unwind label %168

.lr.ph75:                                         ; preds = %66, %._crit_edge72
  %72 = phi i32 [ %94, %._crit_edge72 ], [ %68, %66 ]
  %storemerge73 = phi i32 [ %92, %._crit_edge72 ], [ 0, %66 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %17) #6
  store ptr %14, ptr %17, align 8, !tbaa !12
  store ptr %1, ptr %48, align 8, !tbaa !12
  store ptr %15, ptr %49, align 8, !tbaa !12
  store ptr %16, ptr %50, align 8, !tbaa !12
  store ptr %5, ptr %51, align 8, !tbaa !12
  %73 = icmp slt i32 %storemerge73, %72
  br i1 %73, label %.lr.ph67.preheader, label %._crit_edge68

.lr.ph67.preheader:                               ; preds = %.lr.ph75
  %74 = sext i32 %storemerge73 to i64
  br label %.lr.ph67

._crit_edge68:                                    ; preds = %.lr.ph67, %.lr.ph75
  invoke void @"_ZZ5solvevENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(40) %17)
          to label %81 unwind label %96

.lr.ph67:                                         ; preds = %.lr.ph67.preheader, %.lr.ph67
  %indvars.iv88 = phi i64 [ %74, %.lr.ph67.preheader ], [ %indvars.iv.next89, %.lr.ph67 ]
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv88) #6
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv88) #6
  store i32 %76, ptr %77, align 4, !tbaa !5
  %indvars.iv.next89 = add nsw i64 %indvars.iv88, 1
  %78 = load i32, ptr %1, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = icmp slt i64 %indvars.iv.next89, %79
  br i1 %80, label %.lr.ph67, label %._crit_edge68, !llvm.loop !14

81:                                               ; preds = %._crit_edge68
  %82 = load i32, ptr %14, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  %84 = load i32, ptr %1, align 4, !tbaa !5
  %85 = add nsw i32 %84, -1
  %86 = call noundef i32 @_Z6segIdxii(i32 noundef %83, i32 noundef %85)
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %88 = icmp sgt i32 %87, 0
  br i1 %88, label %.lr.ph71, label %._crit_edge72

.lr.ph71:                                         ; preds = %81
  %89 = sext i32 %86 to i64
  %90 = getelementptr inbounds [4019 x %"struct.std::pair"], ptr @seg, i64 0, i64 %89
  br label %98

._crit_edge72:                                    ; preds = %155, %81
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  %91 = load i32, ptr %14, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %14, align 4, !tbaa !5
  %93 = add nsw i32 %91, 2
  %94 = load i32, ptr %1, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %.lr.ph75, label %._crit_edge76, !llvm.loop !15

96:                                               ; preds = %._crit_edge68
  %97 = landingpad { ptr, i32 }
          cleanup
  br label %163

98:                                               ; preds = %.lr.ph71, %155
  %indvars.iv91 = phi i64 [ 0, %.lr.ph71 ], [ %indvars.iv.next92, %155 ]
  %99 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %indvars.iv91) #6
  %100 = load i32, ptr %99, align 4, !tbaa !16
  %101 = load i32, ptr %14, align 4, !tbaa !5
  %.not = icmp slt i32 %100, %101
  br i1 %.not, label %155, label %102

102:                                              ; preds = %98
  %103 = getelementptr inbounds i8, ptr %99, i64 4
  %104 = load i32, ptr %103, align 4, !tbaa !18
  %105 = sext i32 %100 to i64
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %105) #6
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = add nsw i32 %107, %104
  store i32 %108, ptr %106, align 4, !tbaa !5
  %109 = load i32, ptr %99, align 4, !tbaa !16
  %110 = load i32, ptr %14, align 4, !tbaa !5
  %111 = icmp eq i32 %109, %110
  br i1 %111, label %112, label %115

112:                                              ; preds = %102
  invoke void @"_ZZ5solvevENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(40) %17)
          to label %155 unwind label %113

113:                                              ; preds = %148, %115, %112
  %114 = landingpad { ptr, i32 }
          cleanup
  br label %163

115:                                              ; preds = %102
  %116 = add nsw i32 %110, 1
  %117 = load i32, ptr %1, align 4, !tbaa !5
  %118 = add nsw i32 %117, -1
  %119 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_Z6segAskiii(i32 noundef %116, i32 noundef %118, i32 noundef %109)
          to label %120 unwind label %113

120:                                              ; preds = %115
  %121 = load i64, ptr %119, align 4
  store i64 %121, ptr %15, align 8
  %122 = load i32, ptr %99, align 4, !tbaa !16
  %123 = load i32, ptr %14, align 4, !tbaa !5
  %124 = sub nsw i32 %122, %123
  %125 = sext i32 %122 to i64
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %125) #6
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = load i32, ptr %14, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %129) #6
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = sub nsw i32 %127, %131
  store i32 %124, ptr %16, align 4, !tbaa !5
  store i32 %132, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %133 = call noundef i64 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %16)
  %134 = icmp sgt i64 %133, -1
  br i1 %134, label %135, label %155

135:                                              ; preds = %120
  %136 = load i32, ptr %99, align 4, !tbaa !16
  %137 = add nsw i32 %136, 1
  %138 = load i32, ptr %1, align 4, !tbaa !5
  %139 = icmp slt i32 %137, %138
  br i1 %139, label %140, label %148

140:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %18) #6
  store i8 0, ptr %18, align 1, !tbaa !19
  %141 = load i32, ptr %14, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  %143 = add nsw i32 %138, -1
  %144 = invoke noundef i32 @_Z6segDeliiiRK5PointRb(i32 noundef %142, i32 noundef %143, i32 noundef %137, ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %145 unwind label %146

145:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %18) #6
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %.pre97 = load i32, ptr %99, align 4, !tbaa !16
  br label %148

146:                                              ; preds = %140
  %147 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %18) #6
  br label %163

148:                                              ; preds = %145, %135
  %149 = phi i32 [ %.pre97, %145 ], [ %136, %135 ]
  %150 = phi i32 [ %.pre, %145 ], [ %138, %135 ]
  %151 = load i32, ptr %14, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  %153 = add nsw i32 %150, -1
  %154 = invoke noundef i32 @_Z6segAddiiiRK5Point(i32 noundef %152, i32 noundef %153, i32 noundef %149, ptr noundef nonnull align 4 dereferenceable(8) %16)
          to label %155 unwind label %113

155:                                              ; preds = %112, %148, %120, %98
  %156 = load i32, ptr %90, align 4, !tbaa !21
  %157 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv91) #6
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = add nsw i32 %158, %156
  store i32 %159, ptr %157, align 4, !tbaa !5
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %160 = load i32, ptr %2, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = icmp slt i64 %indvars.iv.next92, %161
  br i1 %162, label %98, label %._crit_edge72, !llvm.loop !24

163:                                              ; preds = %113, %146, %96
  %.pn.pn = phi { ptr, i32 } [ %97, %96 ], [ %114, %113 ], [ %147, %146 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  br label %177

164:                                              ; preds = %._crit_edge76
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #6
  %165 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  store ptr %165, ptr %19, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #6
  %166 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  store ptr %166, ptr %20, align 8
  %167 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  br i1 %167, label %.lr.ph78, label %._crit_edge79

._crit_edge79:                                    ; preds = %.lr.ph78, %164
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #6
  br i1 %67, label %66, label %.preheader, !llvm.loop !25

168:                                              ; preds = %._crit_edge76
  %169 = landingpad { ptr, i32 }
          cleanup
  br label %177

.lr.ph78:                                         ; preds = %164, %.lr.ph78
  %170 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  %171 = load i32, ptr %1, align 4, !tbaa !5
  %172 = load i32, ptr %170, align 4, !tbaa !16
  %173 = xor i32 %172, -1
  %174 = add i32 %171, %173
  store i32 %174, ptr %170, align 4, !tbaa !16
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  %176 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  br i1 %176, label %.lr.ph78, label %._crit_edge79

177:                                              ; preds = %168, %163
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %163 ], [ %169, %168 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  br label %185

._crit_edge83:                                    ; preds = %.lr.ph82, %.preheader
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret void

.lr.ph82:                                         ; preds = %.preheader, %.lr.ph82
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %.lr.ph82 ], [ 0, %.preheader ]
  %178 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv94) #6
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = ashr i32 %179, 1
  %181 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %180)
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %182 = load i32, ptr %2, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = icmp slt i64 %indvars.iv.next95, %183
  br i1 %184, label %.lr.ph82, label %._crit_edge83, !llvm.loop !26

185:                                              ; preds = %177, %54
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %177 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  br label %186

186:                                              ; preds = %185, %52
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %185 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %187

187:                                              ; preds = %186, %35
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn, %186 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %188

188:                                              ; preds = %187, %33
  %.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn, %187 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn.pn
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt4pairIiiEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(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 @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_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 uwtable
declare hidden void @"_ZZ5solvevENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #5 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt4pairIiiEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { nounwind }

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

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


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass