; LLVM IR from yangfengzzz/Arche-webgpu :: vox.geometry (point_hash_grid_searcher2)

; 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.vox::Vector" = type { double, double }
%"class.vox::PointHashGridSearcher2" = type { %"class.vox::PointNeighborSearcher2", double, %"struct.vox::Point", %"class.std::vector", %"class.std::vector.0" }
%"class.vox::PointNeighborSearcher2" = type { ptr }
%"struct.vox::Point" = type { i64, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<vox::Point<double, 2>, std::allocator<vox::Point<double, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<vox::Point<double, 2>, std::allocator<vox::Point<double, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<vox::Point<double, 2>, std::allocator<vox::Point<double, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vox::Point<double, 2>, std::allocator<vox::Point<double, 2>>>::_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<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3vox22PointHashGridSearcher218forEachNearbyPointERKNS_5PointIdLm2EEEdRKSt8functionIFvmS4_EE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, double noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3) unnamed_addr #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [4 x i64], align 16
  %10 = alloca double, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca double, align 8
  %21 = alloca %"struct.vox::Vector", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store double %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8
  %23 = getelementptr inbounds %"class.vox::PointHashGridSearcher2", ptr %22, i32 0, i32 4
  %24 = call noundef zeroext i1 @_ZNKSt6vectorIS_ImSaImEESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #3
  br i1 %24, label %25, label %26

25:                                               ; preds = %4
  br label %83

26:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #3
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds [4 x i64], ptr %9, i64 0, i64 0
  call void @_ZNK3vox22PointHashGridSearcher213getNearbyKeysERKNS_5PointIdLm2EEEPm(ptr noundef nonnull align 8 dereferenceable(80) %22, ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef %28)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %29 = load double, ptr %7, align 8, !tbaa !9
  %30 = load double, ptr %7, align 8, !tbaa !9
  %31 = fmul double %29, %30
  store double %31, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  store ptr %9, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = getelementptr inbounds [4 x i64], ptr %32, i64 0, i64 0
  store ptr %33, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  %35 = getelementptr inbounds [4 x i64], ptr %34, i64 0, i64 0
  %36 = getelementptr inbounds i64, ptr %35, i64 4
  store ptr %36, ptr %13, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %79, %26
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = load ptr, ptr %13, align 8, !tbaa !5
  %40 = icmp ne ptr %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 2, ptr %14, align 4
  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
  br label %82

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = load i64, ptr %43, align 8, !tbaa !11
  store i64 %44, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %45 = getelementptr inbounds %"class.vox::PointHashGridSearcher2", ptr %22, i32 0, i32 4
  %46 = load i64, ptr %15, align 8, !tbaa !11
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_ImSaImEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %46) #3
  store ptr %47, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %48 = load ptr, ptr %16, align 8, !tbaa !5
  %49 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #3
  store i64 %49, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  store i64 0, ptr %18, align 8, !tbaa !11
  br label %50

50:                                               ; preds = %75, %42
  %51 = load i64, ptr %18, align 8, !tbaa !11
  %52 = load i64, ptr %17, align 8, !tbaa !11
  %53 = icmp ult i64 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 4, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  br label %78

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %56 = load ptr, ptr %16, align 8, !tbaa !5
  %57 = load i64, ptr %18, align 8, !tbaa !11
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %57) #3
  %59 = load i64, ptr %58, align 8, !tbaa !11
  store i64 %59, ptr %19, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #3
  %60 = getelementptr inbounds %"class.vox::PointHashGridSearcher2", ptr %22, i32 0, i32 3
  %61 = load i64, ptr %19, align 8, !tbaa !11
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3vox5PointIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %61) #3
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3voxmiIdEENS_6VectorIT_Lm2EEERKNS_5PointIS2_Lm2EEES7_(ptr dead_on_unwind writable sret(%"struct.vox::Vector") align 8 %21, ptr noundef nonnull align 8 dereferenceable(16) %62, ptr noundef nonnull align 8 dereferenceable(16) %63)
  %64 = call noundef double @_ZNK3vox6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %21)
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #3
  store double %64, ptr %20, align 8, !tbaa !9
  %65 = load double, ptr %20, align 8, !tbaa !9
  %66 = load double, ptr %10, align 8, !tbaa !9
  %67 = fcmp ole double %65, %66
  br i1 %67, label %68, label %74

68:                                               ; preds = %55
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = load i64, ptr %19, align 8, !tbaa !11
  %71 = getelementptr inbounds %"class.vox::PointHashGridSearcher2", ptr %22, i32 0, i32 3
  %72 = load i64, ptr %19, align 8, !tbaa !11
  %73 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3vox5PointIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef %72) #3
  call void @_ZNKSt8functionIFvmRKN3vox5PointIdLm2EEEEEclEmS4_(ptr noundef nonnull align 8 dereferenceable(32) %69, i64 noundef %70, ptr noundef nonnull align 8 dereferenceable(16) %73)
  br label %74

74:                                               ; preds = %68, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  br label %75

75:                                               ; preds = %74
  %76 = load i64, ptr %18, align 8, !tbaa !11
  %77 = add i64 %76, 1
  store i64 %77, ptr %18, align 8, !tbaa !11
  br label %50, !llvm.loop !13

78:                                               ; preds = %54
  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
  br label %79

79:                                               ; preds = %78
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  %81 = getelementptr inbounds i64, ptr %80, i32 1
  store ptr %81, ptr %12, align 8, !tbaa !5
  br label %37

82:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #3
  br label %83

83:                                               ; preds = %82, %25
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3vox22PointHashGridSearcher213getNearbyKeysERKNS_5PointIdLm2EEEPm(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3voxmiIdEENS_6VectorIT_Lm2EEERKNS_5PointIS2_Lm2EEES7_(ptr dead_on_unwind noalias writable sret(%"struct.vox::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFvmRKN3vox5PointIdLm2EEEEEclEmS4_(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

attributes #0 = { 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 = !{!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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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.vox::Vector" = type { double, double }

; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3vox22PointHashGridSearcher218forEachNearbyPointERKNS_5PointIdLm2EEEdRKSt8functionIFvmS4_EE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, double noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3) unnamed_addr #1 align 2 {
  %5 = alloca [4 x i64], align 16
  %6 = alloca %"struct.vox::Vector", align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 56
  %8 = tail call noundef zeroext i1 @_ZNKSt6vectorIS_ImSaImEESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  br i1 %8, label %60, label %9

9:                                                ; preds = %4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  call void @_ZNK3vox22PointHashGridSearcher213getNearbyKeysERKNS_5PointIdLm2EEEPm(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %5)
  %10 = fmul double %2, %2
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = load i64, ptr %5, align 16, !tbaa !5
  %13 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_ImSaImEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %12) #3
  %14 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #3
  %.not26 = icmp eq i64 %14, 0
  br i1 %.not26, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %58, %9
  %.0.ptr.1 = getelementptr inbounds i8, ptr %5, i64 8
  %15 = load i64, ptr %.0.ptr.1, align 8, !tbaa !5
  %16 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_ImSaImEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %15) #3
  %17 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #3
  %.not26.1 = icmp eq i64 %17, 0
  br i1 %.not26.1, label %._crit_edge.1, label %.lr.ph.1

.lr.ph.1:                                         ; preds = %._crit_edge, %25
  %.02324.1 = phi i64 [ %26, %25 ], [ 0, %._crit_edge ]
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %.02324.1) #3
  %19 = load i64, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3vox5PointIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %19) #3
  call void @_ZN3voxmiIdEENS_6VectorIT_Lm2EEERKNS_5PointIS2_Lm2EEES7_(ptr dead_on_unwind nonnull writable sret(%"struct.vox::Vector") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %1)
  %21 = call noundef double @_ZNK3vox6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %22 = fcmp ugt double %21, %10
  br i1 %22, label %25, label %23

23:                                               ; preds = %.lr.ph.1
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3vox5PointIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %19) #3
  call void @_ZNKSt8functionIFvmRKN3vox5PointIdLm2EEEEEclEmS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %19, ptr noundef nonnull align 8 dereferenceable(16) %24)
  br label %25

25:                                               ; preds = %23, %.lr.ph.1
  %26 = add nuw i64 %.02324.1, 1
  %exitcond.1.not = icmp eq i64 %26, %17
  br i1 %exitcond.1.not, label %._crit_edge.1, label %.lr.ph.1, !llvm.loop !9

._crit_edge.1:                                    ; preds = %25, %._crit_edge
  %.0.ptr.2 = getelementptr inbounds i8, ptr %5, i64 16
  %27 = load i64, ptr %.0.ptr.2, align 16, !tbaa !5
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_ImSaImEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %27) #3
  %29 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #3
  %.not26.2 = icmp eq i64 %29, 0
  br i1 %.not26.2, label %._crit_edge.2, label %.lr.ph.2

.lr.ph.2:                                         ; preds = %._crit_edge.1, %37
  %.02324.2 = phi i64 [ %38, %37 ], [ 0, %._crit_edge.1 ]
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %.02324.2) #3
  %31 = load i64, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3vox5PointIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %31) #3
  call void @_ZN3voxmiIdEENS_6VectorIT_Lm2EEERKNS_5PointIS2_Lm2EEES7_(ptr dead_on_unwind nonnull writable sret(%"struct.vox::Vector") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 8 dereferenceable(16) %1)
  %33 = call noundef double @_ZNK3vox6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %34 = fcmp ugt double %33, %10
  br i1 %34, label %37, label %35

35:                                               ; preds = %.lr.ph.2
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3vox5PointIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %31) #3
  call void @_ZNKSt8functionIFvmRKN3vox5PointIdLm2EEEEEclEmS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %31, ptr noundef nonnull align 8 dereferenceable(16) %36)
  br label %37

37:                                               ; preds = %35, %.lr.ph.2
  %38 = add nuw i64 %.02324.2, 1
  %exitcond.2.not = icmp eq i64 %38, %29
  br i1 %exitcond.2.not, label %._crit_edge.2, label %.lr.ph.2, !llvm.loop !9

._crit_edge.2:                                    ; preds = %37, %._crit_edge.1
  %.0.ptr.3 = getelementptr inbounds i8, ptr %5, i64 24
  %39 = load i64, ptr %.0.ptr.3, align 8, !tbaa !5
  %40 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_ImSaImEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %39) #3
  %41 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #3
  %.not26.3 = icmp eq i64 %41, 0
  br i1 %.not26.3, label %._crit_edge.3, label %.lr.ph.3

.lr.ph.3:                                         ; preds = %._crit_edge.2, %49
  %.02324.3 = phi i64 [ %50, %49 ], [ 0, %._crit_edge.2 ]
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %.02324.3) #3
  %43 = load i64, ptr %42, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3vox5PointIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %43) #3
  call void @_ZN3voxmiIdEENS_6VectorIT_Lm2EEERKNS_5PointIS2_Lm2EEES7_(ptr dead_on_unwind nonnull writable sret(%"struct.vox::Vector") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 8 dereferenceable(16) %1)
  %45 = call noundef double @_ZNK3vox6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %46 = fcmp ugt double %45, %10
  br i1 %46, label %49, label %47

47:                                               ; preds = %.lr.ph.3
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3vox5PointIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %43) #3
  call void @_ZNKSt8functionIFvmRKN3vox5PointIdLm2EEEEEclEmS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %43, ptr noundef nonnull align 8 dereferenceable(16) %48)
  br label %49

49:                                               ; preds = %47, %.lr.ph.3
  %50 = add nuw i64 %.02324.3, 1
  %exitcond.3.not = icmp eq i64 %50, %41
  br i1 %exitcond.3.not, label %._crit_edge.3, label %.lr.ph.3, !llvm.loop !9

._crit_edge.3:                                    ; preds = %49, %._crit_edge.2
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  br label %60

.lr.ph:                                           ; preds = %9, %58
  %.02324 = phi i64 [ %59, %58 ], [ 0, %9 ]
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %.02324) #3
  %52 = load i64, ptr %51, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3vox5PointIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %52) #3
  call void @_ZN3voxmiIdEENS_6VectorIT_Lm2EEERKNS_5PointIS2_Lm2EEES7_(ptr dead_on_unwind nonnull writable sret(%"struct.vox::Vector") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %53, ptr noundef nonnull align 8 dereferenceable(16) %1)
  %54 = call noundef double @_ZNK3vox6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %55 = fcmp ugt double %54, %10
  br i1 %55, label %58, label %56

56:                                               ; preds = %.lr.ph
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3vox5PointIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %52) #3
  call void @_ZNKSt8functionIFvmRKN3vox5PointIdLm2EEEEEclEmS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %52, ptr noundef nonnull align 8 dereferenceable(16) %57)
  br label %58

58:                                               ; preds = %56, %.lr.ph
  %59 = add nuw i64 %.02324, 1
  %exitcond.not = icmp eq i64 %59, %14
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

60:                                               ; preds = %4, %._crit_edge.3
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3vox22PointHashGridSearcher213getNearbyKeysERKNS_5PointIdLm2EEEPm(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3voxmiIdEENS_6VectorIT_Lm2EEERKNS_5PointIS2_Lm2EEES7_(ptr dead_on_unwind noalias writable sret(%"struct.vox::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

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

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

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

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 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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