; LLVM IR from TheAlgorithms/C-Plus-Plus :: geometry (graham_scan_algorithm)

; 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.geometry::grahamscan::Point" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Vector_impl" }
%"struct.std::_Vector_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Vector_impl" = type { %"struct.std::_Vector_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Vector_impl_data" }
%"struct.std::_Vector_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Deque_impl" }
%"struct.std::_Deque_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Deque_impl" = type { %"struct.std::_Deque_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Deque_impl_data" }
%"struct.std::_Deque_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@_ZN8geometry10grahamscan2p0E = external dso_local global %"struct.geometry::grahamscan::Point", align 4

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN8geometry10grahamscan9nextToTopEPSt5stackINS0_5PointESt5dequeIS2_SaIS2_EEE(ptr noundef) #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN8geometry10grahamscan11orientationENS0_5PointES1_S1_(i64, i64, i64) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN8geometry10grahamscan7compareEPKvS2_(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8geometry10grahamscan10convexHullESt6vectorINS0_5PointESaIS2_EEm(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef %1, i64 noundef %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.geometry::grahamscan::Point", align 4
  %14 = alloca %"struct.geometry::grahamscan::Point", align 4
  %15 = alloca %"struct.geometry::grahamscan::Point", align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::stack", align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"struct.geometry::grahamscan::Point", align 4
  %22 = alloca %"struct.geometry::grahamscan::Point", align 4
  %23 = alloca %"struct.geometry::grahamscan::Point", align 4
  %24 = alloca i1, align 1
  %25 = alloca %"struct.geometry::grahamscan::Point", align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %26 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #7
  %27 = getelementptr inbounds %"struct.geometry::grahamscan::Point", ptr %26, i32 0, i32 1
  %28 = load i32, ptr %27, align 4, !tbaa !11
  store i32 %28, ptr %7, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !14
  br label %29

29:                                               ; preds = %68, %3
  %30 = load i32, ptr %9, align 4, !tbaa !14
  %31 = sext i32 %30 to i64
  %32 = load i64, ptr %6, align 8, !tbaa !9
  %33 = icmp ult i64 %31, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %36 = load i32, ptr %9, align 4, !tbaa !14
  %37 = sext i32 %36 to i64
  %38 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %37) #7
  %39 = getelementptr inbounds %"struct.geometry::grahamscan::Point", ptr %38, i32 0, i32 1
  %40 = load i32, ptr %39, align 4, !tbaa !11
  store i32 %40, ptr %10, align 4, !tbaa !14
  %41 = load i32, ptr %10, align 4, !tbaa !14
  %42 = load i32, ptr %7, align 4, !tbaa !14
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %60, label %44

44:                                               ; preds = %35
  %45 = load i32, ptr %7, align 4, !tbaa !14
  %46 = load i32, ptr %10, align 4, !tbaa !14
  %47 = icmp eq i32 %45, %46
  br i1 %47, label %48, label %67

48:                                               ; preds = %44
  %49 = load i32, ptr %9, align 4, !tbaa !14
  %50 = sext i32 %49 to i64
  %51 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %50) #7
  %52 = getelementptr inbounds %"struct.geometry::grahamscan::Point", ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 4, !tbaa !15
  %54 = load i32, ptr %8, align 4, !tbaa !14
  %55 = sext i32 %54 to i64
  %56 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %55) #7
  %57 = getelementptr inbounds %"struct.geometry::grahamscan::Point", ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 4, !tbaa !15
  %59 = icmp slt i32 %53, %58
  br i1 %59, label %60, label %67

60:                                               ; preds = %48, %35
  %61 = load i32, ptr %9, align 4, !tbaa !14
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %62) #7
  %64 = getelementptr inbounds %"struct.geometry::grahamscan::Point", ptr %63, i32 0, i32 1
  %65 = load i32, ptr %64, align 4, !tbaa !11
  store i32 %65, ptr %7, align 4, !tbaa !14
  %66 = load i32, ptr %9, align 4, !tbaa !14
  store i32 %66, ptr %8, align 4, !tbaa !14
  br label %67

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

68:                                               ; preds = %67
  %69 = load i32, ptr %9, align 4, !tbaa !14
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %9, align 4, !tbaa !14
  br label %29, !llvm.loop !16

71:                                               ; preds = %34
  %72 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #7
  %73 = load i32, ptr %8, align 4, !tbaa !14
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %74) #7
  call void @_ZSt4swapIN8geometry10grahamscan5PointEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS6_ESt18is_move_assignableIS6_EEE5valueEvE4typeERS6_SF_(ptr noundef nonnull align 4 dereferenceable(8) %72, ptr noundef nonnull align 4 dereferenceable(8) %75) #7
  %76 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @_ZN8geometry10grahamscan2p0E, ptr align 4 %76, i64 8, i1 false), !tbaa.struct !18
  %77 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 1) #7
  %78 = load i64, ptr %6, align 8, !tbaa !9
  %79 = sub i64 %78, 1
  call void @qsort(ptr noundef %77, i64 noundef %79, i64 noundef 8, ptr noundef @_ZN8geometry10grahamscan7compareEPKvS2_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !14
  br label %80

80:                                               ; preds = %120, %71
  %81 = load i32, ptr %12, align 4, !tbaa !14
  %82 = sext i32 %81 to i64
  %83 = load i64, ptr %6, align 8, !tbaa !9
  %84 = icmp ult i64 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %123

86:                                               ; preds = %80
  br label %87

87:                                               ; preds = %108, %86
  %88 = load i32, ptr %12, align 4, !tbaa !14
  %89 = sext i32 %88 to i64
  %90 = load i64, ptr %6, align 8, !tbaa !9
  %91 = sub i64 %90, 1
  %92 = icmp ult i64 %89, %91
  br i1 %92, label %93, label %106

93:                                               ; preds = %87
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 @_ZN8geometry10grahamscan2p0E, i64 8, i1 false), !tbaa.struct !18
  %94 = load i32, ptr %12, align 4, !tbaa !14
  %95 = sext i32 %94 to i64
  %96 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %95) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %96, i64 8, i1 false), !tbaa.struct !18
  %97 = load i32, ptr %12, align 4, !tbaa !14
  %98 = add nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %99) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %100, i64 8, i1 false), !tbaa.struct !18
  %101 = load i64, ptr %13, align 4
  %102 = load i64, ptr %14, align 4
  %103 = load i64, ptr %15, align 4
  %104 = call noundef i32 @_ZN8geometry10grahamscan11orientationENS0_5PointES1_S1_(i64 %101, i64 %102, i64 %103)
  %105 = icmp eq i32 %104, 0
  br label %106

106:                                              ; preds = %93, %87
  %107 = phi i1 [ false, %87 ], [ %105, %93 ]
  br i1 %107, label %108, label %111

108:                                              ; preds = %106
  %109 = load i32, ptr %12, align 4, !tbaa !14
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %12, align 4, !tbaa !14
  br label %87, !llvm.loop !19

111:                                              ; preds = %106
  %112 = load i32, ptr %12, align 4, !tbaa !14
  %113 = sext i32 %112 to i64
  %114 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %113) #7
  %115 = load i32, ptr %11, align 4, !tbaa !14
  %116 = sext i32 %115 to i64
  %117 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %116) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %117, ptr align 4 %114, i64 8, i1 false), !tbaa.struct !18
  %118 = load i32, ptr %11, align 4, !tbaa !14
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %11, align 4, !tbaa !14
  br label %120

120:                                              ; preds = %111
  %121 = load i32, ptr %12, align 4, !tbaa !14
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %12, align 4, !tbaa !14
  br label %80, !llvm.loop !20

123:                                              ; preds = %85
  %124 = load i32, ptr %11, align 4, !tbaa !14
  %125 = icmp slt i32 %124, 3
  br i1 %125, label %126, label %127

126:                                              ; preds = %123
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  store i32 1, ptr %16, align 4
  br label %201

127:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 80, ptr %17) #7
  call void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %17)
  %128 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #7
  invoke void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %17, ptr noundef nonnull align 4 dereferenceable(8) %128)
          to label %129 unwind label %139

129:                                              ; preds = %127
  %130 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 1) #7
  invoke void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %17, ptr noundef nonnull align 4 dereferenceable(8) %130)
          to label %131 unwind label %139

131:                                              ; preds = %129
  %132 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 2) #7
  invoke void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %17, ptr noundef nonnull align 4 dereferenceable(8) %132)
          to label %133 unwind label %139

133:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 3, ptr %20, align 4, !tbaa !14
  br label %134

134:                                              ; preds = %174, %133
  %135 = load i32, ptr %20, align 4, !tbaa !14
  %136 = load i32, ptr %11, align 4, !tbaa !14
  %137 = icmp slt i32 %135, %136
  br i1 %137, label %143, label %138

138:                                              ; preds = %134
  store i32 10, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %177

139:                                              ; preds = %131, %129, %127
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %18, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %19, align 4
  br label %200

143:                                              ; preds = %134
  br label %144

144:                                              ; preds = %164, %143
  %145 = invoke noundef i64 @_ZNKSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %17)
          to label %146 unwind label %165

146:                                              ; preds = %144
  %147 = icmp ugt i64 %145, 1
  br i1 %147, label %148, label %161

148:                                              ; preds = %146
  %149 = invoke i64 @_ZN8geometry10grahamscan9nextToTopEPSt5stackINS0_5PointESt5dequeIS2_SaIS2_EEE(ptr noundef %17)
          to label %150 unwind label %165

150:                                              ; preds = %148
  store i64 %149, ptr %21, align 4
  %151 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %17)
          to label %152 unwind label %165

152:                                              ; preds = %150
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %151, i64 8, i1 false), !tbaa.struct !18
  %153 = load i32, ptr %20, align 4, !tbaa !14
  %154 = sext i32 %153 to i64
  %155 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %154) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %155, i64 8, i1 false), !tbaa.struct !18
  %156 = load i64, ptr %21, align 4
  %157 = load i64, ptr %22, align 4
  %158 = load i64, ptr %23, align 4
  %159 = call noundef i32 @_ZN8geometry10grahamscan11orientationENS0_5PointES1_S1_(i64 %156, i64 %157, i64 %158)
  %160 = icmp ne i32 %159, 2
  br label %161

161:                                              ; preds = %152, %146
  %162 = phi i1 [ false, %146 ], [ %160, %152 ]
  br i1 %162, label %163, label %169

163:                                              ; preds = %161
  invoke void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %17)
          to label %164 unwind label %165

164:                                              ; preds = %163
  br label %144, !llvm.loop !21

165:                                              ; preds = %169, %163, %150, %148, %144
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %18, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %200

169:                                              ; preds = %161
  %170 = load i32, ptr %20, align 4, !tbaa !14
  %171 = sext i32 %170 to i64
  %172 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %171) #7
  invoke void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %17, ptr noundef nonnull align 4 dereferenceable(8) %172)
          to label %173 unwind label %165

173:                                              ; preds = %169
  br label %174

174:                                              ; preds = %173
  %175 = load i32, ptr %20, align 4, !tbaa !14
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %20, align 4, !tbaa !14
  br label %134, !llvm.loop !22

177:                                              ; preds = %138
  store i1 false, ptr %24, align 1
  call void @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %178

178:                                              ; preds = %186, %177
  %179 = invoke noundef zeroext i1 @_ZNKSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %17)
          to label %180 unwind label %187

180:                                              ; preds = %178
  %181 = xor i1 %179, true
  br i1 %181, label %182, label %195

182:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %183 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %17)
          to label %184 unwind label %191

184:                                              ; preds = %182
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %183, i64 8, i1 false), !tbaa.struct !18
  invoke void @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %25)
          to label %185 unwind label %191

185:                                              ; preds = %184
  invoke void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %17)
          to label %186 unwind label %191

186:                                              ; preds = %185
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %178, !llvm.loop !23

187:                                              ; preds = %178
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %18, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %19, align 4
  br label %199

191:                                              ; preds = %185, %184, %182
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %18, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %199

195:                                              ; preds = %180
  store i1 true, ptr %24, align 1
  store i32 1, ptr %16, align 4
  %196 = load i1, ptr %24, align 1
  br i1 %196, label %198, label %197

197:                                              ; preds = %195
  call void @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %198

198:                                              ; preds = %197, %195
  call void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %17) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %17) #7
  br label %201

199:                                              ; preds = %191, %187
  call void @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %200

200:                                              ; preds = %199, %165, %139
  call void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %17) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %202

201:                                              ; preds = %198, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  ret void

202:                                              ; preds = %200
  %203 = load ptr, ptr %18, align 8
  %204 = load i32, ptr %19, align 4
  %205 = insertvalue { ptr, i32 } poison, ptr %203, 0
  %206 = insertvalue { ptr, i32 } %205, i32 %204, 1
  resume { ptr, i32 } %206
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIN8geometry10grahamscan5PointEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS6_ESt18is_move_assignableIS6_EEE5valueEvE4typeERS6_SF_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #4

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

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

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


; 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.geometry::grahamscan::Point" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Vector_impl" }
%"struct.std::_Vector_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Vector_impl" = type { %"struct.std::_Vector_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Vector_impl_data" }
%"struct.std::_Vector_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Deque_impl" }
%"struct.std::_Deque_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Deque_impl" = type { %"struct.std::_Deque_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Deque_impl_data" }
%"struct.std::_Deque_base<geometry::grahamscan::Point, std::allocator<geometry::grahamscan::Point>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@_ZN8geometry10grahamscan2p0E = external dso_local local_unnamed_addr global %"struct.geometry::grahamscan::Point", align 4

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN8geometry10grahamscan9nextToTopEPSt5stackINS0_5PointESt5dequeIS2_SaIS2_EEE(ptr noundef) 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN8geometry10grahamscan11orientationENS0_5PointES1_S1_(i64, i64, i64) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN8geometry10grahamscan7compareEPKvS2_(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8geometry10grahamscan10convexHullESt6vectorINS0_5PointESaIS2_EEm(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull %1, i64 noundef %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::stack", align 8
  %5 = alloca %"struct.geometry::grahamscan::Point", align 8
  %6 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #7
  %7 = icmp ugt i64 %2, 1
  br i1 %7, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %3
  %8 = getelementptr inbounds i8, ptr %6, i64 4
  %9 = load i32, ptr %8, align 4, !tbaa !5
  br label %.lr.ph

._crit_edge.loopexit:                             ; preds = %35
  %10 = sext i32 %.141 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %3
  %.040.lcssa = phi i64 [ 0, %3 ], [ %10, %._crit_edge.loopexit ]
  %11 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #7
  %12 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.040.lcssa) #7
  tail call void @_ZSt4swapIN8geometry10grahamscan5PointEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS6_ESt18is_move_assignableIS6_EEE5valueEvE4typeERS6_SF_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %12) #7
  %13 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #7
  %14 = load i64, ptr %13, align 4
  store i64 %14, ptr @_ZN8geometry10grahamscan2p0E, align 4
  %15 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 1) #7
  %16 = add nsw i64 %2, -1
  tail call void @qsort(ptr noundef nonnull %15, i64 noundef %16, i64 noundef 8, ptr noundef nonnull @_ZN8geometry10grahamscan7compareEPKvS2_)
  br i1 %7, label %.preheader55, label %._crit_edge61.thread

.lr.ph:                                           ; preds = %.lr.ph.preheader, %35
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %35 ]
  %.058 = phi i32 [ %9, %.lr.ph.preheader ], [ %.1, %35 ]
  %.04057 = phi i32 [ 0, %.lr.ph.preheader ], [ %.141, %35 ]
  %17 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #7
  %18 = getelementptr inbounds i8, ptr %17, i64 4
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = icmp slt i32 %19, %.058
  br i1 %20, label %30, label %21

21:                                               ; preds = %.lr.ph
  %22 = icmp eq i32 %.058, %19
  br i1 %22, label %23, label %35

23:                                               ; preds = %21
  %24 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #7
  %25 = load i32, ptr %24, align 4, !tbaa !10
  %26 = sext i32 %.04057 to i64
  %27 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %26) #7
  %28 = load i32, ptr %27, align 4, !tbaa !10
  %29 = icmp slt i32 %25, %28
  br i1 %29, label %30, label %35

30:                                               ; preds = %23, %.lr.ph
  %31 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #7
  %32 = getelementptr inbounds i8, ptr %31, i64 4
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = trunc nuw nsw i64 %indvars.iv to i32
  br label %35

35:                                               ; preds = %30, %23, %21
  %.141 = phi i32 [ %34, %30 ], [ %.04057, %23 ], [ %.04057, %21 ]
  %.1 = phi i32 [ %33, %30 ], [ %.058, %23 ], [ %.058, %21 ]
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %2
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !11

.preheader55:                                     ; preds = %._crit_edge, %.critedge
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %.critedge ], [ 1, %._crit_edge ]
  %.04759 = phi i32 [ %47, %.critedge ], [ 1, %._crit_edge ]
  %36 = sext i32 %.04759 to i64
  %umax = tail call i64 @llvm.umax.i64(i64 %16, i64 %36)
  br label %38

._crit_edge61:                                    ; preds = %.critedge
  %37 = icmp ult i64 %indvars.iv77, 2
  br i1 %37, label %._crit_edge61.thread, label %50

38:                                               ; preds = %.preheader55, %39
  %indvars.iv73 = phi i64 [ %36, %.preheader55 ], [ %indvars.iv.next74, %39 ]
  %exitcond76.not = icmp eq i64 %indvars.iv73, %umax
  br i1 %exitcond76.not, label %.critedge, label %39

39:                                               ; preds = %38
  %.sroa.012.0.copyload = load i64, ptr @_ZN8geometry10grahamscan2p0E, align 4
  %40 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv73) #7
  %.sroa.011.0.copyload = load i64, ptr %40, align 4
  %indvars.iv.next74 = add i64 %indvars.iv73, 1
  %41 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv.next74) #7
  %.sroa.010.0.copyload = load i64, ptr %41, align 4
  %42 = tail call noundef i32 @_ZN8geometry10grahamscan11orientationENS0_5PointES1_S1_(i64 %.sroa.012.0.copyload, i64 %.sroa.011.0.copyload, i64 %.sroa.010.0.copyload)
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %38, label %.critedge, !llvm.loop !13

.critedge:                                        ; preds = %38, %39
  %.lcssa = phi i64 [ %umax, %38 ], [ %indvars.iv73, %39 ]
  %.148.lcssa = trunc i64 %.lcssa to i32
  %44 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.lcssa) #7
  %45 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv77) #7
  %46 = load i64, ptr %44, align 4
  store i64 %46, ptr %45, align 4
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %47 = add nsw i32 %.148.lcssa, 1
  %48 = sext i32 %47 to i64
  %49 = icmp ult i64 %48, %2
  br i1 %49, label %.preheader55, label %._crit_edge61, !llvm.loop !14

._crit_edge61.thread:                             ; preds = %._crit_edge, %._crit_edge61
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %0, i8 0, i64 24, i1 false)
  tail call void @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %78

50:                                               ; preds = %._crit_edge61
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #7
  call void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %51 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #7
  invoke void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(8) %51)
          to label %52 unwind label %59

52:                                               ; preds = %50
  %53 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 1) #7
  invoke void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(8) %53)
          to label %54 unwind label %59

54:                                               ; preds = %52
  %55 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 2) #7
  invoke void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(8) %55)
          to label %.preheader54 unwind label %59

.preheader54:                                     ; preds = %54
  %.not70 = icmp eq i64 %indvars.iv.next78, 3
  br i1 %.not70, label %._crit_edge66, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader54
  %wide.trip.count = and i64 %indvars.iv.next78, 4294967295
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %70
  %indvars.iv80 = phi i64 [ 3, %.preheader.preheader ], [ %indvars.iv.next81, %70 ]
  %56 = call noundef i64 @_ZNKSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %57 = icmp ugt i64 %56, 1
  br i1 %57, label %.lr.ph63, label %.critedge2

._crit_edge66:                                    ; preds = %70, %.preheader54
  call void @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  %58 = call noundef zeroext i1 @_ZNKSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %58, label %._crit_edge69, label %.lr.ph68

59:                                               ; preds = %54, %52, %50
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %77

.lr.ph63:                                         ; preds = %.preheader, %66
  %61 = invoke i64 @_ZN8geometry10grahamscan9nextToTopEPSt5stackINS0_5PointESt5dequeIS2_SaIS2_EEE(ptr noundef nonnull %4)
          to label %62 unwind label %.loopexit

62:                                               ; preds = %.lr.ph63
  %63 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %.sroa.03.0.copyload = load i64, ptr %63, align 4
  %64 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv80) #7
  %.sroa.0.0.copyload = load i64, ptr %64, align 4
  %65 = call noundef i32 @_ZN8geometry10grahamscan11orientationENS0_5PointES1_S1_(i64 %61, i64 %.sroa.03.0.copyload, i64 %.sroa.0.0.copyload)
  %.not = icmp eq i32 %65, 2
  br i1 %.not, label %.critedge2, label %66

66:                                               ; preds = %62
  call void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %67 = call noundef i64 @_ZNKSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %68 = icmp ugt i64 %67, 1
  br i1 %68, label %.lr.ph63, label %.critedge2, !llvm.loop !15

.loopexit:                                        ; preds = %.lr.ph63
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %77

.loopexit.split-lp:                               ; preds = %.critedge2
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %77

.critedge2:                                       ; preds = %62, %66, %.preheader
  %69 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv80) #7
  invoke void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(8) %69)
          to label %70 unwind label %.loopexit.split-lp

70:                                               ; preds = %.critedge2
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond83.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count
  br i1 %exitcond83.not, label %._crit_edge66, label %.preheader, !llvm.loop !16

.lr.ph68:                                         ; preds = %._crit_edge66, %73
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %71 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %72 = load i64, ptr %71, align 4
  store i64 %72, ptr %5, align 8
  invoke void @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %5)
          to label %73 unwind label %75

73:                                               ; preds = %.lr.ph68
  call void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %74 = call noundef zeroext i1 @_ZNKSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %74, label %._crit_edge69, label %.lr.ph68, !llvm.loop !17

75:                                               ; preds = %.lr.ph68
  %76 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @_ZNSt6vectorIN8geometry10grahamscan5PointESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %77

._crit_edge69:                                    ; preds = %73, %._crit_edge66
  call void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #7
  br label %78

77:                                               ; preds = %.loopexit, %.loopexit.split-lp, %75, %59
  %.pn = phi { ptr, i32 } [ %76, %75 ], [ %60, %59 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn

78:                                               ; preds = %._crit_edge69, %._crit_edge61.thread
  ret void
}

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

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

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIN8geometry10grahamscan5PointESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #6

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


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