; LLVM IR from yangfengzzz/Arche-webgpu :: vox.geometry/implicit_surface_set2.ll (ZNK3vox19ImplicitSurfaceSet28buildBvhEv)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<vox::ImplicitSurface2>, std::allocator<std::shared_ptr<vox::ImplicitSurface2>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<vox::ImplicitSurface2>, std::allocator<std::shared_ptr<vox::ImplicitSurface2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<vox::ImplicitSurface2>, std::allocator<std::shared_ptr<vox::ImplicitSurface2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<vox::ImplicitSurface2>, std::allocator<std::shared_ptr<vox::ImplicitSurface2>>>::_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<vox::BoundingBox<double, 2>, std::allocator<vox::BoundingBox<double, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<vox::BoundingBox<double, 2>, std::allocator<vox::BoundingBox<double, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<vox::BoundingBox<double, 2>, std::allocator<vox::BoundingBox<double, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vox::BoundingBox<double, 2>, std::allocator<vox::BoundingBox<double, 2>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.19" = type { ptr }
%"struct.vox::BoundingBox" = type { %"struct.vox::Point", %"struct.vox::Point" }
%"struct.vox::Point" = type { double, double }
%"class.vox::ImplicitSurfaceSet2" = type <{ %"class.vox::ImplicitSurface2.base", [7 x i8], %"class.std::vector", %"class.std::vector", %"class.vox::Bvh2", i8, [7 x i8] }>
%"class.vox::ImplicitSurface2.base" = type { %"class.vox::Surface2.base" }
%"class.vox::Surface2.base" = type <{ ptr, %"class.vox::Transform2", i8 }>
%"class.vox::Transform2" = type { %"struct.vox::Vector", double, double, double }
%"struct.vox::Vector" = type { double, double }
%"class.vox::Bvh2" = type { %"class.vox::IntersectionQueryEngine2", %"class.vox::NearestNeighborQueryEngine2", %"struct.vox::BoundingBox", %"class.std::vector", %"class.std::vector.0", %"class.std::vector.5" }
%"class.vox::IntersectionQueryEngine2" = type { ptr }
%"class.vox::NearestNeighborQueryEngine2" = type { ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<vox::Bvh2<std::shared_ptr<vox::ImplicitSurface2>>::Node, std::allocator<vox::Bvh2<std::shared_ptr<vox::ImplicitSurface2>>::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<vox::Bvh2<std::shared_ptr<vox::ImplicitSurface2>>::Node, std::allocator<vox::Bvh2<std::shared_ptr<vox::ImplicitSurface2>>::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<vox::Bvh2<std::shared_ptr<vox::ImplicitSurface2>>::Node, std::allocator<vox::Bvh2<std::shared_ptr<vox::ImplicitSurface2>>::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vox::Bvh2<std::shared_ptr<vox::ImplicitSurface2>>::Node, std::allocator<vox::Bvh2<std::shared_ptr<vox::ImplicitSurface2>>::Node>>::_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 nounwind uwtable
declare dso_local void @_ZNSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3vox19ImplicitSurfaceSet28buildBvhEv(ptr noundef nonnull align 8 dereferenceable(232) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::vector.0", align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.19", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.19", align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.vox::BoundingBox", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  %13 = getelementptr inbounds %"class.vox::ImplicitSurfaceSet2", ptr %12, i32 0, i32 5
  %14 = load i8, ptr %13, align 8, !tbaa !9, !range !34, !noundef !35
  %15 = trunc i8 %14 to i1
  br i1 %15, label %16, label %64

16:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  call void @_ZNSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  call void @_ZNSt6vectorIN3vox11BoundingBoxIdLm2EEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %17 = getelementptr inbounds %"class.vox::ImplicitSurfaceSet2", ptr %12, i32 0, i32 2
  store ptr %17, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call ptr @_ZNKSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  %20 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.19", ptr %6, i32 0, i32 0
  store ptr %19, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = call ptr @_ZNKSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.19", ptr %7, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  br label %24

24:                                               ; preds = %52, %16
  %25 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIN3vox16ImplicitSurface2EESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br i1 %25, label %27, label %26

26:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %55

27:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIN3vox16ImplicitSurface2EESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  store ptr %28, ptr %8, align 8, !tbaa !5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3vox16ImplicitSurface2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %29) #5
  %31 = load ptr, ptr %30, align 8, !tbaa !36
  %32 = getelementptr inbounds ptr, ptr %31, i64 3
  %33 = load ptr, ptr %32, align 8
  %34 = invoke noundef zeroext i1 %33(ptr noundef nonnull align 8 dereferenceable(49) %30)
          to label %35 unwind label %43

35:                                               ; preds = %27
  br i1 %34, label %36, label %51

36:                                               ; preds = %35
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZNSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(16) %37)
          to label %38 unwind label %43

38:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3vox16ImplicitSurface2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %39) #5
  invoke void @_ZNK3vox8Surface211boundingBoxEv(ptr dead_on_unwind writable sret(%"struct.vox::BoundingBox") align 8 %11, ptr noundef nonnull align 8 dereferenceable(49) %40)
          to label %41 unwind label %47

41:                                               ; preds = %38
  invoke void @_ZNSt6vectorIN3vox11BoundingBoxIdLm2EEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %42 unwind label %47

42:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  br label %51

43:                                               ; preds = %36, %27
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %9, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %10, align 4
  br label %54

47:                                               ; preds = %41, %38
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %9, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  br label %54

51:                                               ; preds = %42, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %52

52:                                               ; preds = %51
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIN3vox16ImplicitSurface2EESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br label %24

54:                                               ; preds = %47, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %63

55:                                               ; preds = %26
  %56 = getelementptr inbounds %"class.vox::ImplicitSurfaceSet2", ptr %12, i32 0, i32 4
  invoke void @_ZN3vox4Bvh2ISt10shared_ptrINS_16ImplicitSurface2EEE5buildERKSt6vectorIS3_SaIS3_EERKS5_INS_11BoundingBoxIdLm2EEESaISB_EE(ptr noundef nonnull align 8 dereferenceable(120) %56, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %57 unwind label %59

57:                                               ; preds = %55
  %58 = getelementptr inbounds %"class.vox::ImplicitSurfaceSet2", ptr %12, i32 0, i32 5
  store i8 0, ptr %58, align 8, !tbaa !9
  call void @_ZNSt6vectorIN3vox11BoundingBoxIdLm2EEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @_ZNSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  br label %64

59:                                               ; preds = %55
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %9, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %10, align 4
  br label %63

63:                                               ; preds = %59, %54
  call void @_ZNSt6vectorIN3vox11BoundingBoxIdLm2EEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @_ZNSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  br label %65

64:                                               ; preds = %57, %1
  ret void

65:                                               ; preds = %63
  %66 = load ptr, ptr %9, align 8
  %67 = load i32, ptr %10, align 4
  %68 = insertvalue { ptr, i32 } poison, ptr %66, 0
  %69 = insertvalue { ptr, i32 } %68, i32 %67, 1
  resume { ptr, i32 } %69
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIN3vox16ImplicitSurface2EESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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

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

declare void @_ZNK3vox8Surface211boundingBoxEv(ptr dead_on_unwind writable sret(%"struct.vox::BoundingBox") align 8, ptr noundef nonnull align 8 dereferenceable(49)) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3vox11BoundingBoxIdLm2EEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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 = { inlinehint 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 = { "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 #5 = { 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, !16, i64 224}
!10 = !{!"_ZTSN3vox19ImplicitSurfaceSet2E", !11, i64 0, !17, i64 56, !17, i64 80, !21, i64 104, !16, i64 224}
!11 = !{!"_ZTSN3vox16ImplicitSurface2E", !12, i64 0}
!12 = !{!"_ZTSN3vox8Surface2E", !13, i64 8, !16, i64 48}
!13 = !{!"_ZTSN3vox10Transform2IdEE", !14, i64 0, !15, i64 16, !15, i64 24, !15, i64 32}
!14 = !{!"_ZTSN3vox6VectorIdLm2EEE", !15, i64 0, !15, i64 8}
!15 = !{!"double", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSN3vox4Bvh2ISt10shared_ptrINS_16ImplicitSurface2EEEE", !22, i64 0, !23, i64 8, !24, i64 16, !17, i64 48, !26, i64 72, !30, i64 96}
!22 = !{!"_ZTSN3vox24IntersectionQueryEngine2ISt10shared_ptrINS_16ImplicitSurface2EEEE"}
!23 = !{!"_ZTSN3vox27NearestNeighborQueryEngine2ISt10shared_ptrINS_16ImplicitSurface2EEEE"}
!24 = !{!"_ZTSN3vox11BoundingBoxIdLm2EEE", !25, i64 0, !25, i64 16}
!25 = !{!"_ZTSN3vox5PointIdLm2EEE", !15, i64 0, !15, i64 8}
!26 = !{!"_ZTSSt6vectorIN3vox11BoundingBoxIdLm2EEESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIN3vox11BoundingBoxIdLm2EEESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN3vox11BoundingBoxIdLm2EEESaIS2_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN3vox11BoundingBoxIdLm2EEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!"_ZTSSt6vectorIN3vox4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIN3vox4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN3vox4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIN3vox4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!37, !37, i64 0}
!37 = !{!"vtable pointer", !8, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<vox::ImplicitSurface2>, std::allocator<std::shared_ptr<vox::ImplicitSurface2>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<vox::ImplicitSurface2>, std::allocator<std::shared_ptr<vox::ImplicitSurface2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<vox::ImplicitSurface2>, std::allocator<std::shared_ptr<vox::ImplicitSurface2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<vox::ImplicitSurface2>, std::allocator<std::shared_ptr<vox::ImplicitSurface2>>>::_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<vox::BoundingBox<double, 2>, std::allocator<vox::BoundingBox<double, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<vox::BoundingBox<double, 2>, std::allocator<vox::BoundingBox<double, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<vox::BoundingBox<double, 2>, std::allocator<vox::BoundingBox<double, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vox::BoundingBox<double, 2>, std::allocator<vox::BoundingBox<double, 2>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.19" = type { ptr }
%"struct.vox::BoundingBox" = type { %"struct.vox::Point", %"struct.vox::Point" }
%"struct.vox::Point" = 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3vox19ImplicitSurfaceSet28buildBvhEv(ptr noundef nonnull align 8 dereferenceable(232) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::vector.0", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.19", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.19", align 8
  %6 = alloca %"struct.vox::BoundingBox", align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 224
  %8 = load i8, ptr %7, align 8, !tbaa !5, !range !33, !noundef !34
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %10, label %40

10:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  call void @_ZNSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt6vectorIN3vox11BoundingBoxIdLm2EEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %11 = getelementptr inbounds i8, ptr %0, i64 56
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %12 = call ptr @_ZNKSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  store ptr %12, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %13 = call ptr @_ZNKSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  store ptr %13, ptr %5, align 8
  %14 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIN3vox16ImplicitSurface2EESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %32, %10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %15 = getelementptr inbounds i8, ptr %0, i64 104
  invoke void @_ZN3vox4Bvh2ISt10shared_ptrINS_16ImplicitSurface2EEE5buildERKSt6vectorIS3_SaIS3_EERKS5_INS_11BoundingBoxIdLm2EEESaISB_EE(ptr noundef nonnull align 8 dereferenceable(120) %15, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %36 unwind label %37

.lr.ph:                                           ; preds = %10, %32
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIN3vox16ImplicitSurface2EESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %17 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3vox16ImplicitSurface2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  %18 = load ptr, ptr %17, align 8, !tbaa !35
  %19 = getelementptr inbounds i8, ptr %18, i64 24
  %20 = load ptr, ptr %19, align 8
  %21 = invoke noundef zeroext i1 %20(ptr noundef nonnull align 8 dereferenceable(49) %17)
          to label %22 unwind label %28

22:                                               ; preds = %.lr.ph
  br i1 %21, label %23, label %32

23:                                               ; preds = %22
  invoke void @_ZNSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %24 unwind label %28

24:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  %25 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3vox16ImplicitSurface2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  invoke void @_ZNK3vox8Surface211boundingBoxEv(ptr dead_on_unwind nonnull writable sret(%"struct.vox::BoundingBox") align 8 %6, ptr noundef nonnull align 8 dereferenceable(49) %25)
          to label %26 unwind label %30

26:                                               ; preds = %24
  invoke void @_ZNSt6vectorIN3vox11BoundingBoxIdLm2EEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %27 unwind label %30

27:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  br label %32

28:                                               ; preds = %23, %.lr.ph
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %35

30:                                               ; preds = %26, %24
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  br label %35

32:                                               ; preds = %27, %22
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIN3vox16ImplicitSurface2EESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %34 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIN3vox16ImplicitSurface2EESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %34, label %.lr.ph, label %._crit_edge

35:                                               ; preds = %30, %28
  %.pn = phi { ptr, i32 } [ %31, %30 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %39

36:                                               ; preds = %._crit_edge
  store i8 0, ptr %7, align 8, !tbaa !5
  call void @_ZNSt6vectorIN3vox11BoundingBoxIdLm2EEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  br label %40

37:                                               ; preds = %._crit_edge
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %39

39:                                               ; preds = %37, %35
  %.pn.pn = phi { ptr, i32 } [ %.pn, %35 ], [ %38, %37 ]
  call void @_ZNSt6vectorIN3vox11BoundingBoxIdLm2EEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn.pn

40:                                               ; preds = %36, %1
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKSt10shared_ptrIN3vox16ImplicitSurface2EESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

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

declare void @_ZNK3vox8Surface211boundingBoxEv(ptr dead_on_unwind writable sret(%"struct.vox::BoundingBox") align 8, ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #4

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

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

attributes #0 = { mustprogress 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 = { inlinehint 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 = { "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 #5 = { 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, !14, i64 224}
!6 = !{!"_ZTSN3vox19ImplicitSurfaceSet2E", !7, i64 0, !15, i64 56, !15, i64 80, !20, i64 104, !14, i64 224}
!7 = !{!"_ZTSN3vox16ImplicitSurface2E", !8, i64 0}
!8 = !{!"_ZTSN3vox8Surface2E", !9, i64 8, !14, i64 48}
!9 = !{!"_ZTSN3vox10Transform2IdEE", !10, i64 0, !11, i64 16, !11, i64 24, !11, i64 32}
!10 = !{!"_ZTSN3vox6VectorIdLm2EEE", !11, i64 0, !11, i64 8}
!11 = !{!"double", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"bool", !12, i64 0}
!15 = !{!"_ZTSSt6vectorISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3vox16ImplicitSurface2EESaIS3_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!19 = !{!"any pointer", !12, i64 0}
!20 = !{!"_ZTSN3vox4Bvh2ISt10shared_ptrINS_16ImplicitSurface2EEEE", !21, i64 0, !22, i64 8, !23, i64 16, !15, i64 48, !25, i64 72, !29, i64 96}
!21 = !{!"_ZTSN3vox24IntersectionQueryEngine2ISt10shared_ptrINS_16ImplicitSurface2EEEE"}
!22 = !{!"_ZTSN3vox27NearestNeighborQueryEngine2ISt10shared_ptrINS_16ImplicitSurface2EEEE"}
!23 = !{!"_ZTSN3vox11BoundingBoxIdLm2EEE", !24, i64 0, !24, i64 16}
!24 = !{!"_ZTSN3vox5PointIdLm2EEE", !11, i64 0, !11, i64 8}
!25 = !{!"_ZTSSt6vectorIN3vox11BoundingBoxIdLm2EEESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIN3vox11BoundingBoxIdLm2EEESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN3vox11BoundingBoxIdLm2EEESaIS2_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN3vox11BoundingBoxIdLm2EEESaIS2_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!29 = !{!"_ZTSSt6vectorIN3vox4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIN3vox4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN3vox4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN3vox4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!36, !36, i64 0}
!36 = !{!"vtable pointer", !13, i64 0}


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