; LLVM IR from doyubkim/fluid-engine-dev :: src/jet/implicit_surface_set2.ll (ZNK3jet19ImplicitSurfaceSet28buildBvhEv)

; 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<jet::ImplicitSurface2>, std::allocator<std::shared_ptr<jet::ImplicitSurface2>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<jet::ImplicitSurface2>, std::allocator<std::shared_ptr<jet::ImplicitSurface2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<jet::ImplicitSurface2>, std::allocator<std::shared_ptr<jet::ImplicitSurface2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<jet::ImplicitSurface2>, std::allocator<std::shared_ptr<jet::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<jet::BoundingBox<double, 2>, std::allocator<jet::BoundingBox<double, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<jet::BoundingBox<double, 2>, std::allocator<jet::BoundingBox<double, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<jet::BoundingBox<double, 2>, std::allocator<jet::BoundingBox<double, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<jet::BoundingBox<double, 2>, std::allocator<jet::BoundingBox<double, 2>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.jet::BoundingBox" = type { %"class.jet::Vector", %"class.jet::Vector" }
%"class.jet::Vector" = type { double, double }
%"class.jet::ImplicitSurfaceSet2" = type <{ %"class.jet::ImplicitSurface2.base", [7 x i8], %"class.std::vector", %"class.std::vector", %"class.jet::Bvh2", i8, [7 x i8] }>
%"class.jet::ImplicitSurface2.base" = type { %"class.jet::Surface2.base" }
%"class.jet::Surface2.base" = type <{ ptr, %"class.jet::Transform2", i8 }>
%"class.jet::Transform2" = type { %"class.jet::Vector", double, double, double }
%"class.jet::Bvh2" = type { %"class.jet::IntersectionQueryEngine2", %"class.jet::NearestNeighborQueryEngine2", %"class.jet::BoundingBox", %"class.std::vector", %"class.std::vector.0", %"class.std::vector.5" }
%"class.jet::IntersectionQueryEngine2" = type { ptr }
%"class.jet::NearestNeighborQueryEngine2" = type { ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<jet::Bvh2<std::shared_ptr<jet::ImplicitSurface2>>::Node, std::allocator<jet::Bvh2<std::shared_ptr<jet::ImplicitSurface2>>::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<jet::Bvh2<std::shared_ptr<jet::ImplicitSurface2>>::Node, std::allocator<jet::Bvh2<std::shared_ptr<jet::ImplicitSurface2>>::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<jet::Bvh2<std::shared_ptr<jet::ImplicitSurface2>>::Node, std::allocator<jet::Bvh2<std::shared_ptr<jet::ImplicitSurface2>>::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<jet::Bvh2<std::shared_ptr<jet::ImplicitSurface2>>::Node, std::allocator<jet::Bvh2<std::shared_ptr<jet::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_ptrIN3jet16ImplicitSurface2EESaIS3_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_ptrIN3jet16ImplicitSurface2EESaIS3_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_accessIN3jet16ImplicitSurface2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_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 @_ZNK3jet19ImplicitSurfaceSet28buildBvhEv(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 i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.jet::BoundingBox", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8
  %10 = getelementptr inbounds %"class.jet::ImplicitSurfaceSet2", ptr %9, i32 0, i32 5
  %11 = load i8, ptr %10, align 8, !tbaa !9, !range !33, !noundef !34
  %12 = trunc i8 %11 to i1
  br i1 %12, label %13, label %63

13:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #4
  call void @_ZNSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #4
  call void @_ZNSt6vectorIN3jet11BoundingBoxIdLm2EEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store i64 0, ptr %5, align 8, !tbaa !35
  br label %14

14:                                               ; preds = %50, %13
  %15 = load i64, ptr %5, align 8, !tbaa !35
  %16 = getelementptr inbounds %"class.jet::ImplicitSurfaceSet2", ptr %9, i32 0, i32 2
  %17 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %18 = icmp ult i64 %15, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %54

20:                                               ; preds = %14
  %21 = getelementptr inbounds %"class.jet::ImplicitSurfaceSet2", ptr %9, i32 0, i32 2
  %22 = load i64, ptr %5, align 8, !tbaa !35
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %22) #4
  %24 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet16ImplicitSurface2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #4
  %25 = load ptr, ptr %24, align 8, !tbaa !37
  %26 = getelementptr inbounds ptr, ptr %25, i64 3
  %27 = load ptr, ptr %26, align 8
  %28 = invoke noundef zeroext i1 %27(ptr noundef nonnull align 8 dereferenceable(49) %24)
          to label %29 unwind label %41

29:                                               ; preds = %20
  br i1 %28, label %30, label %49

30:                                               ; preds = %29
  %31 = getelementptr inbounds %"class.jet::ImplicitSurfaceSet2", ptr %9, i32 0, i32 2
  %32 = load i64, ptr %5, align 8, !tbaa !35
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %32) #4
  invoke void @_ZNSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(16) %33)
          to label %34 unwind label %41

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #4
  %35 = getelementptr inbounds %"class.jet::ImplicitSurfaceSet2", ptr %9, i32 0, i32 2
  %36 = load i64, ptr %5, align 8, !tbaa !35
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %36) #4
  %38 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet16ImplicitSurface2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %37) #4
  invoke void @_ZNK3jet8Surface211boundingBoxEv(ptr dead_on_unwind writable sret(%"class.jet::BoundingBox") align 8 %8, ptr noundef nonnull align 8 dereferenceable(49) %38)
          to label %39 unwind label %45

39:                                               ; preds = %34
  invoke void @_ZNSt6vectorIN3jet11BoundingBoxIdLm2EEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %40 unwind label %45

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

41:                                               ; preds = %30, %20
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %6, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %7, align 4
  br label %53

45:                                               ; preds = %39, %34
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %6, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #4
  br label %53

49:                                               ; preds = %40, %29
  br label %50

50:                                               ; preds = %49
  %51 = load i64, ptr %5, align 8, !tbaa !35
  %52 = add i64 %51, 1
  store i64 %52, ptr %5, align 8, !tbaa !35
  br label %14, !llvm.loop !39

53:                                               ; preds = %45, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %62

54:                                               ; preds = %19
  %55 = getelementptr inbounds %"class.jet::ImplicitSurfaceSet2", ptr %9, i32 0, i32 4
  invoke void @_ZN3jet4Bvh2ISt10shared_ptrINS_16ImplicitSurface2EEE5buildERKSt6vectorIS3_SaIS3_EERKS5_INS_11BoundingBoxIdLm2EEESaISB_EE(ptr noundef nonnull align 8 dereferenceable(120) %55, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %56 unwind label %58

56:                                               ; preds = %54
  %57 = getelementptr inbounds %"class.jet::ImplicitSurfaceSet2", ptr %9, i32 0, i32 5
  store i8 0, ptr %57, align 8, !tbaa !9
  call void @_ZNSt6vectorIN3jet11BoundingBoxIdLm2EEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #4
  call void @_ZNSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #4
  br label %63

58:                                               ; preds = %54
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %6, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %7, align 4
  br label %62

62:                                               ; preds = %58, %53
  call void @_ZNSt6vectorIN3jet11BoundingBoxIdLm2EEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #4
  call void @_ZNSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #4
  br label %64

63:                                               ; preds = %56, %1
  ret void

64:                                               ; preds = %62
  %65 = load ptr, ptr %6, align 8
  %66 = load i32, ptr %7, align 4
  %67 = insertvalue { ptr, i32 } poison, ptr %65, 0
  %68 = insertvalue { ptr, i32 } %67, i32 %66, 1
  resume { ptr, i32 } %68
}

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

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

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

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

declare void @_ZNK3jet8Surface211boundingBoxEv(ptr dead_on_unwind writable sret(%"class.jet::BoundingBox") align 8, ptr noundef nonnull align 8 dereferenceable(49)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3jet4Bvh2ISt10shared_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 @_ZNSt6vectorIN3jet11BoundingBoxIdLm2EEESaIS2_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 = { "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, !16, i64 224}
!10 = !{!"_ZTSN3jet19ImplicitSurfaceSet2E", !11, i64 0, !17, i64 56, !17, i64 80, !21, i64 104, !16, i64 224}
!11 = !{!"_ZTSN3jet16ImplicitSurface2E", !12, i64 0}
!12 = !{!"_ZTSN3jet8Surface2E", !13, i64 8, !16, i64 48}
!13 = !{!"_ZTSN3jet10Transform2E", !14, i64 0, !15, i64 16, !15, i64 24, !15, i64 32}
!14 = !{!"_ZTSN3jet6VectorIdLm2EEE", !15, i64 0, !15, i64 8}
!15 = !{!"double", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSN3jet4Bvh2ISt10shared_ptrINS_16ImplicitSurface2EEEE", !22, i64 0, !23, i64 8, !24, i64 16, !17, i64 48, !25, i64 72, !29, i64 96}
!22 = !{!"_ZTSN3jet24IntersectionQueryEngine2ISt10shared_ptrINS_16ImplicitSurface2EEEE"}
!23 = !{!"_ZTSN3jet27NearestNeighborQueryEngine2ISt10shared_ptrINS_16ImplicitSurface2EEEE"}
!24 = !{!"_ZTSN3jet11BoundingBoxIdLm2EEE", !14, i64 0, !14, i64 16}
!25 = !{!"_ZTSSt6vectorIN3jet11BoundingBoxIdLm2EEESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIN3jet11BoundingBoxIdLm2EEESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN3jet11BoundingBoxIdLm2EEESaIS2_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN3jet11BoundingBoxIdLm2EEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSSt6vectorIN3jet4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIN3jet4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN3jet4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN3jet4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!36, !36, i64 0}
!36 = !{!"long", !7, i64 0}
!37 = !{!38, !38, i64 0}
!38 = !{!"vtable pointer", !8, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<jet::ImplicitSurface2>, std::allocator<std::shared_ptr<jet::ImplicitSurface2>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<jet::ImplicitSurface2>, std::allocator<std::shared_ptr<jet::ImplicitSurface2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<jet::ImplicitSurface2>, std::allocator<std::shared_ptr<jet::ImplicitSurface2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<jet::ImplicitSurface2>, std::allocator<std::shared_ptr<jet::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<jet::BoundingBox<double, 2>, std::allocator<jet::BoundingBox<double, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<jet::BoundingBox<double, 2>, std::allocator<jet::BoundingBox<double, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<jet::BoundingBox<double, 2>, std::allocator<jet::BoundingBox<double, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<jet::BoundingBox<double, 2>, std::allocator<jet::BoundingBox<double, 2>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.jet::BoundingBox" = type { %"class.jet::Vector", %"class.jet::Vector" }
%"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 nounwind uwtable
declare dso_local void @_ZNSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_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_ptrIN3jet16ImplicitSurface2EESaIS3_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_accessIN3jet16ImplicitSurface2ELN9__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_ptrIN3jet16ImplicitSurface2EESaIS3_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 @_ZNK3jet19ImplicitSurfaceSet28buildBvhEv(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.jet::BoundingBox", align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 224
  %6 = load i8, ptr %5, align 8, !tbaa !5, !range !32, !noundef !33
  %7 = trunc nuw i8 %6 to i1
  br i1 %7, label %8, label %38

8:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #4
  call void @_ZNSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  call void @_ZNSt6vectorIN3jet11BoundingBoxIdLm2EEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %9 = getelementptr inbounds i8, ptr %0, i64 56
  %10 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %.not = icmp eq i64 %10, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %30, %8
  %11 = getelementptr inbounds i8, ptr %0, i64 104
  invoke void @_ZN3jet4Bvh2ISt10shared_ptrINS_16ImplicitSurface2EEE5buildERKSt6vectorIS3_SaIS3_EERKS5_INS_11BoundingBoxIdLm2EEESaISB_EE(ptr noundef nonnull align 8 dereferenceable(120) %11, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %34 unwind label %35

.lr.ph:                                           ; preds = %8, %30
  %.0912 = phi i64 [ %31, %30 ], [ 0, %8 ]
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.0912) #4
  %13 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet16ImplicitSurface2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %12) #4
  %14 = load ptr, ptr %13, align 8, !tbaa !34
  %15 = getelementptr inbounds i8, ptr %14, i64 24
  %16 = load ptr, ptr %15, align 8
  %17 = invoke noundef zeroext i1 %16(ptr noundef nonnull align 8 dereferenceable(49) %13)
          to label %18 unwind label %26

18:                                               ; preds = %.lr.ph
  br i1 %17, label %19, label %30

19:                                               ; preds = %18
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.0912) #4
  invoke void @_ZNSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %21 unwind label %26

21:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.0912) #4
  %23 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3jet16ImplicitSurface2ELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %22) #4
  invoke void @_ZNK3jet8Surface211boundingBoxEv(ptr dead_on_unwind nonnull writable sret(%"class.jet::BoundingBox") align 8 %4, ptr noundef nonnull align 8 dereferenceable(49) %23)
          to label %24 unwind label %28

24:                                               ; preds = %21
  invoke void @_ZNSt6vectorIN3jet11BoundingBoxIdLm2EEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %25 unwind label %28

25:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br label %30

26:                                               ; preds = %19, %.lr.ph
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %37

28:                                               ; preds = %24, %21
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br label %37

30:                                               ; preds = %18, %25
  %31 = add nuw i64 %.0912, 1
  %32 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %33 = icmp ult i64 %31, %32
  br i1 %33, label %.lr.ph, label %._crit_edge, !llvm.loop !36

34:                                               ; preds = %._crit_edge
  store i8 0, ptr %5, align 8, !tbaa !5
  call void @_ZNSt6vectorIN3jet11BoundingBoxIdLm2EEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  call void @_ZNSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  br label %38

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

37:                                               ; preds = %26, %28, %35
  %.pn.pn = phi { ptr, i32 } [ %36, %35 ], [ %29, %28 ], [ %27, %26 ]
  call void @_ZNSt6vectorIN3jet11BoundingBoxIdLm2EEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  call void @_ZNSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn.pn

38:                                               ; preds = %34, %1
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE4sizeEv(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(16) ptr @_ZNKSt6vectorISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

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

declare void @_ZNK3jet8Surface211boundingBoxEv(ptr dead_on_unwind writable sret(%"class.jet::BoundingBox") align 8, ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3jet4Bvh2ISt10shared_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 @_ZNSt6vectorIN3jet11BoundingBoxIdLm2EEESaIS2_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 = { "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, !14, i64 224}
!6 = !{!"_ZTSN3jet19ImplicitSurfaceSet2E", !7, i64 0, !15, i64 56, !15, i64 80, !20, i64 104, !14, i64 224}
!7 = !{!"_ZTSN3jet16ImplicitSurface2E", !8, i64 0}
!8 = !{!"_ZTSN3jet8Surface2E", !9, i64 8, !14, i64 48}
!9 = !{!"_ZTSN3jet10Transform2E", !10, i64 0, !11, i64 16, !11, i64 24, !11, i64 32}
!10 = !{!"_ZTSN3jet6VectorIdLm2EEE", !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_ptrIN3jet16ImplicitSurface2EESaIS3_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN3jet16ImplicitSurface2EESaIS3_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!19 = !{!"any pointer", !12, i64 0}
!20 = !{!"_ZTSN3jet4Bvh2ISt10shared_ptrINS_16ImplicitSurface2EEEE", !21, i64 0, !22, i64 8, !23, i64 16, !15, i64 48, !24, i64 72, !28, i64 96}
!21 = !{!"_ZTSN3jet24IntersectionQueryEngine2ISt10shared_ptrINS_16ImplicitSurface2EEEE"}
!22 = !{!"_ZTSN3jet27NearestNeighborQueryEngine2ISt10shared_ptrINS_16ImplicitSurface2EEEE"}
!23 = !{!"_ZTSN3jet11BoundingBoxIdLm2EEE", !10, i64 0, !10, i64 16}
!24 = !{!"_ZTSSt6vectorIN3jet11BoundingBoxIdLm2EEESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIN3jet11BoundingBoxIdLm2EEESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN3jet11BoundingBoxIdLm2EEESaIS2_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN3jet11BoundingBoxIdLm2EEESaIS2_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!28 = !{!"_ZTSSt6vectorIN3jet4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIN3jet4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIN3jet4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN3jet4Bvh2ISt10shared_ptrINS0_16ImplicitSurface2EEE4NodeESaIS6_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!35, !35, i64 0}
!35 = !{!"vtable pointer", !13, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}


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