; LLVM IR from doyubkim/fluid-engine-dev :: src/jet (point_parallel_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"

%"class.jet::Vector" = type { double, double }
%"class.jet::PointParallelHashGridSearcher2" = type { %"class.jet::PointNeighborSearcher2", double, %"class.jet::Point", %"class.std::vector", %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0" }
%"class.jet::PointNeighborSearcher2" = type { %"class.jet::Serializable" }
%"class.jet::Serializable" = type { ptr }
%"class.jet::Point" = type { i64, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<jet::Vector<double, 2>, std::allocator<jet::Vector<double, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<jet::Vector<double, 2>, std::allocator<jet::Vector<double, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<jet::Vector<double, 2>, std::allocator<jet::Vector<double, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<jet::Vector<double, 2>, std::allocator<jet::Vector<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<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 }

; 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 @_ZNK3jet30PointParallelHashGridSearcher218forEachNearbyPointERKNS_6VectorIdLm2EEEdRKSt8functionIFvmS4_EE(ptr noundef nonnull align 8 dereferenceable(152) %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 i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca %"class.jet::Vector", align 8
  %18 = alloca double, 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
  %19 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #3
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds [4 x i64], ptr %9, i64 0, i64 0
  call void @_ZNK3jet30PointParallelHashGridSearcher213getNearbyKeysERKNS_6VectorIdLm2EEEPm(ptr noundef nonnull align 8 dereferenceable(152) %19, ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef %21)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %22 = load double, ptr %7, align 8, !tbaa !9
  %23 = load double, ptr %7, align 8, !tbaa !9
  %24 = fmul double %22, %23
  store double %24, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %25

25:                                               ; preds = %78, %4
  %26 = load i32, ptr %11, align 4, !tbaa !11
  %27 = icmp slt i32 %26, 4
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %81

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %30 = load i32, ptr %11, align 4, !tbaa !11
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [4 x i64], ptr %9, i64 0, i64 %31
  %33 = load i64, ptr %32, align 8, !tbaa !13
  store i64 %33, ptr %13, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %34 = getelementptr inbounds %"class.jet::PointParallelHashGridSearcher2", ptr %19, i32 0, i32 5
  %35 = load i64, ptr %13, align 8, !tbaa !13
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %35) #3
  %37 = load i64, ptr %36, align 8, !tbaa !13
  store i64 %37, ptr %14, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %38 = getelementptr inbounds %"class.jet::PointParallelHashGridSearcher2", ptr %19, i32 0, i32 6
  %39 = load i64, ptr %13, align 8, !tbaa !13
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %39) #3
  %41 = load i64, ptr %40, align 8, !tbaa !13
  store i64 %41, ptr %15, align 8, !tbaa !13
  %42 = load i64, ptr %14, align 8, !tbaa !13
  %43 = icmp eq i64 %42, -1
  br i1 %43, label %44, label %45

44:                                               ; preds = %29
  store i32 4, ptr %12, align 4
  br label %75

45:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %46 = load i64, ptr %14, align 8, !tbaa !13
  store i64 %46, ptr %16, align 8, !tbaa !13
  br label %47

47:                                               ; preds = %71, %45
  %48 = load i64, ptr %16, align 8, !tbaa !13
  %49 = load i64, ptr %15, align 8, !tbaa !13
  %50 = icmp ult i64 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  br label %74

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #3
  %53 = getelementptr inbounds %"class.jet::PointParallelHashGridSearcher2", ptr %19, i32 0, i32 3
  %54 = load i64, ptr %16, align 8, !tbaa !13
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3jet6VectorIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %54) #3
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3jetmiIdEENS_6VectorIT_Lm2EEERKS3_S5_(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %17, ptr noundef nonnull align 8 dereferenceable(16) %55, ptr noundef nonnull align 8 dereferenceable(16) %56)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %57 = call noundef double @_ZNK3jet6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
  store double %57, ptr %18, align 8, !tbaa !9
  %58 = load double, ptr %18, align 8, !tbaa !9
  %59 = load double, ptr %10, align 8, !tbaa !9
  %60 = fcmp ole double %58, %59
  br i1 %60, label %61, label %70

61:                                               ; preds = %52
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = getelementptr inbounds %"class.jet::PointParallelHashGridSearcher2", ptr %19, i32 0, i32 7
  %64 = load i64, ptr %16, align 8, !tbaa !13
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %63, i64 noundef %64) #3
  %66 = load i64, ptr %65, align 8, !tbaa !13
  %67 = getelementptr inbounds %"class.jet::PointParallelHashGridSearcher2", ptr %19, i32 0, i32 3
  %68 = load i64, ptr %16, align 8, !tbaa !13
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3jet6VectorIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %67, i64 noundef %68) #3
  call void @_ZNKSt8functionIFvmRKN3jet6VectorIdLm2EEEEEclEmS4_(ptr noundef nonnull align 8 dereferenceable(32) %62, i64 noundef %66, ptr noundef nonnull align 8 dereferenceable(16) %69)
  br label %70

70:                                               ; preds = %61, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #3
  br label %71

71:                                               ; preds = %70
  %72 = load i64, ptr %16, align 8, !tbaa !13
  %73 = add i64 %72, 1
  store i64 %73, ptr %16, align 8, !tbaa !13
  br label %47, !llvm.loop !15

74:                                               ; preds = %51
  store i32 0, ptr %12, align 4
  br label %75

75:                                               ; preds = %74, %44
  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
  %76 = load i32, ptr %12, align 4
  switch i32 %76, label %82 [
    i32 0, label %77
    i32 4, label %78
  ]

77:                                               ; preds = %75
  br label %78

78:                                               ; preds = %77, %75
  %79 = load i32, ptr %11, align 4, !tbaa !11
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %11, align 4, !tbaa !11
  br label %25, !llvm.loop !17

81:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #3
  ret void

82:                                               ; preds = %75
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3jet30PointParallelHashGridSearcher213getNearbyKeysERKNS_6VectorIdLm2EEEPm(ptr noundef nonnull align 8 dereferenceable(152), 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(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3jetmiIdEENS_6VectorIT_Lm2EEERKS3_S5_(ptr dead_on_unwind noalias writable sret(%"class.jet::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 @_ZNKSt6vectorIN3jet6VectorIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFvmRKN3jet6VectorIdLm2EEEEEclEmS4_(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 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !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"

%"class.jet::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 @_ZNK3jet30PointParallelHashGridSearcher218forEachNearbyPointERKNS_6VectorIdLm2EEEdRKSt8functionIFvmS4_EE(ptr noundef nonnull align 8 dereferenceable(152) %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 %"class.jet::Vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  call void @_ZNK3jet30PointParallelHashGridSearcher213getNearbyKeysERKNS_6VectorIdLm2EEEPm(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %5)
  %7 = fmul double %2, %2
  %8 = getelementptr inbounds i8, ptr %0, i64 80
  %9 = getelementptr inbounds i8, ptr %0, i64 104
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  %11 = getelementptr inbounds i8, ptr %0, i64 128
  %12 = load i64, ptr %5, align 16, !tbaa !5
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %12) #3
  %14 = load i64, ptr %13, align 8, !tbaa !5
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %12) #3
  %16 = load i64, ptr %15, align 8, !tbaa !5
  %17 = icmp ne i64 %14, -1
  %18 = icmp ult i64 %14, %16
  %or.cond = select i1 %17, i1 %18, i1 false
  br i1 %or.cond, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %4, %26
  %.02022 = phi i64 [ %27, %26 ], [ %14, %4 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3jet6VectorIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.02022) #3
  call void @_ZN3jetmiIdEENS_6VectorIT_Lm2EEERKS3_S5_(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(16) %1)
  %20 = call noundef double @_ZNK3jet6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %21 = fcmp ugt double %20, %7
  br i1 %21, label %26, label %22

22:                                               ; preds = %.lr.ph
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %.02022) #3
  %24 = load i64, ptr %23, align 8, !tbaa !5
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3jet6VectorIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.02022) #3
  call void @_ZNKSt8functionIFvmRKN3jet6VectorIdLm2EEEEEclEmS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %24, ptr noundef nonnull align 8 dereferenceable(16) %25)
  br label %26

26:                                               ; preds = %22, %.lr.ph
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %27 = add i64 %.02022, 1
  %exitcond.not = icmp eq i64 %27, %16
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !9

.loopexit:                                        ; preds = %26, %4
  %28 = getelementptr inbounds i8, ptr %5, i64 8
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %29) #3
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %29) #3
  %33 = load i64, ptr %32, align 8, !tbaa !5
  %34 = icmp ne i64 %31, -1
  %35 = icmp ult i64 %31, %33
  %or.cond.1 = select i1 %34, i1 %35, i1 false
  br i1 %or.cond.1, label %.lr.ph.1, label %.loopexit.1

.lr.ph.1:                                         ; preds = %.loopexit, %43
  %.02022.1 = phi i64 [ %44, %43 ], [ %31, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3jet6VectorIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.02022.1) #3
  call void @_ZN3jetmiIdEENS_6VectorIT_Lm2EEERKS3_S5_(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(16) %1)
  %37 = call noundef double @_ZNK3jet6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %38 = fcmp ugt double %37, %7
  br i1 %38, label %43, label %39

39:                                               ; preds = %.lr.ph.1
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %.02022.1) #3
  %41 = load i64, ptr %40, align 8, !tbaa !5
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3jet6VectorIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.02022.1) #3
  call void @_ZNKSt8functionIFvmRKN3jet6VectorIdLm2EEEEEclEmS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %41, ptr noundef nonnull align 8 dereferenceable(16) %42)
  br label %43

43:                                               ; preds = %39, %.lr.ph.1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %44 = add i64 %.02022.1, 1
  %exitcond.1.not = icmp eq i64 %44, %33
  br i1 %exitcond.1.not, label %.loopexit.1, label %.lr.ph.1, !llvm.loop !9

.loopexit.1:                                      ; preds = %43, %.loopexit
  %45 = getelementptr inbounds i8, ptr %5, i64 16
  %46 = load i64, ptr %45, align 16, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %46) #3
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %46) #3
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = icmp ne i64 %48, -1
  %52 = icmp ult i64 %48, %50
  %or.cond.2 = select i1 %51, i1 %52, i1 false
  br i1 %or.cond.2, label %.lr.ph.2, label %.loopexit.2

.lr.ph.2:                                         ; preds = %.loopexit.1, %60
  %.02022.2 = phi i64 [ %61, %60 ], [ %48, %.loopexit.1 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3jet6VectorIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.02022.2) #3
  call void @_ZN3jetmiIdEENS_6VectorIT_Lm2EEERKS3_S5_(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %53, ptr noundef nonnull align 8 dereferenceable(16) %1)
  %54 = call noundef double @_ZNK3jet6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %55 = fcmp ugt double %54, %7
  br i1 %55, label %60, label %56

56:                                               ; preds = %.lr.ph.2
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %.02022.2) #3
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3jet6VectorIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.02022.2) #3
  call void @_ZNKSt8functionIFvmRKN3jet6VectorIdLm2EEEEEclEmS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %58, ptr noundef nonnull align 8 dereferenceable(16) %59)
  br label %60

60:                                               ; preds = %56, %.lr.ph.2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %61 = add i64 %.02022.2, 1
  %exitcond.2.not = icmp eq i64 %61, %50
  br i1 %exitcond.2.not, label %.loopexit.2, label %.lr.ph.2, !llvm.loop !9

.loopexit.2:                                      ; preds = %60, %.loopexit.1
  %62 = getelementptr inbounds i8, ptr %5, i64 24
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %63) #3
  %65 = load i64, ptr %64, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %63) #3
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = icmp ne i64 %65, -1
  %69 = icmp ult i64 %65, %67
  %or.cond.3 = select i1 %68, i1 %69, i1 false
  br i1 %or.cond.3, label %.lr.ph.3, label %.loopexit.3

.lr.ph.3:                                         ; preds = %.loopexit.2, %77
  %.02022.3 = phi i64 [ %78, %77 ], [ %65, %.loopexit.2 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3jet6VectorIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.02022.3) #3
  call void @_ZN3jetmiIdEENS_6VectorIT_Lm2EEERKS3_S5_(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %70, ptr noundef nonnull align 8 dereferenceable(16) %1)
  %71 = call noundef double @_ZNK3jet6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %72 = fcmp ugt double %71, %7
  br i1 %72, label %77, label %73

73:                                               ; preds = %.lr.ph.3
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %.02022.3) #3
  %75 = load i64, ptr %74, align 8, !tbaa !5
  %76 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN3jet6VectorIdLm2EEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.02022.3) #3
  call void @_ZNKSt8functionIFvmRKN3jet6VectorIdLm2EEEEEclEmS4_(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %75, ptr noundef nonnull align 8 dereferenceable(16) %76)
  br label %77

77:                                               ; preds = %73, %.lr.ph.3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %78 = add i64 %.02022.3, 1
  %exitcond.3.not = icmp eq i64 %78, %67
  br i1 %exitcond.3.not, label %.loopexit.3, label %.lr.ph.3, !llvm.loop !9

.loopexit.3:                                      ; preds = %77, %.loopexit.2
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3jet30PointParallelHashGridSearcher213getNearbyKeysERKNS_6VectorIdLm2EEEPm(ptr noundef nonnull align 8 dereferenceable(152), 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(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 @_ZN3jetmiIdEENS_6VectorIT_Lm2EEERKS3_S5_(ptr dead_on_unwind noalias writable sret(%"class.jet::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 @_ZNKSt6vectorIN3jet6VectorIdLm2EEESaIS2_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 @_ZNK3jet6VectorIdLm2EE13lengthSquaredEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFvmRKN3jet6VectorIdLm2EEEEEclEmS4_(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