; LLVM IR from doyubkim/fluid-engine-dev :: src/jet (point_kdtree_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.__gnu_cxx::__normal_iterator.37" = type { ptr }
%"class.jet::Vector" = type { double, double }
%"class.__gnu_cxx::__normal_iterator.38" = type { ptr }
%"class.jet::PointKdTreeSearcher2" = type { %"class.jet::PointNeighborSearcher2", %"class.jet::KdTree" }
%"class.jet::PointNeighborSearcher2" = type { %"class.jet::Serializable" }
%"class.jet::Serializable" = type { ptr }
%"class.jet::KdTree" = type { %"class.std::vector", %"class.std::vector.0" }
%"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<jet::KdTree<double, 2>::Node, std::allocator<jet::KdTree<double, 2>::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<jet::KdTree<double, 2>::Node, std::allocator<jet::KdTree<double, 2>::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<jet::KdTree<double, 2>::Node, std::allocator<jet::KdTree<double, 2>::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<jet::KdTree<double, 2>::Node, std::allocator<jet::KdTree<double, 2>::Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.jet::KdTree<double, 2>::Node" = type { i64, i64, i64, %"class.jet::Vector" }

; 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 @_ZN3jet20PointKdTreeSearcher211deserializeERKSt6vectorIhSaIhEE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.37", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.jet::Vector", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.38", align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #4
  %17 = call noundef ptr @_ZN3jet3fbs23GetPointKdTreeSearcher2EPKv(ptr noundef %16)
  store ptr %17, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call noundef ptr @_ZNK3jet3fbs20PointKdTreeSearcher26pointsEv(ptr noundef nonnull align 1 dereferenceable(1) %18)
  store ptr %19, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call noundef ptr @_ZNK3jet3fbs20PointKdTreeSearcher25nodesEv(ptr noundef nonnull align 1 dereferenceable(1) %20)
  store ptr %21, ptr %7, align 8, !tbaa !5
  %22 = getelementptr inbounds %"class.jet::PointKdTreeSearcher2", ptr %14, i32 0, i32 1
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs8Vector2DEE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4) %23)
  %25 = zext i32 %24 to i64
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = call noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs24PointKdTreeSearcherNode2EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4) %26)
  %28 = zext i32 %27 to i64
  call void @_ZN3jet6KdTreeIdLm2EE7reserveEmm(ptr noundef nonnull align 8 dereferenceable(48) %22, i64 noundef %25, i64 noundef %28)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %29 = getelementptr inbounds %"class.jet::PointKdTreeSearcher2", ptr %14, i32 0, i32 1
  %30 = call ptr @_ZN3jet6KdTreeIdLm2EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %29)
  %31 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.37", ptr %8, i32 0, i32 0
  store ptr %30, ptr %31, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %46, %2
  %33 = load i32, ptr %9, align 4, !tbaa !9
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = call noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs8Vector2DEE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4) %34)
  %36 = icmp ult i32 %33, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %49

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #4
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load i32, ptr %9, align 4, !tbaa !9
  %41 = call noundef ptr @_ZNK11flatbuffers6VectorIPKN3jet3fbs8Vector2DEE3GetEj(ptr noundef nonnull align 4 dereferenceable(4) %39, i32 noundef %40)
  call void @_ZN3jet8fbsToJetERKNS_3fbs8Vector2DE(ptr dead_on_unwind writable sret(%"class.jet::Vector") align 8 %10, ptr noundef nonnull align 8 dereferenceable(16) %41)
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = zext i32 %42 to i64
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3jet6VectorIdLm2EEESt6vectorIS3_SaIS3_EEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef %43) #4
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3jet6VectorIdLm2EEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #4
  br label %46

46:                                               ; preds = %38
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = add i32 %47, 1
  store i32 %48, ptr %9, align 4, !tbaa !9
  br label %32, !llvm.loop !11

49:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %50 = getelementptr inbounds %"class.jet::PointKdTreeSearcher2", ptr %14, i32 0, i32 1
  %51 = call ptr @_ZN3jet6KdTreeIdLm2EE9beginNodeEv(ptr noundef nonnull align 8 dereferenceable(48) %50)
  %52 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.38", ptr %11, i32 0, i32 0
  store ptr %51, ptr %52, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %89, %49
  %54 = load i32, ptr %12, align 4, !tbaa !9
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = call noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs24PointKdTreeSearcherNode2EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4) %55)
  %57 = icmp ult i32 %54, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %92

59:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = load i32, ptr %12, align 4, !tbaa !9
  %62 = call noundef ptr @_ZNK11flatbuffers6VectorIPKN3jet3fbs24PointKdTreeSearcherNode2EE3GetEj(ptr noundef nonnull align 4 dereferenceable(4) %60, i32 noundef %61)
  store ptr %62, ptr %13, align 8, !tbaa !5
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = call noundef i64 @_ZNK3jet3fbs24PointKdTreeSearcherNode25flagsEv(ptr noundef nonnull align 8 dereferenceable(24) %63)
  %65 = load i32, ptr %12, align 4, !tbaa !9
  %66 = zext i32 %65 to i64
  %67 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3jet6KdTreeIdLm2EE4NodeESt6vectorIS4_SaIS4_EEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef %66) #4
  %68 = getelementptr inbounds %"struct.jet::KdTree<double, 2>::Node", ptr %67, i32 0, i32 0
  store i64 %64, ptr %68, align 8, !tbaa !13
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = call noundef i64 @_ZNK3jet3fbs24PointKdTreeSearcherNode25childEv(ptr noundef nonnull align 8 dereferenceable(24) %69)
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = zext i32 %71 to i64
  %73 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3jet6KdTreeIdLm2EE4NodeESt6vectorIS4_SaIS4_EEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef %72) #4
  %74 = getelementptr inbounds %"struct.jet::KdTree<double, 2>::Node", ptr %73, i32 0, i32 1
  store i64 %70, ptr %74, align 8, !tbaa !18
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  %76 = call noundef i64 @_ZNK3jet3fbs24PointKdTreeSearcherNode24itemEv(ptr noundef nonnull align 8 dereferenceable(24) %75)
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = zext i32 %77 to i64
  %79 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3jet6KdTreeIdLm2EE4NodeESt6vectorIS4_SaIS4_EEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef %78) #4
  %80 = getelementptr inbounds %"struct.jet::KdTree<double, 2>::Node", ptr %79, i32 0, i32 2
  store i64 %76, ptr %80, align 8, !tbaa !19
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = call noundef i64 @_ZNK3jet3fbs24PointKdTreeSearcherNode24itemEv(ptr noundef nonnull align 8 dereferenceable(24) %81)
  %83 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3jet6VectorIdLm2EEESt6vectorIS3_SaIS3_EEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef %82) #4
  %84 = load i32, ptr %12, align 4, !tbaa !9
  %85 = zext i32 %84 to i64
  %86 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3jet6KdTreeIdLm2EE4NodeESt6vectorIS4_SaIS4_EEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef %85) #4
  %87 = getelementptr inbounds %"struct.jet::KdTree<double, 2>::Node", ptr %86, i32 0, i32 3
  %88 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3jet6VectorIdLm2EEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %87, ptr noundef nonnull align 8 dereferenceable(16) %83)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %89

89:                                               ; preds = %59
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = add i32 %90, 1
  store i32 %91, ptr %12, align 4, !tbaa !9
  br label %53, !llvm.loop !20

92:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN3jet3fbs23GetPointKdTreeSearcher2EPKv(ptr noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK3jet3fbs20PointKdTreeSearcher26pointsEv(ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK3jet3fbs20PointKdTreeSearcher25nodesEv(ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs8Vector2DEE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs24PointKdTreeSearcherNode2EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3jet8fbsToJetERKNS_3fbs8Vector2DE(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK11flatbuffers6VectorIPKN3jet3fbs8Vector2DEE3GetEj(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK11flatbuffers6VectorIPKN3jet3fbs24PointKdTreeSearcherNode2EE3GetEj(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #1 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3jet3fbs24PointKdTreeSearcherNode24itemEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTSN3jet6KdTreeIdLm2EE4NodeE", !15, i64 0, !15, i64 8, !15, i64 16, !16, i64 24}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTSN3jet6VectorIdLm2EEE", !17, i64 0, !17, i64 8}
!17 = !{!"double", !7, i64 0}
!18 = !{!14, !15, i64 8}
!19 = !{!14, !15, i64 16}
!20 = distinct !{!20, !12}


; 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.__gnu_cxx::__normal_iterator.37" = type { ptr }
%"class.jet::Vector" = type { double, double }
%"class.__gnu_cxx::__normal_iterator.38" = type { ptr }

; 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 @_ZN3jet20PointKdTreeSearcher211deserializeERKSt6vectorIhSaIhEE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #1 align 2 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.37", align 8
  %4 = alloca %"class.jet::Vector", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.38", align 8
  %6 = tail call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %7 = tail call noundef ptr @_ZN3jet3fbs23GetPointKdTreeSearcher2EPKv(ptr noundef %6)
  %8 = tail call noundef ptr @_ZNK3jet3fbs20PointKdTreeSearcher26pointsEv(ptr noundef nonnull align 1 dereferenceable(1) %7)
  %9 = tail call noundef ptr @_ZNK3jet3fbs20PointKdTreeSearcher25nodesEv(ptr noundef nonnull align 1 dereferenceable(1) %7)
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = tail call noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs8Vector2DEE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4) %8)
  %12 = zext i32 %11 to i64
  %13 = tail call noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs24PointKdTreeSearcherNode2EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4) %9)
  %14 = zext i32 %13 to i64
  tail call void @_ZN3jet6KdTreeIdLm2EE7reserveEmm(ptr noundef nonnull align 8 dereferenceable(48) %10, i64 noundef %12, i64 noundef %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %15 = tail call ptr @_ZN3jet6KdTreeIdLm2EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %10)
  store ptr %15, ptr %3, align 8
  %16 = tail call noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs8Vector2DEE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4) %8)
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %17 = call ptr @_ZN3jet6KdTreeIdLm2EE9beginNodeEv(ptr noundef nonnull align 8 dereferenceable(48) %10)
  store ptr %17, ptr %5, align 8
  %18 = call noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs24PointKdTreeSearcherNode2EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4) %9)
  %.not30 = icmp eq i32 %18, 0
  br i1 %.not30, label %._crit_edge29, label %.lr.ph28

.lr.ph:                                           ; preds = %2, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %2 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  %19 = trunc nuw i64 %indvars.iv to i32
  %20 = call noundef ptr @_ZNK11flatbuffers6VectorIPKN3jet3fbs8Vector2DEE3GetEj(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef %19)
  call void @_ZN3jet8fbsToJetERKNS_3fbs8Vector2DE(ptr dead_on_unwind nonnull writable sret(%"class.jet::Vector") align 8 %4, ptr noundef nonnull align 8 dereferenceable(16) %20)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3jet6VectorIdLm2EEESt6vectorIS3_SaIS3_EEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %indvars.iv) #4
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3jet6VectorIdLm2EEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = call noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs8Vector2DEE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4) %8)
  %24 = zext i32 %23 to i64
  %25 = icmp ult i64 %indvars.iv.next, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !5

._crit_edge29:                                    ; preds = %.lr.ph28, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret void

.lr.ph28:                                         ; preds = %._crit_edge, %.lr.ph28
  %indvars.iv32 = phi i64 [ %indvars.iv.next33, %.lr.ph28 ], [ 0, %._crit_edge ]
  %26 = trunc nuw i64 %indvars.iv32 to i32
  %27 = call noundef ptr @_ZNK11flatbuffers6VectorIPKN3jet3fbs24PointKdTreeSearcherNode2EE3GetEj(ptr noundef nonnull align 4 dereferenceable(4) %9, i32 noundef %26)
  %28 = call noundef i64 @_ZNK3jet3fbs24PointKdTreeSearcherNode25flagsEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  %29 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3jet6KdTreeIdLm2EE4NodeESt6vectorIS4_SaIS4_EEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %indvars.iv32) #4
  store i64 %28, ptr %29, align 8, !tbaa !7
  %30 = call noundef i64 @_ZNK3jet3fbs24PointKdTreeSearcherNode25childEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  %31 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3jet6KdTreeIdLm2EE4NodeESt6vectorIS4_SaIS4_EEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %indvars.iv32) #4
  %32 = getelementptr inbounds i8, ptr %31, i64 8
  store i64 %30, ptr %32, align 8, !tbaa !14
  %33 = call noundef i64 @_ZNK3jet3fbs24PointKdTreeSearcherNode24itemEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  %34 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3jet6KdTreeIdLm2EE4NodeESt6vectorIS4_SaIS4_EEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %indvars.iv32) #4
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  store i64 %33, ptr %35, align 8, !tbaa !15
  %36 = call noundef i64 @_ZNK3jet3fbs24PointKdTreeSearcherNode24itemEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3jet6VectorIdLm2EEESt6vectorIS3_SaIS3_EEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %36) #4
  %38 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3jet6KdTreeIdLm2EE4NodeESt6vectorIS4_SaIS4_EEEixEl(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %indvars.iv32) #4
  %39 = getelementptr inbounds i8, ptr %38, i64 24
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3jet6VectorIdLm2EEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 8 dereferenceable(16) %37)
  %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1
  %41 = call noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs24PointKdTreeSearcherNode2EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4) %9)
  %42 = zext i32 %41 to i64
  %43 = icmp ult i64 %indvars.iv.next33, %42
  br i1 %43, label %.lr.ph28, label %._crit_edge29, !llvm.loop !16
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN3jet3fbs23GetPointKdTreeSearcher2EPKv(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK3jet3fbs20PointKdTreeSearcher26pointsEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK3jet3fbs20PointKdTreeSearcher25nodesEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs8Vector2DEE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK11flatbuffers6VectorIPKN3jet3fbs24PointKdTreeSearcherNode2EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN3jet6KdTreeIdLm2EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3jet8fbsToJetERKNS_3fbs8Vector2DE(ptr dead_on_unwind noalias writable sret(%"class.jet::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK11flatbuffers6VectorIPKN3jet3fbs8Vector2DEE3GetEj(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN3jet6KdTreeIdLm2EE9beginNodeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK11flatbuffers6VectorIPKN3jet3fbs24PointKdTreeSearcherNode2EE3GetEj(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3jet3fbs24PointKdTreeSearcherNode24itemEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !9, i64 0}
!8 = !{!"_ZTSN3jet6KdTreeIdLm2EE4NodeE", !9, i64 0, !9, i64 8, !9, i64 16, !12, i64 24}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN3jet6VectorIdLm2EEE", !13, i64 0, !13, i64 8}
!13 = !{!"double", !10, i64 0}
!14 = !{!8, !9, i64 8}
!15 = !{!8, !9, i64 16}
!16 = distinct !{!16, !6}


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