; LLVM IR from HarshCasper/NeoAlgo :: C-Plus-Plus/computational_geometry/Convex_Hull_Jarvis_Algorithm.ll (Z10convexHullP5POINTi)

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z11orientation5POINTS_S_(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: mustprogress uwtable
declare dso_local void @_Z10printPoint5POINT(i64) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10convexHullP5POINTi(ptr noundef %0, i32 noundef %1) #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.POINT, align 4
  %15 = alloca %struct.POINT, align 4
  %16 = alloca %struct.POINT, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct.POINT, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %20 = load i32, ptr %4, align 4, !tbaa !9
  %21 = icmp slt i32 %20, 3
  br i1 %21, label %22, label %23

22:                                               ; preds = %2
  br label %138

23:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #5
  call void @_ZNSt6vectorI5POINTSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %46, %23
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %26 = load i32, ptr %4, align 4, !tbaa !9
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %49

29:                                               ; preds = %24
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds %struct.POINT, ptr %30, i64 %32
  %34 = getelementptr inbounds %struct.POINT, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 4, !tbaa !11
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds %struct.POINT, ptr %36, i64 %38
  %40 = getelementptr inbounds %struct.POINT, ptr %39, i32 0, i32 0
  %41 = load i32, ptr %40, align 4, !tbaa !11
  %42 = icmp sgt i32 %35, %41
  br i1 %42, label %43, label %45

43:                                               ; preds = %29
  %44 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %44, ptr %6, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %43, %29
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %7, align 4, !tbaa !9
  br label %24, !llvm.loop !13

49:                                               ; preds = %28
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = load i32, ptr %6, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds %struct.POINT, ptr %50, i64 %52
  invoke void @_ZNSt6vectorI5POINTSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(8) %53)
          to label %54 unwind label %67

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %55 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %55, ptr %10, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %110, %54
  br label %57

57:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %58 = load i32, ptr %10, align 4, !tbaa !9
  %59 = add nsw i32 %58, 1
  %60 = load i32, ptr %4, align 4, !tbaa !9
  %61 = srem i32 %59, %60
  store i32 %61, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %93, %57
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = load i32, ptr %4, align 4, !tbaa !9
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %71, label %66

66:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %96

67:                                               ; preds = %49
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %8, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %9, align 4
  br label %140

71:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = load i32, ptr %10, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds %struct.POINT, ptr %72, i64 %74
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %75, i64 8, i1 false), !tbaa.struct !15
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds %struct.POINT, ptr %76, i64 %78
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %79, i64 8, i1 false), !tbaa.struct !15
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = load i32, ptr %11, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds %struct.POINT, ptr %80, i64 %82
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %83, i64 8, i1 false), !tbaa.struct !15
  %84 = load i64, ptr %14, align 4
  %85 = load i64, ptr %15, align 4
  %86 = load i64, ptr %16, align 4
  %87 = call noundef i32 @_Z11orientation5POINTS_S_(i64 %84, i64 %85, i64 %86)
  store i32 %87, ptr %13, align 4, !tbaa !9
  %88 = load i32, ptr %13, align 4, !tbaa !9
  %89 = icmp eq i32 %88, -1
  br i1 %89, label %90, label %92

90:                                               ; preds = %71
  %91 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %91, ptr %11, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %90, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %12, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %12, align 4, !tbaa !9
  br label %62, !llvm.loop !16

96:                                               ; preds = %66
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = load i32, ptr %6, align 4, !tbaa !9
  %99 = icmp eq i32 %97, %98
  br i1 %99, label %100, label %101

100:                                              ; preds = %96
  store i32 6, ptr %17, align 4
  br label %108

101:                                              ; preds = %96
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = load i32, ptr %11, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds %struct.POINT, ptr %102, i64 %104
  invoke void @_ZNSt6vectorI5POINTSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(8) %105)
          to label %106 unwind label %111

106:                                              ; preds = %101
  %107 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %107, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %17, align 4
  br label %108

108:                                              ; preds = %106, %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %109 = load i32, ptr %17, align 4
  switch i32 %109, label %146 [
    i32 0, label %110
    i32 6, label %115
  ]

110:                                              ; preds = %108
  br label %56, !llvm.loop !17

111:                                              ; preds = %101
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %8, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %139

115:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %116

116:                                              ; preds = %130, %115
  %117 = load i32, ptr %18, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = call noundef i64 @_ZNKSt6vectorI5POINTSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %120 = icmp ult i64 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %116
  store i32 10, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %137

122:                                              ; preds = %116
  %123 = load i32, ptr %18, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5POINTSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %124) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %125, i64 8, i1 false), !tbaa.struct !15
  %126 = load i64, ptr %19, align 4
  invoke void @_Z10printPoint5POINT(i64 %126)
          to label %127 unwind label %133

127:                                              ; preds = %122
  %128 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %129 unwind label %133

129:                                              ; preds = %127
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %18, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %18, align 4, !tbaa !9
  br label %116, !llvm.loop !18

133:                                              ; preds = %127, %122
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %8, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %139

137:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @_ZNSt6vectorI5POINTSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  br label %138

138:                                              ; preds = %137, %22
  ret void

139:                                              ; preds = %133, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %140

140:                                              ; preds = %139, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @_ZNSt6vectorI5POINTSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  br label %141

141:                                              ; preds = %140
  %142 = load ptr, ptr %8, align 8
  %143 = load i32, ptr %9, align 4
  %144 = insertvalue { ptr, i32 } poison, ptr %142, 0
  %145 = insertvalue { ptr, i32 } %144, i32 %143, 1
  resume { ptr, i32 } %145

146:                                              ; preds = %108
  unreachable
}

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

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

declare i32 @__gxx_personality_v0(...)

; 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 noundef i64 @_ZNKSt6vectorI5POINTSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<POINT, std::allocator<POINT>>::_Vector_impl" }
%"struct.std::_Vector_base<POINT, std::allocator<POINT>>::_Vector_impl" = type { %"struct.std::_Vector_base<POINT, std::allocator<POINT>>::_Vector_impl_data" }
%"struct.std::_Vector_base<POINT, std::allocator<POINT>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.POINT = type { i32, i32 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z11orientation5POINTS_S_(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
declare dso_local void @_Z10printPoint5POINT(i64) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10convexHullP5POINTi(ptr noundef %0, i32 noundef %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector", align 8
  %4 = icmp slt i32 %1, 3
  br i1 %4, label %71, label %5

5:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  call void @_ZNSt6vectorI5POINTSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %wide.trip.count = zext nneg i32 %1 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %6 = icmp eq i32 %1, 3
  br i1 %6, label %.unr-lcssa, label %.new

.new:                                             ; preds = %5
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %31

.unr-lcssa:                                       ; preds = %31, %5
  %spec.select.lcssa.ph = phi i32 [ poison, %5 ], [ %spec.select.3, %31 ]
  %indvars.iv.unr = phi i64 [ 0, %5 ], [ %indvars.iv.next.3, %31 ]
  %.057.unr = phi i32 [ 0, %5 ], [ %spec.select.3, %31 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.epilog-lcssa, label %.epil.preheader

.epil.preheader:                                  ; preds = %.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %.unr-lcssa ]
  %.057.epil = phi i32 [ %spec.select.epil, %.epil.preheader ], [ %.057.unr, %.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.unr-lcssa ]
  %7 = sext i32 %.057.epil to i64
  %8 = getelementptr inbounds %struct.POINT, ptr %0, i64 %7
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = getelementptr inbounds %struct.POINT, ptr %0, i64 %indvars.iv.epil
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = icmp sgt i32 %9, %11
  %13 = trunc nuw nsw i64 %indvars.iv.epil to i32
  %spec.select.epil = select i1 %12, i32 %13, i32 %.057.epil
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.epilog-lcssa, label %.epil.preheader, !llvm.loop !10

.epilog-lcssa:                                    ; preds = %.epil.preheader, %.unr-lcssa
  %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %.unr-lcssa ], [ %spec.select.epil, %.epil.preheader ]
  %14 = sext i32 %spec.select.lcssa to i64
  %15 = getelementptr inbounds %struct.POINT, ptr %0, i64 %14
  invoke void @_ZNSt6vectorI5POINTSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(8) %15)
          to label %.lr.ph.us unwind label %60

.lr.ph.us:                                        ; preds = %.epilog-lcssa, %20
  %.045.us = phi i32 [ %spec.select54.us, %20 ], [ %spec.select.lcssa, %.epilog-lcssa ]
  %16 = add nsw i32 %.045.us, 1
  %17 = srem i32 %16, %1
  %18 = sext i32 %.045.us to i64
  %19 = getelementptr inbounds %struct.POINT, ptr %0, i64 %18
  br label %23

20:                                               ; preds = %._crit_edge.us
  %21 = sext i32 %spec.select54.us to i64
  %22 = getelementptr inbounds %struct.POINT, ptr %0, i64 %21
  invoke void @_ZNSt6vectorI5POINTSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %.lr.ph.us unwind label %.split.us

23:                                               ; preds = %.lr.ph.us, %23
  %indvars.iv63 = phi i64 [ 0, %.lr.ph.us ], [ %indvars.iv.next64, %23 ]
  %.04858.us = phi i32 [ %17, %.lr.ph.us ], [ %spec.select54.us, %23 ]
  %.sroa.06.0.copyload.us = load i64, ptr %19, align 4
  %24 = getelementptr inbounds %struct.POINT, ptr %0, i64 %indvars.iv63
  %.sroa.05.0.copyload.us = load i64, ptr %24, align 4
  %25 = sext i32 %.04858.us to i64
  %26 = getelementptr inbounds %struct.POINT, ptr %0, i64 %25
  %.sroa.04.0.copyload.us = load i64, ptr %26, align 4
  %27 = call noundef i32 @_Z11orientation5POINTS_S_(i64 %.sroa.06.0.copyload.us, i64 %.sroa.05.0.copyload.us, i64 %.sroa.04.0.copyload.us)
  %28 = icmp eq i32 %27, -1
  %29 = trunc nuw nsw i64 %indvars.iv63 to i32
  %spec.select54.us = select i1 %28, i32 %29, i32 %.04858.us
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond67.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count
  br i1 %exitcond67.not, label %._crit_edge.us, label %23, !llvm.loop !12

._crit_edge.us:                                   ; preds = %23
  %.not.us = icmp eq i32 %spec.select54.us, %spec.select.lcssa
  br i1 %.not.us, label %.preheader, label %20

.split.us:                                        ; preds = %20
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %72

31:                                               ; preds = %31, %.new
  %indvars.iv = phi i64 [ 0, %.new ], [ %indvars.iv.next.3, %31 ]
  %.057 = phi i32 [ 0, %.new ], [ %spec.select.3, %31 ]
  %niter = phi i64 [ 0, %.new ], [ %niter.next.3, %31 ]
  %32 = sext i32 %.057 to i64
  %33 = getelementptr inbounds %struct.POINT, ptr %0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = getelementptr inbounds %struct.POINT, ptr %0, i64 %indvars.iv
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = icmp sgt i32 %34, %36
  %38 = trunc nuw nsw i64 %indvars.iv to i32
  %spec.select = select i1 %37, i32 %38, i32 %.057
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %39 = sext i32 %spec.select to i64
  %40 = getelementptr inbounds %struct.POINT, ptr %0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = getelementptr inbounds %struct.POINT, ptr %0, i64 %indvars.iv.next
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = icmp sgt i32 %41, %43
  %45 = trunc nuw nsw i64 %indvars.iv.next to i32
  %spec.select.1 = select i1 %44, i32 %45, i32 %spec.select
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %46 = sext i32 %spec.select.1 to i64
  %47 = getelementptr inbounds %struct.POINT, ptr %0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = getelementptr inbounds %struct.POINT, ptr %0, i64 %indvars.iv.next.1
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = icmp sgt i32 %48, %50
  %52 = trunc nuw nsw i64 %indvars.iv.next.1 to i32
  %spec.select.2 = select i1 %51, i32 %52, i32 %spec.select.1
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %53 = sext i32 %spec.select.2 to i64
  %54 = getelementptr inbounds %struct.POINT, ptr %0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = getelementptr inbounds %struct.POINT, ptr %0, i64 %indvars.iv.next.2
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp sgt i32 %55, %57
  %59 = trunc nuw nsw i64 %indvars.iv.next.2 to i32
  %spec.select.3 = select i1 %58, i32 %59, i32 %spec.select.2
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.unr-lcssa, label %31, !llvm.loop !14

60:                                               ; preds = %.epilog-lcssa
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %72

.preheader:                                       ; preds = %._crit_edge.us
  %62 = call noundef i64 @_ZNKSt6vectorI5POINTSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %.not = icmp eq i64 %62, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %66, %.preheader
  call void @_ZNSt6vectorI5POINTSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  br label %71

.lr.ph:                                           ; preds = %.preheader, %66
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %66 ], [ 0, %.preheader ]
  %63 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5POINTSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv68) #4
  %.sroa.0.0.copyload = load i64, ptr %63, align 4
  invoke void @_Z10printPoint5POINT(i64 %.sroa.0.0.copyload)
          to label %64 unwind label %69

64:                                               ; preds = %.lr.ph
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %66 unwind label %69

66:                                               ; preds = %64
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %67 = call noundef i64 @_ZNKSt6vectorI5POINTSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %68 = icmp ugt i64 %67, %indvars.iv.next69
  br i1 %68, label %.lr.ph, label %._crit_edge, !llvm.loop !15

69:                                               ; preds = %64, %.lr.ph
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %72

71:                                               ; preds = %2, %._crit_edge
  ret void

72:                                               ; preds = %.split.us, %69, %60
  %.pn.pn = phi { ptr, i32 } [ %61, %60 ], [ %70, %69 ], [ %30, %.split.us ]
  call void @_ZNSt6vectorI5POINTSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn.pn
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { 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 0}
!6 = !{!"_ZTS5POINT", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.unroll.disable"}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


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