; LLVM IR from bqi343/cp-notebook :: Implementations/content/geometry (13)/Polygons (LineHullTest)

; 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<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::array" = type { [2 x %"struct.std::pair"] }
%"struct.std::pair" = type { i64, i64 }

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

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

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) #1

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnIxEiT_(i64 noundef) #3

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

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

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

30:                                               ; preds = %64, %3
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5arrayISt4pairIxxELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 0) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %36, i64 16, i1 false)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5arrayISt4pairIxxELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 1) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %37, i64 16, i1 false)
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load i32, ptr %9, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %40) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %41, i64 16, i1 false)
  %42 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 0
  %43 = load i64, ptr %42, align 8
  %44 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 1
  %45 = load i64, ptr %44, align 8
  %46 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 0
  %47 = load i64, ptr %46, align 8
  %48 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 1
  %49 = load i64, ptr %48, align 8
  %50 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %51 = load i64, ptr %50, align 8
  %52 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %53 = load i64, ptr %52, align 8
  %54 = call noundef i64 @_ZN5Point5crossESt4pairIxxES1_S1_(i64 %43, i64 %45, i64 %47, i64 %49, i64 %51, i64 %53)
  %55 = call noundef i32 @_Z3sgnIxEiT_(i64 noundef %54)
  store i32 %55, ptr %10, align 4, !tbaa !9
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %35
  store i8 1, ptr %7, align 1, !tbaa !11
  br label %59

59:                                               ; preds = %58, %35
  %60 = load i32, ptr %10, align 4, !tbaa !9
  %61 = icmp slt i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %59
  store i8 1, ptr %8, align 1, !tbaa !11
  br label %63

63:                                               ; preds = %62, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %64

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

67:                                               ; preds = %34
  store i1 false, ptr %14, align 1
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  %68 = load i8, ptr %7, align 1, !tbaa !11, !range !15, !noundef !16
  %69 = trunc i8 %68 to i1
  br i1 %69, label %70, label %73

70:                                               ; preds = %67
  %71 = load i8, ptr %8, align 1, !tbaa !11, !range !15, !noundef !16
  %72 = trunc i8 %71 to i1
  br i1 %72, label %115, label %73

73:                                               ; preds = %70, %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %111, %73
  %75 = load i32, ptr %15, align 4, !tbaa !9
  %76 = load i32, ptr %6, align 4, !tbaa !9
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %114

79:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %80 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5arrayISt4pairIxxELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 0) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %80, i64 16, i1 false)
  %81 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5arrayISt4pairIxxELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 1) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %81, i64 16, i1 false)
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = load i32, ptr %15, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %84) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %85, i64 16, i1 false)
  %86 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 0
  %87 = load i64, ptr %86, align 8
  %88 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 1
  %89 = load i64, ptr %88, align 8
  %90 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %91 = load i64, ptr %90, align 8
  %92 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %93 = load i64, ptr %92, align 8
  %94 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %95 = load i64, ptr %94, align 8
  %96 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %97 = load i64, ptr %96, align 8
  %98 = invoke noundef i64 @_ZN5Point5crossESt4pairIxxES1_S1_(i64 %87, i64 %89, i64 %91, i64 %93, i64 %95, i64 %97)
          to label %99 unwind label %106

99:                                               ; preds = %79
  %100 = invoke noundef i32 @_Z3sgnIxEiT_(i64 noundef %98)
          to label %101 unwind label %106

101:                                              ; preds = %99
  store i32 %100, ptr %16, align 4, !tbaa !9
  %102 = load i32, ptr %16, align 4, !tbaa !9
  %103 = icmp eq i32 %102, 0
  br i1 %103, label %104, label %110

104:                                              ; preds = %101
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %105 unwind label %106

105:                                              ; preds = %104
  br label %110

106:                                              ; preds = %104, %99, %79
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %20, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %161

110:                                              ; preds = %105, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %15, align 4, !tbaa !9
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %15, align 4, !tbaa !9
  br label %74, !llvm.loop !17

114:                                              ; preds = %78
  br label %157

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

116:                                              ; preds = %153, %115
  %117 = load i32, ptr %22, align 4, !tbaa !9
  %118 = load i32, ptr %6, align 4, !tbaa !9
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %156

121:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %122 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5arrayISt4pairIxxELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 0) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %122, i64 16, i1 false)
  %123 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5arrayISt4pairIxxELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 1) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %123, i64 16, i1 false)
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = load i32, ptr %22, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %124, i64 noundef %126) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %127, i64 16, i1 false)
  %128 = getelementptr inbounds { i64, i64 }, ptr %24, i32 0, i32 0
  %129 = load i64, ptr %128, align 8
  %130 = getelementptr inbounds { i64, i64 }, ptr %24, i32 0, i32 1
  %131 = load i64, ptr %130, align 8
  %132 = getelementptr inbounds { i64, i64 }, ptr %25, i32 0, i32 0
  %133 = load i64, ptr %132, align 8
  %134 = getelementptr inbounds { i64, i64 }, ptr %25, i32 0, i32 1
  %135 = load i64, ptr %134, align 8
  %136 = getelementptr inbounds { i64, i64 }, ptr %26, i32 0, i32 0
  %137 = load i64, ptr %136, align 8
  %138 = getelementptr inbounds { i64, i64 }, ptr %26, i32 0, i32 1
  %139 = load i64, ptr %138, align 8
  %140 = invoke noundef i64 @_ZN5Point5crossESt4pairIxxES1_S1_(i64 %129, i64 %131, i64 %133, i64 %135, i64 %137, i64 %139)
          to label %141 unwind label %148

141:                                              ; preds = %121
  %142 = invoke noundef i32 @_Z3sgnIxEiT_(i64 noundef %140)
          to label %143 unwind label %148

143:                                              ; preds = %141
  store i32 %142, ptr %23, align 4, !tbaa !9
  %144 = load i32, ptr %23, align 4, !tbaa !9
  %145 = icmp sle i32 %144, 0
  br i1 %145, label %146, label %152

146:                                              ; preds = %143
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %147 unwind label %148

147:                                              ; preds = %146
  br label %152

148:                                              ; preds = %146, %141, %121
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %20, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %161

152:                                              ; preds = %147, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %22, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %22, align 4, !tbaa !9
  br label %116, !llvm.loop !18

156:                                              ; preds = %120
  br label %157

157:                                              ; preds = %156, %114
  store i1 true, ptr %14, align 1
  %158 = load i1, ptr %14, align 1
  br i1 %158, label %160, label %159

159:                                              ; preds = %157
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %160

160:                                              ; preds = %159, %157
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  ret void

161:                                              ; preds = %148, %106
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %162

162:                                              ; preds = %161
  %163 = load ptr, ptr %20, align 8
  %164 = load i32, ptr %21, align 4
  %165 = insertvalue { ptr, i32 } poison, ptr %163, 0
  %166 = insertvalue { ptr, i32 } %165, i32 %164, 1
  resume { ptr, i32 } %166
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree 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 = { 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 = { 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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{i8 0, i8 2}
!16 = !{}
!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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::array" = type { [2 x %"struct.std::pair"] }
%"struct.std::pair" = type { i64, i64 }

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN5Point5crossESt4pairIxxES1_S1_(i64, i64, i64, i64, i64, i64) local_unnamed_addr #1

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5naiveSt5arrayISt4pairIxxELm2EERSt6vectorIS1_SaIS1_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef byval(%"struct.std::array") align 8 %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = tail call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %7 = trunc i64 %6 to i32
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph.preheader, label %.thread

.thread:                                          ; preds = %3
  tail call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  br label %._crit_edge51

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = and i64 %6, 2147483647
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %9 = select i1 %spec.select, i1 %.135, i1 false
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  br i1 %9, label %34, label %17

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.044 = phi i1 [ false, %.lr.ph.preheader ], [ %spec.select, %.lr.ph ]
  %.03443 = phi i1 [ false, %.lr.ph.preheader ], [ %.135, %.lr.ph ]
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5arrayISt4pairIxxELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 0) #3
  %.sroa.018.0.copyload = load i64, ptr %10, align 8
  %.sroa.219.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  %.sroa.219.0.copyload = load i64, ptr %.sroa.219.0..sroa_idx, align 8
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5arrayISt4pairIxxELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 1) #3
  %.sroa.016.0.copyload = load i64, ptr %11, align 8
  %.sroa.217.0..sroa_idx = getelementptr inbounds i8, ptr %11, i64 8
  %.sroa.217.0.copyload = load i64, ptr %.sroa.217.0..sroa_idx, align 8
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #3
  %.sroa.014.0.copyload = load i64, ptr %12, align 8
  %.sroa.215.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 8
  %.sroa.215.0.copyload = load i64, ptr %.sroa.215.0..sroa_idx, align 8
  %13 = call noundef i64 @_ZN5Point5crossESt4pairIxxES1_S1_(i64 %.sroa.018.0.copyload, i64 %.sroa.219.0.copyload, i64 %.sroa.016.0.copyload, i64 %.sroa.217.0.copyload, i64 %.sroa.014.0.copyload, i64 %.sroa.215.0.copyload)
  %14 = call noundef i32 @_Z3sgnIxEiT_(i64 noundef %13)
  %15 = icmp sgt i32 %14, 0
  %spec.select = select i1 %15, i1 true, i1 %.044
  %16 = icmp slt i32 %14, 0
  %.135 = select i1 %16, i1 true, i1 %.03443
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

17:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  store i32 0, ptr %4, align 4, !tbaa !7
  br i1 %8, label %.lr.ph50, label %._crit_edge51

._crit_edge51:                                    ; preds = %30, %.thread, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  br label %51

.lr.ph50:                                         ; preds = %17, %30
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5arrayISt4pairIxxELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 0) #3
  %.sroa.010.0.copyload = load i64, ptr %18, align 8
  %.sroa.211.0..sroa_idx = getelementptr inbounds i8, ptr %18, i64 8
  %.sroa.211.0.copyload = load i64, ptr %.sroa.211.0..sroa_idx, align 8
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5arrayISt4pairIxxELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 1) #3
  %.sroa.08.0.copyload = load i64, ptr %19, align 8
  %.sroa.29.0..sroa_idx = getelementptr inbounds i8, ptr %19, i64 8
  %.sroa.29.0.copyload = load i64, ptr %.sroa.29.0..sroa_idx, align 8
  %20 = load i32, ptr %4, align 4, !tbaa !7
  %21 = sext i32 %20 to i64
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %21) #3
  %.sroa.06.0.copyload = load i64, ptr %22, align 8
  %.sroa.27.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 8
  %.sroa.27.0.copyload = load i64, ptr %.sroa.27.0..sroa_idx, align 8
  %23 = invoke noundef i64 @_ZN5Point5crossESt4pairIxxES1_S1_(i64 %.sroa.010.0.copyload, i64 %.sroa.211.0.copyload, i64 %.sroa.08.0.copyload, i64 %.sroa.29.0.copyload, i64 %.sroa.06.0.copyload, i64 %.sroa.27.0.copyload)
          to label %24 unwind label %28

24:                                               ; preds = %.lr.ph50
  %25 = call noundef i32 @_Z3sgnIxEiT_(i64 noundef %23)
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %30

27:                                               ; preds = %24
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %30 unwind label %28

28:                                               ; preds = %27, %.lr.ph50
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  br label %52

30:                                               ; preds = %27, %24
  %31 = load i32, ptr %4, align 4, !tbaa !7
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %4, align 4, !tbaa !7
  %33 = icmp slt i32 %32, %7
  br i1 %33, label %.lr.ph50, label %._crit_edge51, !llvm.loop !11

34:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  store i32 0, ptr %5, align 4, !tbaa !7
  br i1 %8, label %.lr.ph47, label %._crit_edge48

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

.lr.ph47:                                         ; preds = %34, %47
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5arrayISt4pairIxxELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 0) #3
  %.sroa.03.0.copyload = load i64, ptr %35, align 8
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 8
  %.sroa.24.0.copyload = load i64, ptr %.sroa.24.0..sroa_idx, align 8
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5arrayISt4pairIxxELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 1) #3
  %.sroa.01.0.copyload = load i64, ptr %36, align 8
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %36, i64 8
  %.sroa.22.0.copyload = load i64, ptr %.sroa.22.0..sroa_idx, align 8
  %37 = load i32, ptr %5, align 4, !tbaa !7
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %38) #3
  %.sroa.0.0.copyload = load i64, ptr %39, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %39, i64 8
  %.sroa.2.0.copyload = load i64, ptr %.sroa.2.0..sroa_idx, align 8
  %40 = invoke noundef i64 @_ZN5Point5crossESt4pairIxxES1_S1_(i64 %.sroa.03.0.copyload, i64 %.sroa.24.0.copyload, i64 %.sroa.01.0.copyload, i64 %.sroa.22.0.copyload, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload)
          to label %41 unwind label %45

41:                                               ; preds = %.lr.ph47
  %42 = call noundef i32 @_Z3sgnIxEiT_(i64 noundef %40)
  %43 = icmp slt i32 %42, 1
  br i1 %43, label %44, label %47

44:                                               ; preds = %41
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %47 unwind label %45

45:                                               ; preds = %44, %.lr.ph47
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  br label %52

47:                                               ; preds = %44, %41
  %48 = load i32, ptr %5, align 4, !tbaa !7
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %5, align 4, !tbaa !7
  %50 = icmp slt i32 %49, %7
  br i1 %50, label %.lr.ph47, label %._crit_edge48, !llvm.loop !12

51:                                               ; preds = %._crit_edge51, %._crit_edge48
  ret void

52:                                               ; preds = %45, %28
  %.pn = phi { ptr, i32 } [ %46, %45 ], [ %29, %28 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  resume { ptr, i32 } %.pn
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}


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