; LLVM IR from Izaron/ACM-ICPC :: Russian Olympiad in Informatics/Final Stage 2017 (tigers)

; 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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::allocator" = type { i8 }
%"struct.std::pair" = type { i64, i64 }

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

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

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

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

; 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) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11convex_hullSt6vectorISt4pairIxxESaIS1_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef %1) #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca i32, align 4
  %8 = alloca i1, align 1
  %9 = alloca %"class.std::allocator", align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca %"struct.std::pair", align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %23 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %24 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %23, ptr %24, align 8
  %25 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %25, ptr %26, align 8
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8
  %29 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %28, ptr %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %31 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %32 = trunc i64 %31 to i32
  store i32 %32, ptr %7, align 4, !tbaa !9
  store i1 false, ptr %8, align 1
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = mul nsw i32 2, %33
  %35 = sext i32 %34 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  call void @_ZNSaISt4pairIxxEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %35, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %36 unwind label %42

36:                                               ; preds = %2
  call void @_ZNSt15__new_allocatorISt4pairIxxEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %92, %36
  %38 = load i32, ptr %13, align 4, !tbaa !9
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %46, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %97

42:                                               ; preds = %2
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %10, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %11, align 4
  call void @_ZNSt15__new_allocatorISt4pairIxxEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %191

46:                                               ; preds = %37
  br label %47

47:                                               ; preds = %78, %46
  %48 = load i32, ptr %12, align 4, !tbaa !9
  %49 = icmp sgt i32 %48, 1
  br i1 %49, label %50, label %76

50:                                               ; preds = %47
  %51 = load i32, ptr %12, align 4, !tbaa !9
  %52 = sub nsw i32 %51, 2
  %53 = sext i32 %52 to i64
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %53) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %54, i64 16, i1 false)
  %55 = load i32, ptr %12, align 4, !tbaa !9
  %56 = sub nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %57) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %58, i64 16, i1 false)
  %59 = load i32, ptr %13, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %60) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %61, i64 16, i1 false)
  %62 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %63 = load i64, ptr %62, align 8
  %64 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %65 = load i64, ptr %64, align 8
  %66 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 0
  %67 = load i64, ptr %66, align 8
  %68 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 1
  %69 = load i64, ptr %68, align 8
  %70 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 0
  %71 = load i64, ptr %70, align 8
  %72 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 1
  %73 = load i64, ptr %72, align 8
  %74 = call noundef i64 @_Z5squarSt4pairIxxES0_S0_(i64 %63, i64 %65, i64 %67, i64 %69, i64 %71, i64 %73)
  %75 = icmp sge i64 %74, 0
  br label %76

76:                                               ; preds = %50, %47
  %77 = phi i1 [ false, %47 ], [ %75, %50 ]
  br i1 %77, label %78, label %81

78:                                               ; preds = %76
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = add nsw i32 %79, -1
  store i32 %80, ptr %12, align 4, !tbaa !9
  br label %47, !llvm.loop !11

81:                                               ; preds = %76
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %13, align 4, !tbaa !9
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %13, align 4, !tbaa !9
  %85 = sext i32 %83 to i64
  %86 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %85) #5
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %12, align 4, !tbaa !9
  %89 = sext i32 %87 to i64
  %90 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %89) #5
  %91 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %90, ptr noundef nonnull align 8 dereferenceable(16) %86)
          to label %92 unwind label %93

92:                                               ; preds = %82
  br label %37, !llvm.loop !13

93:                                               ; preds = %82
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %10, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %188

97:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %98 = load i32, ptr %7, align 4, !tbaa !9
  %99 = sub nsw i32 %98, 2
  store i32 %99, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %100 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %100, ptr %18, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %152, %97
  %102 = load i32, ptr %17, align 4, !tbaa !9
  %103 = icmp sge i32 %102, 0
  br i1 %103, label %105, label %104

104:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %157

105:                                              ; preds = %101
  br label %106

106:                                              ; preds = %138, %105
  %107 = load i32, ptr %12, align 4, !tbaa !9
  %108 = load i32, ptr %18, align 4, !tbaa !9
  %109 = icmp sgt i32 %107, %108
  br i1 %109, label %110, label %136

110:                                              ; preds = %106
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = sub nsw i32 %111, 2
  %113 = sext i32 %112 to i64
  %114 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %113) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %114, i64 16, i1 false)
  %115 = load i32, ptr %12, align 4, !tbaa !9
  %116 = sub nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %117) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %118, i64 16, i1 false)
  %119 = load i32, ptr %17, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %120) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %121, i64 16, i1 false)
  %122 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %123 = load i64, ptr %122, align 8
  %124 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %125 = load i64, ptr %124, align 8
  %126 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 0
  %127 = load i64, ptr %126, align 8
  %128 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 1
  %129 = load i64, ptr %128, align 8
  %130 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 0
  %131 = load i64, ptr %130, align 8
  %132 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 1
  %133 = load i64, ptr %132, align 8
  %134 = call noundef i64 @_Z5squarSt4pairIxxES0_S0_(i64 %123, i64 %125, i64 %127, i64 %129, i64 %131, i64 %133)
  %135 = icmp sge i64 %134, 0
  br label %136

136:                                              ; preds = %110, %106
  %137 = phi i1 [ false, %106 ], [ %135, %110 ]
  br i1 %137, label %138, label %141

138:                                              ; preds = %136
  %139 = load i32, ptr %12, align 4, !tbaa !9
  %140 = add nsw i32 %139, -1
  store i32 %140, ptr %12, align 4, !tbaa !9
  br label %106, !llvm.loop !14

141:                                              ; preds = %136
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %17, align 4, !tbaa !9
  %144 = add nsw i32 %143, -1
  store i32 %144, ptr %17, align 4, !tbaa !9
  %145 = sext i32 %143 to i64
  %146 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %145) #5
  %147 = load i32, ptr %12, align 4, !tbaa !9
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %12, align 4, !tbaa !9
  %149 = sext i32 %147 to i64
  %150 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %149) #5
  %151 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %150, ptr noundef nonnull align 8 dereferenceable(16) %146)
          to label %152 unwind label %153

152:                                              ; preds = %142
  br label %101, !llvm.loop !15

153:                                              ; preds = %142
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %10, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %188

157:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %158 = load i32, ptr %12, align 4, !tbaa !9
  %159 = sub nsw i32 %158, 1
  %160 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 0) #5
  %161 = getelementptr inbounds %"struct.std::pair", ptr %160, i32 0, i32 0
  %162 = load i64, ptr %161, align 8, !tbaa !16
  %163 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 1) #5
  %164 = getelementptr inbounds %"struct.std::pair", ptr %163, i32 0, i32 0
  %165 = load i64, ptr %164, align 8, !tbaa !16
  %166 = icmp eq i64 %162, %165
  br i1 %166, label %167, label %175

167:                                              ; preds = %157
  %168 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 0) #5
  %169 = getelementptr inbounds %"struct.std::pair", ptr %168, i32 0, i32 1
  %170 = load i64, ptr %169, align 8, !tbaa !19
  %171 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 1) #5
  %172 = getelementptr inbounds %"struct.std::pair", ptr %171, i32 0, i32 1
  %173 = load i64, ptr %172, align 8, !tbaa !19
  %174 = icmp eq i64 %170, %173
  br label %175

175:                                              ; preds = %167, %157
  %176 = phi i1 [ false, %157 ], [ %174, %167 ]
  %177 = zext i1 %176 to i64
  %178 = select i1 %176, i32 1, i32 0
  %179 = sub nsw i32 %159, %178
  store i32 %179, ptr %22, align 4, !tbaa !9
  br label %180

180:                                              ; preds = %185, %175
  %181 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %182 = load i32, ptr %22, align 4, !tbaa !9
  %183 = sext i32 %182 to i64
  %184 = icmp ugt i64 %181, %183
  br i1 %184, label %185, label %186

185:                                              ; preds = %180
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %180, !llvm.loop !20

186:                                              ; preds = %180
  store i1 true, ptr %8, align 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %187 = load i1, ptr %8, align 1
  br i1 %187, label %190, label %189

188:                                              ; preds = %153, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %191

189:                                              ; preds = %186
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %190

190:                                              ; preds = %189, %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret void

191:                                              ; preds = %188, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %192

192:                                              ; preds = %191
  %193 = load ptr, ptr %10, align 8
  %194 = load i32, ptr %11, align 4
  %195 = insertvalue { ptr, i32 } poison, ptr %193, 0
  %196 = insertvalue { ptr, i32 } %195, i32 %194, 1
  resume { ptr, i32 } %196
}

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt4pairIxxEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!17, !18, i64 0}
!17 = !{!"_ZTSSt4pairIxxE", !18, i64 0, !18, i64 8}
!18 = !{!"long long", !7, i64 0}
!19 = !{!17, !18, i64 8}
!20 = distinct !{!20, !12}


; 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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11convex_hullSt6vectorISt4pairIxxESaIS1_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::allocator", align 1
  %4 = tail call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %5 = tail call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  tail call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %4, ptr %5)
  %6 = tail call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %7 = trunc i64 %6 to i32
  %8 = shl nsw i32 %7, 1
  %9 = sext i32 %8 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  call void @_ZNSaISt4pairIxxEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %9, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %10 unwind label %16

10:                                               ; preds = %2
  call void @_ZNSt15__new_allocatorISt4pairIxxEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  %11 = icmp sgt i32 %7, 0
  br i1 %11, label %.preheader43.preheader, label %._crit_edge48

.preheader43.preheader:                           ; preds = %10
  %wide.trip.count = and i64 %6, 2147483647
  br label %.preheader43

.preheader43:                                     ; preds = %.preheader43.preheader, %.critedge
  %indvars.iv54 = phi i64 [ 0, %.preheader43.preheader ], [ %indvars.iv.next55, %.critedge ]
  %.045 = phi i32 [ 0, %.preheader43.preheader ], [ %30, %.critedge ]
  %12 = zext i32 %.045 to i64
  %smin = call i32 @llvm.smin.i32(i32 %.045, i32 1)
  br label %18

._crit_edge:                                      ; preds = %.critedge
  %.not = icmp eq i32 %7, 1
  br i1 %.not, label %._crit_edge48, label %.preheader.preheader

.preheader.preheader:                             ; preds = %._crit_edge
  %13 = add i64 %6, 4294967294
  %14 = sext i32 %30 to i64
  %15 = and i64 %13, 4294967295
  br label %.preheader

16:                                               ; preds = %2
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt4pairIxxEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  resume { ptr, i32 } %17

18:                                               ; preds = %.preheader43, %21
  %indvars.iv = phi i64 [ %12, %.preheader43 ], [ %24, %21 ]
  %19 = trunc nuw i64 %indvars.iv to i32
  %20 = icmp sgt i32 %19, 1
  br i1 %20, label %21, label %.critedge

21:                                               ; preds = %18
  %22 = add nsw i64 %indvars.iv, -2
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %22) #5
  %.sroa.015.0.copyload = load i64, ptr %23, align 8
  %.sroa.216.0..sroa_idx = getelementptr inbounds i8, ptr %23, i64 8
  %.sroa.216.0.copyload = load i64, ptr %.sroa.216.0..sroa_idx, align 8
  %24 = add nsw i64 %indvars.iv, -1
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %24) #5
  %.sroa.013.0.copyload = load i64, ptr %25, align 8
  %.sroa.214.0..sroa_idx = getelementptr inbounds i8, ptr %25, i64 8
  %.sroa.214.0.copyload = load i64, ptr %.sroa.214.0..sroa_idx, align 8
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv54) #5
  %.sroa.011.0.copyload = load i64, ptr %26, align 8
  %.sroa.212.0..sroa_idx = getelementptr inbounds i8, ptr %26, i64 8
  %.sroa.212.0.copyload = load i64, ptr %.sroa.212.0..sroa_idx, align 8
  %27 = call noundef i64 @_Z5squarSt4pairIxxES0_S0_(i64 %.sroa.015.0.copyload, i64 %.sroa.216.0.copyload, i64 %.sroa.013.0.copyload, i64 %.sroa.214.0.copyload, i64 %.sroa.011.0.copyload, i64 %.sroa.212.0.copyload)
  %28 = icmp sgt i64 %27, -1
  br i1 %28, label %18, label %.critedge, !llvm.loop !5

.critedge:                                        ; preds = %21, %18
  %.1.lcssa = phi i32 [ %19, %21 ], [ %smin, %18 ]
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv54) #5
  %30 = add nsw i32 %.1.lcssa, 1
  %31 = sext i32 %.1.lcssa to i64
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %31) #5
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 8 dereferenceable(16) %29)
  %exitcond.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.preheader43, !llvm.loop !7

.preheader:                                       ; preds = %.preheader.preheader, %.critedge2
  %indvars.iv61 = phi i64 [ %15, %.preheader.preheader ], [ %indvars.iv.next62, %.critedge2 ]
  %.247 = phi i32 [ %30, %.preheader.preheader ], [ %51, %.critedge2 ]
  %34 = sext i32 %.247 to i64
  %smin59 = call i32 @llvm.smin.i32(i32 %.247, i32 %30)
  br label %40

._crit_edge48:                                    ; preds = %.critedge2, %10, %._crit_edge
  %.2.lcssa = phi i32 [ %.1.lcssa, %._crit_edge ], [ -1, %10 ], [ %.3.lcssa, %.critedge2 ]
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 0) #5
  %36 = load i64, ptr %35, align 8, !tbaa !8
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 1) #5
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %39 = icmp eq i64 %36, %38
  br i1 %39, label %56, label %64

40:                                               ; preds = %.preheader, %42
  %indvars.iv57 = phi i64 [ %34, %.preheader ], [ %indvars.iv.next58, %42 ]
  %41 = icmp sgt i64 %indvars.iv57, %14
  br i1 %41, label %42, label %.critedge2

42:                                               ; preds = %40
  %43 = add nsw i64 %indvars.iv57, -2
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %43) #5
  %.sroa.05.0.copyload = load i64, ptr %44, align 8
  %.sroa.26.0..sroa_idx = getelementptr inbounds i8, ptr %44, i64 8
  %.sroa.26.0.copyload = load i64, ptr %.sroa.26.0..sroa_idx, align 8
  %indvars.iv.next58 = add nsw i64 %indvars.iv57, -1
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv.next58) #5
  %.sroa.03.0.copyload = load i64, ptr %45, align 8
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %45, i64 8
  %.sroa.24.0.copyload = load i64, ptr %.sroa.24.0..sroa_idx, align 8
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv61) #5
  %.sroa.0.0.copyload = load i64, ptr %46, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %46, i64 8
  %.sroa.2.0.copyload = load i64, ptr %.sroa.2.0..sroa_idx, align 8
  %47 = call noundef i64 @_Z5squarSt4pairIxxES0_S0_(i64 %.sroa.05.0.copyload, i64 %.sroa.26.0.copyload, i64 %.sroa.03.0.copyload, i64 %.sroa.24.0.copyload, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload)
  %48 = icmp sgt i64 %47, -1
  br i1 %48, label %40, label %.critedge2.split.loop.exit, !llvm.loop !13

.critedge2.split.loop.exit:                       ; preds = %42
  %49 = trunc nsw i64 %indvars.iv57 to i32
  br label %.critedge2

.critedge2:                                       ; preds = %40, %.critedge2.split.loop.exit
  %.3.lcssa = phi i32 [ %49, %.critedge2.split.loop.exit ], [ %smin59, %40 ]
  %indvars.iv.next62 = add nsw i64 %indvars.iv61, -1
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv61) #5
  %51 = add nsw i32 %.3.lcssa, 1
  %52 = sext i32 %.3.lcssa to i64
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %52) #5
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %53, ptr noundef nonnull align 8 dereferenceable(16) %50)
  %55 = icmp sgt i64 %indvars.iv61, 0
  br i1 %55, label %.preheader, label %._crit_edge48, !llvm.loop !14

56:                                               ; preds = %._crit_edge48
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 0) #5
  %58 = getelementptr inbounds i8, ptr %57, i64 8
  %59 = load i64, ptr %58, align 8, !tbaa !15
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 1) #5
  %61 = getelementptr inbounds i8, ptr %60, i64 8
  %62 = load i64, ptr %61, align 8, !tbaa !15
  %63 = icmp eq i64 %59, %62
  %.neg = sext i1 %63 to i32
  br label %64

64:                                               ; preds = %56, %._crit_edge48
  %.neg42 = phi i32 [ 0, %._crit_edge48 ], [ %.neg, %56 ]
  %65 = add i32 %.2.lcssa, %.neg42
  %66 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %67 = sext i32 %65 to i64
  %68 = icmp ugt i64 %66, %67
  br i1 %68, label %.lr.ph, label %._crit_edge51

.lr.ph:                                           ; preds = %64, %.lr.ph
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %69 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %70 = icmp ugt i64 %69, %67
  br i1 %70, label %.lr.ph, label %._crit_edge51, !llvm.loop !16

._crit_edge51:                                    ; preds = %.lr.ph, %64
  ret void
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxxESaIS1_EEC2EmRKS2_(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 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !10, i64 0}
!9 = !{!"_ZTSSt4pairIxxE", !10, i64 0, !10, i64 8}
!10 = !{!"long long", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}
!15 = !{!9, !10, i64 8}
!16 = distinct !{!16, !6}


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