; LLVM IR from heremaps/tin-terrain :: src/Delaunator.ll (ZN14delaunator_cpp10Delaunator8legalizeElRKSt6vectorIdSaIdEE)

; 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.delaunator_cpp::Delaunator" = type { %"class.std::vector", %"class.std::vector.0", double, double, i64, %"class.std::vector.0", %"class.std::vector.5" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<delaunator_cpp::DelaunatorPoint, std::allocator<delaunator_cpp::DelaunatorPoint>>::_Vector_impl" }
%"struct.std::_Vector_base<delaunator_cpp::DelaunatorPoint, std::allocator<delaunator_cpp::DelaunatorPoint>>::_Vector_impl" = type { %"struct.std::_Vector_base<delaunator_cpp::DelaunatorPoint, std::allocator<delaunator_cpp::DelaunatorPoint>>::_Vector_impl_data" }
%"struct.std::_Vector_base<delaunator_cpp::DelaunatorPoint, std::allocator<delaunator_cpp::DelaunatorPoint>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN14delaunator_cpp10Delaunator8legalizeElRKSt6vectorIdSaIdEE(ptr noundef nonnull align 8 dereferenceable(120) %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #2 align 2 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i8, align 1
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  %21 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %22 = getelementptr inbounds %"class.delaunator_cpp::Delaunator", ptr %21, i32 0, i32 1
  %23 = load i64, ptr %6, align 8, !tbaa !9
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %23) #3
  %25 = load i64, ptr %24, align 8, !tbaa !9
  store i64 %25, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %26 = load i64, ptr %6, align 8, !tbaa !9
  %27 = load i64, ptr %6, align 8, !tbaa !9
  %28 = srem i64 %27, 3
  %29 = sub nsw i64 %26, %28
  store i64 %29, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %30 = load i64, ptr %8, align 8, !tbaa !9
  %31 = load i64, ptr %8, align 8, !tbaa !9
  %32 = srem i64 %31, 3
  %33 = sub nsw i64 %30, %32
  store i64 %33, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %34 = load i64, ptr %9, align 8, !tbaa !9
  %35 = load i64, ptr %6, align 8, !tbaa !9
  %36 = add nsw i64 %35, 1
  %37 = srem i64 %36, 3
  %38 = add nsw i64 %34, %37
  store i64 %38, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %39 = load i64, ptr %9, align 8, !tbaa !9
  %40 = load i64, ptr %6, align 8, !tbaa !9
  %41 = add nsw i64 %40, 2
  %42 = srem i64 %41, 3
  %43 = add nsw i64 %39, %42
  store i64 %43, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %44 = load i64, ptr %10, align 8, !tbaa !9
  %45 = load i64, ptr %8, align 8, !tbaa !9
  %46 = add nsw i64 %45, 2
  %47 = srem i64 %46, 3
  %48 = add nsw i64 %44, %47
  store i64 %48, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %49 = getelementptr inbounds %"class.delaunator_cpp::Delaunator", ptr %21, i32 0, i32 0
  %50 = load i64, ptr %12, align 8, !tbaa !9
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef %50) #3
  %52 = load i64, ptr %51, align 8, !tbaa !9
  store i64 %52, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %53 = getelementptr inbounds %"class.delaunator_cpp::Delaunator", ptr %21, i32 0, i32 0
  %54 = load i64, ptr %6, align 8, !tbaa !9
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %54) #3
  %56 = load i64, ptr %55, align 8, !tbaa !9
  store i64 %56, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %57 = getelementptr inbounds %"class.delaunator_cpp::Delaunator", ptr %21, i32 0, i32 0
  %58 = load i64, ptr %11, align 8, !tbaa !9
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %58) #3
  %60 = load i64, ptr %59, align 8, !tbaa !9
  store i64 %60, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %61 = getelementptr inbounds %"class.delaunator_cpp::Delaunator", ptr %21, i32 0, i32 0
  %62 = load i64, ptr %13, align 8, !tbaa !9
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %62) #3
  %64 = load i64, ptr %63, align 8, !tbaa !9
  store i64 %64, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #3
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = load i64, ptr %14, align 8, !tbaa !9
  %67 = mul nsw i64 2, %66
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %67) #3
  %69 = load double, ptr %68, align 8, !tbaa !11
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = load i64, ptr %14, align 8, !tbaa !9
  %72 = mul nsw i64 2, %71
  %73 = add nsw i64 %72, 1
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef %73) #3
  %75 = load double, ptr %74, align 8, !tbaa !11
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = load i64, ptr %15, align 8, !tbaa !9
  %78 = mul nsw i64 2, %77
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %78) #3
  %80 = load double, ptr %79, align 8, !tbaa !11
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = load i64, ptr %15, align 8, !tbaa !9
  %83 = mul nsw i64 2, %82
  %84 = add nsw i64 %83, 1
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %81, i64 noundef %84) #3
  %86 = load double, ptr %85, align 8, !tbaa !11
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = load i64, ptr %16, align 8, !tbaa !9
  %89 = mul nsw i64 2, %88
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %87, i64 noundef %89) #3
  %91 = load double, ptr %90, align 8, !tbaa !11
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = load i64, ptr %16, align 8, !tbaa !9
  %94 = mul nsw i64 2, %93
  %95 = add nsw i64 %94, 1
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %92, i64 noundef %95) #3
  %97 = load double, ptr %96, align 8, !tbaa !11
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = load i64, ptr %17, align 8, !tbaa !9
  %100 = mul nsw i64 2, %99
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %98, i64 noundef %100) #3
  %102 = load double, ptr %101, align 8, !tbaa !11
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = load i64, ptr %17, align 8, !tbaa !9
  %105 = mul nsw i64 2, %104
  %106 = add nsw i64 %105, 1
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %103, i64 noundef %106) #3
  %108 = load double, ptr %107, align 8, !tbaa !11
  %109 = call noundef zeroext i1 @_ZN14delaunator_cpp12_GLOBAL__N_19in_circleEdddddddd(double noundef %69, double noundef %75, double noundef %80, double noundef %86, double noundef %91, double noundef %97, double noundef %102, double noundef %108)
  %110 = zext i1 %109 to i8
  store i8 %110, ptr %18, align 1, !tbaa !13
  %111 = load i8, ptr %18, align 1, !tbaa !13, !range !15, !noundef !16
  %112 = trunc i8 %111 to i1
  br i1 %112, label %113, label %145

113:                                              ; preds = %3
  %114 = load i64, ptr %17, align 8, !tbaa !9
  %115 = getelementptr inbounds %"class.delaunator_cpp::Delaunator", ptr %21, i32 0, i32 0
  %116 = load i64, ptr %6, align 8, !tbaa !9
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %115, i64 noundef %116) #3
  store i64 %114, ptr %117, align 8, !tbaa !9
  %118 = load i64, ptr %14, align 8, !tbaa !9
  %119 = getelementptr inbounds %"class.delaunator_cpp::Delaunator", ptr %21, i32 0, i32 0
  %120 = load i64, ptr %8, align 8, !tbaa !9
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %119, i64 noundef %120) #3
  store i64 %118, ptr %121, align 8, !tbaa !9
  %122 = load i64, ptr %6, align 8, !tbaa !9
  %123 = getelementptr inbounds %"class.delaunator_cpp::Delaunator", ptr %21, i32 0, i32 1
  %124 = load i64, ptr %13, align 8, !tbaa !9
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %123, i64 noundef %124) #3
  %126 = load i64, ptr %125, align 8, !tbaa !9
  call void @_ZN14delaunator_cpp10Delaunator4linkEll(ptr noundef nonnull align 8 dereferenceable(120) %21, i64 noundef %122, i64 noundef %126)
  %127 = load i64, ptr %8, align 8, !tbaa !9
  %128 = getelementptr inbounds %"class.delaunator_cpp::Delaunator", ptr %21, i32 0, i32 1
  %129 = load i64, ptr %12, align 8, !tbaa !9
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %128, i64 noundef %129) #3
  %131 = load i64, ptr %130, align 8, !tbaa !9
  call void @_ZN14delaunator_cpp10Delaunator4linkEll(ptr noundef nonnull align 8 dereferenceable(120) %21, i64 noundef %127, i64 noundef %131)
  %132 = load i64, ptr %12, align 8, !tbaa !9
  %133 = load i64, ptr %13, align 8, !tbaa !9
  call void @_ZN14delaunator_cpp10Delaunator4linkEll(ptr noundef nonnull align 8 dereferenceable(120) %21, i64 noundef %132, i64 noundef %133)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %134 = load i64, ptr %10, align 8, !tbaa !9
  %135 = load i64, ptr %8, align 8, !tbaa !9
  %136 = add nsw i64 %135, 1
  %137 = srem i64 %136, 3
  %138 = add nsw i64 %134, %137
  store i64 %138, ptr %19, align 8, !tbaa !9
  %139 = load i64, ptr %6, align 8, !tbaa !9
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = call noundef i64 @_ZN14delaunator_cpp10Delaunator8legalizeElRKSt6vectorIdSaIdEE(ptr noundef nonnull align 8 dereferenceable(120) %21, i64 noundef %139, ptr noundef nonnull align 8 dereferenceable(24) %140)
  %142 = load i64, ptr %19, align 8, !tbaa !9
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = call noundef i64 @_ZN14delaunator_cpp10Delaunator8legalizeElRKSt6vectorIdSaIdEE(ptr noundef nonnull align 8 dereferenceable(120) %21, i64 noundef %142, ptr noundef nonnull align 8 dereferenceable(24) %143)
  store i64 %144, ptr %4, align 8
  store i32 1, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  br label %147

145:                                              ; preds = %3
  %146 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %146, ptr %4, align 8
  store i32 1, ptr %20, align 4
  br label %147

147:                                              ; preds = %145, %113
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %148 = load i64, ptr %4, align 8
  ret i64 %148
}

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14delaunator_cpp12_GLOBAL__N_19in_circleEdddddddd(double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}


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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN14delaunator_cpp10Delaunator8legalizeElRKSt6vectorIdSaIdEE(ptr noundef nonnull align 8 dereferenceable(120) %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #1 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  br label %tailrecurse

tailrecurse:                                      ; preds = %53, %3
  %.tr50 = phi i64 [ %1, %3 ], [ %62, %53 ]
  %5 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.tr50) #2
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %7 = srem i64 %.tr50, 3
  %8 = sub nsw i64 %.tr50, %7
  %9 = srem i64 %6, 3
  %10 = sub nsw i64 %6, %9
  %11 = add nsw i64 %.tr50, 1
  %12 = srem i64 %11, 3
  %13 = add nsw i64 %8, %12
  %14 = add nsw i64 %.tr50, 2
  %15 = srem i64 %14, 3
  %16 = add nsw i64 %8, %15
  %17 = add nsw i64 %6, 2
  %18 = srem i64 %17, 3
  %19 = add nsw i64 %10, %18
  %20 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %16) #2
  %21 = load i64, ptr %20, align 8, !tbaa !5
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.tr50) #2
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %13) #2
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %19) #2
  %27 = load i64, ptr %26, align 8, !tbaa !5
  %28 = shl nsw i64 %21, 1
  %29 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %28) #2
  %30 = load double, ptr %29, align 8, !tbaa !9
  %31 = or disjoint i64 %28, 1
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %31) #2
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = shl nsw i64 %23, 1
  %35 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %34) #2
  %36 = load double, ptr %35, align 8, !tbaa !9
  %37 = or disjoint i64 %34, 1
  %38 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %37) #2
  %39 = load double, ptr %38, align 8, !tbaa !9
  %40 = shl nsw i64 %25, 1
  %41 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %40) #2
  %42 = load double, ptr %41, align 8, !tbaa !9
  %43 = or disjoint i64 %40, 1
  %44 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %43) #2
  %45 = load double, ptr %44, align 8, !tbaa !9
  %46 = shl nsw i64 %27, 1
  %47 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %46) #2
  %48 = load double, ptr %47, align 8, !tbaa !9
  %49 = or disjoint i64 %46, 1
  %50 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %49) #2
  %51 = load double, ptr %50, align 8, !tbaa !9
  %52 = tail call noundef zeroext i1 @_ZN14delaunator_cpp12_GLOBAL__N_19in_circleEdddddddd(double noundef %30, double noundef %33, double noundef %36, double noundef %39, double noundef %42, double noundef %45, double noundef %48, double noundef %51)
  br i1 %52, label %53, label %64

53:                                               ; preds = %tailrecurse
  %54 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.tr50) #2
  store i64 %27, ptr %54, align 8, !tbaa !5
  %55 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %6) #2
  store i64 %21, ptr %55, align 8, !tbaa !5
  %56 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %19) #2
  %57 = load i64, ptr %56, align 8, !tbaa !5
  tail call void @_ZN14delaunator_cpp10Delaunator4linkEll(ptr noundef nonnull align 8 dereferenceable(120) %0, i64 noundef %.tr50, i64 noundef %57)
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %16) #2
  %59 = load i64, ptr %58, align 8, !tbaa !5
  tail call void @_ZN14delaunator_cpp10Delaunator4linkEll(ptr noundef nonnull align 8 dereferenceable(120) %0, i64 noundef %6, i64 noundef %59)
  tail call void @_ZN14delaunator_cpp10Delaunator4linkEll(ptr noundef nonnull align 8 dereferenceable(120) %0, i64 noundef %16, i64 noundef %19)
  %60 = add nsw i64 %6, 1
  %61 = srem i64 %60, 3
  %62 = add nsw i64 %10, %61
  %63 = tail call noundef i64 @_ZN14delaunator_cpp10Delaunator8legalizeElRKSt6vectorIdSaIdEE(ptr noundef nonnull align 8 dereferenceable(120) %0, i64 noundef %.tr50, ptr noundef nonnull align 8 dereferenceable(24) %2)
  br label %tailrecurse

64:                                               ; preds = %tailrecurse
  ret i64 %16
}

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14delaunator_cpp12_GLOBAL__N_19in_circleEdddddddd(double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14delaunator_cpp10Delaunator4linkEll(ptr noundef nonnull align 8 dereferenceable(120), i64 noundef, i64 noundef) local_unnamed_addr #1 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 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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass