; LLVM IR from xirc/cp-algorithm :: aoj/CGL/CGL4A/main.ll (Z11convex_hullRKSt6vectorI7vector2SaIS0_EE)

; 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<vector2, std::allocator<vector2>>::_Vector_impl" }
%"struct.std::_Vector_base<vector2, std::allocator<vector2>>::_Vector_impl" = type { %"struct.std::_Vector_base<vector2, std::allocator<vector2>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vector2, std::allocator<vector2>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator.0" = type { ptr }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11convex_hullRKSt6vectorI7vector2SaIS0_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.std::allocator", align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %14 = alloca i32, align 4
  %15 = alloca i1, align 1
  %16 = alloca %"class.std::allocator", align 1
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = call noundef i64 @_ZNKSt6vectorI7vector2SaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  %22 = trunc i64 %21 to i32
  store i32 %22, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #5
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = call ptr @_ZNKSt6vectorI7vector2SaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  %25 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %24, ptr %25, align 8
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = call ptr @_ZNKSt6vectorI7vector2SaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #5
  %28 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %27, ptr %28, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  call void @_ZNSaI7vector2EC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  %29 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8
  %31 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8
  invoke void @_ZNSt6vectorI7vector2SaIS0_EEC2IN9__gnu_cxx17__normal_iteratorIPKS0_S2_EEvEET_S9_RKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr %30, ptr %32, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %33 unwind label %52

33:                                               ; preds = %2
  call void @_ZNSt15__new_allocatorI7vector2ED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  %34 = call ptr @_ZNSt6vectorI7vector2SaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %12, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  %36 = call ptr @_ZNSt6vectorI7vector2SaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %13, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  %38 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %12, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8
  %40 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %13, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP7vector2St6vectorIS2_SaIS2_EEEEEvT_S8_(ptr %39, ptr %41)
          to label %42 unwind label %56

42:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  store i1 false, ptr %15, align 1
  %43 = load i32, ptr %5, align 4, !tbaa !9
  %44 = mul nsw i32 2, %43
  %45 = sext i32 %44 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  call void @_ZNSaI7vector2EC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  invoke void @_ZNSt6vectorI7vector2SaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %45, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %46 unwind label %60

46:                                               ; preds = %42
  call void @_ZNSt15__new_allocatorI7vector2ED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %100, %46
  %48 = load i32, ptr %17, align 4, !tbaa !9
  %49 = load i32, ptr %5, align 4, !tbaa !9
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %64, label %51

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %103

52:                                               ; preds = %2
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %10, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %11, align 4
  call void @_ZNSt15__new_allocatorI7vector2ED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %168

56:                                               ; preds = %33
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %10, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %11, align 4
  br label %167

60:                                               ; preds = %42
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %10, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %11, align 4
  call void @_ZNSt15__new_allocatorI7vector2ED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  br label %166

64:                                               ; preds = %47
  br label %65

65:                                               ; preds = %85, %64
  %66 = load i32, ptr %14, align 4, !tbaa !9
  %67 = icmp sge i32 %66, 2
  br i1 %67, label %68, label %83

68:                                               ; preds = %65
  %69 = load i32, ptr %14, align 4, !tbaa !9
  %70 = sub nsw i32 %69, 2
  %71 = sext i32 %70 to i64
  %72 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %71) #5
  %73 = load i32, ptr %14, align 4, !tbaa !9
  %74 = sub nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %75) #5
  %77 = load i32, ptr %17, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %78) #5
  %80 = invoke noundef i32 @_Z3ccwRK7vector2S1_S1_(ptr noundef nonnull align 8 dereferenceable(16) %72, ptr noundef nonnull align 8 dereferenceable(16) %76, ptr noundef nonnull align 8 dereferenceable(16) %79)
          to label %81 unwind label %88

81:                                               ; preds = %68
  %82 = icmp eq i32 %80, -1
  br label %83

83:                                               ; preds = %81, %65
  %84 = phi i1 [ false, %65 ], [ %82, %81 ]
  br i1 %84, label %85, label %92

85:                                               ; preds = %83
  %86 = load i32, ptr %14, align 4, !tbaa !9
  %87 = add nsw i32 %86, -1
  store i32 %87, ptr %14, align 4, !tbaa !9
  br label %65, !llvm.loop !11

88:                                               ; preds = %68
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %10, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %165

92:                                               ; preds = %83
  %93 = load i32, ptr %17, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %94) #5
  %96 = load i32, ptr %14, align 4, !tbaa !9
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %14, align 4, !tbaa !9
  %98 = sext i32 %96 to i64
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %98) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %99, ptr align 8 %95, i64 16, i1 false), !tbaa.struct !13
  br label %100

100:                                              ; preds = %92
  %101 = load i32, ptr %17, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %17, align 4, !tbaa !9
  br label %47, !llvm.loop !16

103:                                              ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %104 = load i32, ptr %14, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %106 = load i32, ptr %5, align 4, !tbaa !9
  %107 = sub nsw i32 %106, 2
  store i32 %107, ptr %19, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %149, %103
  %109 = load i32, ptr %19, align 4, !tbaa !9
  %110 = icmp sge i32 %109, 0
  br i1 %110, label %112, label %111

111:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %152

112:                                              ; preds = %108
  br label %113

113:                                              ; preds = %134, %112
  %114 = load i32, ptr %14, align 4, !tbaa !9
  %115 = load i32, ptr %18, align 4, !tbaa !9
  %116 = icmp sge i32 %114, %115
  br i1 %116, label %117, label %132

117:                                              ; preds = %113
  %118 = load i32, ptr %14, align 4, !tbaa !9
  %119 = sub nsw i32 %118, 2
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %120) #5
  %122 = load i32, ptr %14, align 4, !tbaa !9
  %123 = sub nsw i32 %122, 1
  %124 = sext i32 %123 to i64
  %125 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %124) #5
  %126 = load i32, ptr %19, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %127) #5
  %129 = invoke noundef i32 @_Z3ccwRK7vector2S1_S1_(ptr noundef nonnull align 8 dereferenceable(16) %121, ptr noundef nonnull align 8 dereferenceable(16) %125, ptr noundef nonnull align 8 dereferenceable(16) %128)
          to label %130 unwind label %137

130:                                              ; preds = %117
  %131 = icmp eq i32 %129, -1
  br label %132

132:                                              ; preds = %130, %113
  %133 = phi i1 [ false, %113 ], [ %131, %130 ]
  br i1 %133, label %134, label %141

134:                                              ; preds = %132
  %135 = load i32, ptr %14, align 4, !tbaa !9
  %136 = add nsw i32 %135, -1
  store i32 %136, ptr %14, align 4, !tbaa !9
  br label %113, !llvm.loop !17

137:                                              ; preds = %117
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %10, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %162

141:                                              ; preds = %132
  %142 = load i32, ptr %19, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %143) #5
  %145 = load i32, ptr %14, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %14, align 4, !tbaa !9
  %147 = sext i32 %145 to i64
  %148 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %147) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %148, ptr align 8 %144, i64 16, i1 false), !tbaa.struct !13
  br label %149

149:                                              ; preds = %141
  %150 = load i32, ptr %19, align 4, !tbaa !9
  %151 = add nsw i32 %150, -1
  store i32 %151, ptr %19, align 4, !tbaa !9
  br label %108, !llvm.loop !18

152:                                              ; preds = %111
  %153 = load i32, ptr %14, align 4, !tbaa !9
  %154 = sub nsw i32 %153, 1
  %155 = sext i32 %154 to i64
  invoke void @_ZNSt6vectorI7vector2SaIS0_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %155)
          to label %156 unwind label %158

156:                                              ; preds = %152
  store i1 true, ptr %15, align 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  %157 = load i1, ptr %15, align 1
  br i1 %157, label %164, label %163

158:                                              ; preds = %152
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %10, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %11, align 4
  br label %162

162:                                              ; preds = %158, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %165

163:                                              ; preds = %156
  call void @_ZNSt6vectorI7vector2SaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %164

164:                                              ; preds = %163, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @_ZNSt6vectorI7vector2SaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void

165:                                              ; preds = %162, %88
  call void @_ZNSt6vectorI7vector2SaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %166

166:                                              ; preds = %165, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %167

167:                                              ; preds = %166, %56
  call void @_ZNSt6vectorI7vector2SaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  br label %168

168:                                              ; preds = %167, %52
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %169

169:                                              ; preds = %168
  %170 = load ptr, ptr %10, align 8
  %171 = load i32, ptr %11, align 4
  %172 = insertvalue { ptr, i32 } poison, ptr %170, 0
  %173 = insertvalue { ptr, i32 } %172, i32 %171, 1
  resume { ptr, i32 } %173
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 nounwind willreturn memory(argmem: readwrite) }
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 = !{i64 0, i64 8, !14, i64 8, i64 8, !14}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !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<vector2, std::allocator<vector2>>::_Vector_impl" }
%"struct.std::_Vector_base<vector2, std::allocator<vector2>>::_Vector_impl" = type { %"struct.std::_Vector_base<vector2, std::allocator<vector2>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vector2, std::allocator<vector2>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11convex_hullRKSt6vectorI7vector2SaIS0_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.std::allocator", align 1
  %6 = tail call noundef i64 @_ZNKSt6vectorI7vector2SaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %7 = trunc i64 %6 to i32
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %8 = tail call ptr @_ZNKSt6vectorI7vector2SaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %9 = tail call ptr @_ZNKSt6vectorI7vector2SaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaI7vector2EC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorI7vector2SaIS0_EEC2IN9__gnu_cxx17__normal_iteratorIPKS0_S2_EEvEET_S9_RKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr %8, ptr %9, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %10 unwind label %22

10:                                               ; preds = %2
  call void @_ZNSt15__new_allocatorI7vector2ED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  %11 = call ptr @_ZNSt6vectorI7vector2SaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %12 = call ptr @_ZNSt6vectorI7vector2SaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP7vector2St6vectorIS2_SaIS2_EEEEEvT_S8_(ptr %11, ptr %12)
          to label %13 unwind label %24

13:                                               ; preds = %10
  %14 = shl nsw i32 %7, 1
  %15 = sext i32 %14 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  call void @_ZNSaI7vector2EC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt6vectorI7vector2SaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %15, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %16 unwind label %26

16:                                               ; preds = %13
  call void @_ZNSt15__new_allocatorI7vector2ED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  %17 = icmp sgt i32 %7, 0
  br i1 %17, label %.preheader52.preheader, label %._crit_edge61

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

.preheader52:                                     ; preds = %.preheader52.preheader, %.critedge
  %indvars.iv67 = phi i64 [ 0, %.preheader52.preheader ], [ %indvars.iv.next68, %.critedge ]
  %.03657 = phi i32 [ 0, %.preheader52.preheader ], [ %43, %.critedge ]
  %18 = zext i32 %.03657 to i64
  %smin = call i32 @llvm.smin.i32(i32 %.03657, i32 1)
  br label %28

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

.preheader.preheader:                             ; preds = %._crit_edge
  %19 = add i64 %6, 4294967294
  %20 = sext i32 %43 to i64
  %21 = and i64 %19, 4294967295
  br label %.preheader

22:                                               ; preds = %2
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorI7vector2ED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  br label %70

24:                                               ; preds = %10
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %69

26:                                               ; preds = %13
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorI7vector2ED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  br label %69

28:                                               ; preds = %.preheader52, %38
  %indvars.iv = phi i64 [ %18, %.preheader52 ], [ %34, %38 ]
  %29 = trunc nuw i64 %indvars.iv to i32
  %30 = icmp sgt i32 %29, 1
  br i1 %30, label %31, label %.critedge

31:                                               ; preds = %28
  %32 = add nsw i64 %indvars.iv, -2
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %32) #6
  %34 = add nsw i64 %indvars.iv, -1
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %34) #6
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv67) #6
  %37 = invoke noundef i32 @_Z3ccwRK7vector2S1_S1_(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(16) %36)
          to label %38 unwind label %40

38:                                               ; preds = %31
  %39 = icmp eq i32 %37, -1
  br i1 %39, label %28, label %.critedge, !llvm.loop !5

40:                                               ; preds = %31
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %68

.critedge:                                        ; preds = %28, %38
  %.137.lcssa = phi i32 [ %smin, %28 ], [ %29, %38 ]
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv67) #6
  %43 = add nsw i32 %.137.lcssa, 1
  %44 = sext i32 %.137.lcssa to i64
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %44) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 8 dereferenceable(16) %42, i64 16, i1 false), !tbaa.struct !7
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.preheader52, !llvm.loop !12

.preheader:                                       ; preds = %.preheader.preheader, %.critedge2
  %indvars.iv74 = phi i64 [ %21, %.preheader.preheader ], [ %indvars.iv.next75, %.critedge2 ]
  %.23859 = phi i32 [ %43, %.preheader.preheader ], [ %61, %.critedge2 ]
  %46 = sext i32 %.23859 to i64
  %smin72 = call i32 @llvm.smin.i32(i32 %.23859, i32 %43)
  br label %48

._crit_edge61:                                    ; preds = %.critedge2, %16, %._crit_edge
  %.238.lcssa = phi i32 [ %.137.lcssa, %._crit_edge ], [ -1, %16 ], [ %.339.lcssa, %.critedge2 ]
  %47 = sext i32 %.238.lcssa to i64
  invoke void @_ZNSt6vectorI7vector2SaIS0_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %47)
          to label %67 unwind label %65

48:                                               ; preds = %.preheader, %55
  %indvars.iv70 = phi i64 [ %46, %.preheader ], [ %indvars.iv.next71, %55 ]
  %.not.not = icmp sgt i64 %indvars.iv70, %20
  br i1 %.not.not, label %49, label %.critedge2

49:                                               ; preds = %48
  %50 = add nsw i64 %indvars.iv70, -2
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %50) #6
  %indvars.iv.next71 = add nsw i64 %indvars.iv70, -1
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv.next71) #6
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv74) #6
  %54 = invoke noundef i32 @_Z3ccwRK7vector2S1_S1_(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 8 dereferenceable(16) %52, ptr noundef nonnull align 8 dereferenceable(16) %53)
          to label %55 unwind label %57

55:                                               ; preds = %49
  %56 = icmp eq i32 %54, -1
  br i1 %56, label %48, label %.critedge2.split.loop.exit79, !llvm.loop !13

57:                                               ; preds = %49
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %68

.critedge2.split.loop.exit79:                     ; preds = %55
  %59 = trunc nsw i64 %indvars.iv70 to i32
  br label %.critedge2

.critedge2:                                       ; preds = %48, %.critedge2.split.loop.exit79
  %.339.lcssa = phi i32 [ %59, %.critedge2.split.loop.exit79 ], [ %smin72, %48 ]
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv74) #6
  %61 = add nsw i32 %.339.lcssa, 1
  %62 = sext i32 %.339.lcssa to i64
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI7vector2SaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %62) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %63, ptr noundef nonnull align 8 dereferenceable(16) %60, i64 16, i1 false), !tbaa.struct !7
  %indvars.iv.next75 = add nsw i64 %indvars.iv74, -1
  %64 = icmp sgt i64 %indvars.iv74, 0
  br i1 %64, label %.preheader, label %._crit_edge61, !llvm.loop !14

65:                                               ; preds = %._crit_edge61
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %68

67:                                               ; preds = %._crit_edge61
  call void @_ZNSt6vectorI7vector2SaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  ret void

68:                                               ; preds = %57, %65, %40
  %.pn47 = phi { ptr, i32 } [ %41, %40 ], [ %58, %57 ], [ %66, %65 ]
  call void @_ZNSt6vectorI7vector2SaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %69

69:                                               ; preds = %26, %68, %24
  %.pn47.pn.pn = phi { ptr, i32 } [ %25, %24 ], [ %.pn47, %68 ], [ %27, %26 ]
  call void @_ZNSt6vectorI7vector2SaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %70

70:                                               ; preds = %69, %22
  %.pn47.pn.pn.pn = phi { ptr, i32 } [ %.pn47.pn.pn, %69 ], [ %23, %22 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn47.pn.pn.pn
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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


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