; LLVM IR from ThePhysicsGuys/Physics3D :: application/picker/tools (attachmentTool)

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

%"struct.P3D::Application::Selection" = type { %"class.std::optional", %"class.std::vector" }
%"class.std::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base.base", [7 x i8] }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<P3D::BoundingBoxTemplate<double>>::_Storage", i8 }>
%"union.std::_Optional_payload_base<P3D::BoundingBoxTemplate<double>>::_Storage" = type { %"struct.P3D::BoundingBoxTemplate" }
%"struct.P3D::BoundingBoxTemplate" = type { %"struct.P3D::Vector", %"struct.P3D::Vector" }
%"struct.P3D::Vector" = type { %union.anon.0 }
%union.anon.0 = type { [3 x double] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.P3D::Application::Screen" = type { %"class.P3D::Engine::Registry", ptr, ptr, %"struct.P3D::Vector.17", %"struct.P3D::Application::Camera", %"class.P3D::Engine::LayerStack", %"class.P3D::Application::EventHandler", %"class.Util::Properties", %"class.std::shared_ptr", ptr, ptr }
%"class.P3D::Engine::Registry" = type <{ %"class.std::set", %"class.std::vector.7", %"class.std::unordered_map", %"class.std::queue", i32, [4 x i8] }>
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned long, unsigned long, std::_Identity<unsigned long>, P3D::Engine::Registry<unsigned long>::entity_compare>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned long, unsigned long, std::_Identity<unsigned long>, P3D::Engine::Registry<unsigned long>::entity_compare>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *, std::allocator<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *, std::allocator<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *, std::allocator<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *, std::allocator<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<unsigned int, std::allocator<unsigned int>>::_Deque_impl" }
%"struct.std::_Deque_base<unsigned int, std::allocator<unsigned int>>::_Deque_impl" = type { %"struct.std::_Deque_base<unsigned int, std::allocator<unsigned int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<unsigned int, std::allocator<unsigned int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.P3D::Vector.17" = type { %union.anon.18 }
%union.anon.18 = type { [2 x i32] }
%"struct.P3D::Application::Camera" = type { i8, double, double, %"struct.P3D::Vector", i8, double, double, %"struct.P3D::Vector", i8, i8, %"class.P3D::GlobalCFrame", double, double, i8, double, float, float, float, float, %"class.P3D::Matrix.20", %"class.P3D::Matrix.20", %"class.P3D::Matrix.20", %"class.P3D::Matrix.20", %"class.P3D::Matrix.20", ptr }
%"class.P3D::GlobalCFrame" = type { %"struct.P3D::PositionTemplate", %"class.P3D::MatrixRotationTemplate" }
%"struct.P3D::PositionTemplate" = type { %"struct.P3D::Fix", %"struct.P3D::Fix", %"struct.P3D::Fix" }
%"struct.P3D::Fix" = type { i64 }
%"class.P3D::MatrixRotationTemplate" = type { %"class.P3D::Matrix" }
%"class.P3D::Matrix" = type { [9 x double] }
%"class.P3D::Matrix.20" = type { [16 x float] }
%"class.P3D::Engine::LayerStack" = type <{ %"class.std::vector.21", i32, [4 x i8] }>
%"class.std::vector.21" = type { %"struct.std::_Vector_base.22" }
%"struct.std::_Vector_base.22" = type { %"struct.std::_Vector_base<P3D::Engine::Layer *, std::allocator<P3D::Engine::Layer *>>::_Vector_impl" }
%"struct.std::_Vector_base<P3D::Engine::Layer *, std::allocator<P3D::Engine::Layer *>>::_Vector_impl" = type { %"struct.std::_Vector_base<P3D::Engine::Layer *, std::allocator<P3D::Engine::Layer *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<P3D::Engine::Layer *, std::allocator<P3D::Engine::Layer *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.P3D::Application::EventHandler" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.Util::Properties" = type { %"class.std::__cxx11::basic_string", %"class.std::map" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::map" = type { %"class.std::_Rb_tree.26" }
%"class.std::_Rb_tree.26" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.P3D::intrusive_ptr" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.P3D::CFrameTemplate" = type { %"struct.P3D::Vector", %"class.P3D::MatrixRotationTemplate" }
%"class.std::allocator" = type { i8 }
%"struct.P3D::Application::Comp::Collider" = type { %"struct.P3D::RC", ptr }
%"struct.P3D::RC" = type { ptr, i64 }

@_ZN3P3D11Application13SelectionTool9selectionE = external global %"struct.P3D::Application::Selection", align 8
@_ZN3P3D11Application6screenE = external global %"class.P3D::Application::Screen", align 8
@_ZTISt16invalid_argument = external constant ptr

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

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

; 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 @_ZN3P3D11Application14AttachmentTool15attachSelectionEv() #2 align 2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.P3D::intrusive_ptr", align 8
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.P3D::intrusive_ptr", align 8
  %10 = alloca %"struct.P3D::CFrameTemplate", align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator", align 1
  %14 = call noundef i64 @_ZNK3P3D11Application9Selection4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @_ZN3P3D11Application13SelectionTool9selectionE)
  %15 = icmp ult i64 %14, 2
  br i1 %15, label %16, label %17

16:                                               ; preds = %0
  br label %129

17:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #8
  %18 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D11Application9SelectionixEi(ptr noundef nonnull align 8 dereferenceable(80) @_ZN3P3D11Application13SelectionTool9selectionE, i32 noundef 0)
  call void @_ZN3P3D6Engine8RegistryImE3getINS_11Application4Comp8ColliderEEENS_13intrusive_ptrIT_EERKj(ptr dead_on_unwind writable sret(%"class.P3D::intrusive_ptr") align 8 %1, ptr noundef nonnull align 8 dereferenceable(212) @_ZN3P3D11Application6screenE, ptr noundef nonnull align 4 dereferenceable(4) %18) #8
  %19 = call noundef zeroext i1 @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEE7invalidEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #8
  br i1 %19, label %20, label %21

20:                                               ; preds = %17
  store i32 1, ptr %2, align 4
  br label %127

21:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  store ptr @_ZN3P3D11Application13SelectionTool9selectionE, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  %22 = invoke ptr @_ZN3P3D11Application9Selection5beginEv(ptr noundef nonnull align 8 dereferenceable(80) @_ZN3P3D11Application13SelectionTool9selectionE)
          to label %23 unwind label %31

23:                                               ; preds = %21
  %24 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %22, ptr %24, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %25 = invoke ptr @_ZN3P3D11Application9Selection3endEv(ptr noundef nonnull align 8 dereferenceable(80) @_ZN3P3D11Application13SelectionTool9selectionE)
          to label %26 unwind label %35

26:                                               ; preds = %23
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %25, ptr %27, align 8
  br label %28

28:                                               ; preds = %106, %26
  %29 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br i1 %29, label %39, label %30

30:                                               ; preds = %28
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %126

31:                                               ; preds = %21
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %5, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %6, align 4
  br label %125

35:                                               ; preds = %23
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %5, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %6, align 4
  br label %124

39:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  store ptr %40, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN3P3D6Engine8RegistryImE3getINS_11Application4Comp8ColliderEEENS_13intrusive_ptrIT_EERKj(ptr dead_on_unwind writable sret(%"class.P3D::intrusive_ptr") align 8 %9, ptr noundef nonnull align 8 dereferenceable(212) @_ZN3P3D11Application6screenE, ptr noundef nonnull align 4 dereferenceable(4) %41) #8
  %42 = call noundef zeroext i1 @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEE7invalidEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  store i32 3, ptr %2, align 4
  br label %100

44:                                               ; preds = %39
  %45 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  %46 = getelementptr inbounds %"struct.P3D::Application::Comp::Collider", ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #8
  %49 = getelementptr inbounds %"struct.P3D::Application::Comp::Collider", ptr %48, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  %51 = icmp eq ptr %47, %50
  br i1 %51, label %52, label %53

52:                                               ; preds = %44
  store i32 3, ptr %2, align 4
  br label %100

53:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 96, ptr %10) #8
  %54 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #8
  %55 = getelementptr inbounds %"struct.P3D::Application::Comp::Collider", ptr %54, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  %57 = invoke noundef nonnull align 8 dereferenceable(96) ptr @_ZNK3P3D4Part9getCFrameEv(ptr noundef nonnull align 8 dereferenceable(200) %56)
          to label %58 unwind label %74

58:                                               ; preds = %53
  %59 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  %60 = getelementptr inbounds %"struct.P3D::Application::Comp::Collider", ptr %59, i32 0, i32 1
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = invoke noundef nonnull align 8 dereferenceable(96) ptr @_ZNK3P3D4Part9getCFrameEv(ptr noundef nonnull align 8 dereferenceable(200) %61)
          to label %63 unwind label %74

63:                                               ; preds = %58
  invoke void @_ZNK3P3D12GlobalCFrame13globalToLocalERKS0_(ptr dead_on_unwind writable sret(%"struct.P3D::CFrameTemplate") align 8 %10, ptr noundef nonnull align 8 dereferenceable(96) %57, ptr noundef nonnull align 8 dereferenceable(96) %62)
          to label %64 unwind label %74

64:                                               ; preds = %63
  %65 = load ptr, ptr getelementptr inbounds (%"class.P3D::Application::Screen", ptr @_ZN3P3D11Application6screenE, i32 0, i32 2), align 8, !tbaa !13
  invoke void @_ZN3P3D16UpgradeableMutex4lockEv(ptr noundef nonnull align 8 dereferenceable(96) %65)
          to label %66 unwind label %74

66:                                               ; preds = %64
  %67 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #8
  %68 = getelementptr inbounds %"struct.P3D::Application::Comp::Collider", ptr %67, i32 0, i32 1
  %69 = load ptr, ptr %68, align 8, !tbaa !9
  %70 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  %71 = getelementptr inbounds %"struct.P3D::Application::Comp::Collider", ptr %70, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  invoke void @_ZN3P3D4Part6attachEPS0_RKNS_14CFrameTemplateIdEE(ptr noundef nonnull align 8 dereferenceable(200) %69, ptr noundef %72, ptr noundef nonnull align 8 dereferenceable(96) %10)
          to label %73 unwind label %78

73:                                               ; preds = %66
  br label %97

74:                                               ; preds = %97, %64, %63, %58, %53
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %5, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %6, align 4
  br label %123

78:                                               ; preds = %66
  %79 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt16invalid_argument
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %5, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %6, align 4
  br label %82

82:                                               ; preds = %78
  %83 = load i32, ptr %6, align 4
  %84 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt16invalid_argument) #8
  %85 = icmp eq i32 %83, %84
  br i1 %85, label %86, label %123

86:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %87 = load ptr, ptr %5, align 8
  %88 = call ptr @__cxa_begin_catch(ptr %87) #8
  store ptr %88, ptr %11, align 8
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = load ptr, ptr %89, align 8, !tbaa !68
  %91 = getelementptr inbounds ptr, ptr %90, i64 2
  %92 = load ptr, ptr %91, align 8
  %93 = call noundef ptr %92(ptr noundef nonnull align 8 dereferenceable(16) %89) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef %93, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %94 unwind label %108

94:                                               ; preds = %86
  invoke void (ptr, ...) @_ZN3Log5debugENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEz(ptr noundef %12)
          to label %95 unwind label %112

95:                                               ; preds = %94
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #8
  invoke void @__cxa_end_catch()
          to label %96 unwind label %117

96:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %97

97:                                               ; preds = %96, %73
  %98 = load ptr, ptr getelementptr inbounds (%"class.P3D::Application::Screen", ptr @_ZN3P3D11Application6screenE, i32 0, i32 2), align 8, !tbaa !13
  invoke void @_ZN3P3D16UpgradeableMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(96) %98)
          to label %99 unwind label %74

99:                                               ; preds = %97
  call void @llvm.lifetime.end.p0(i64 96, ptr %10) #8
  store i32 0, ptr %2, align 4
  br label %100

100:                                              ; preds = %99, %52, %43
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  %101 = load i32, ptr %2, align 4
  switch i32 %101, label %103 [
    i32 0, label %102
  ]

102:                                              ; preds = %100
  store i32 0, ptr %2, align 4
  br label %103

103:                                              ; preds = %102, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  %104 = load i32, ptr %2, align 4
  switch i32 %104, label %138 [
    i32 0, label %105
    i32 3, label %106
  ]

105:                                              ; preds = %103
  br label %106

106:                                              ; preds = %105, %103
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br label %28

108:                                              ; preds = %86
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %5, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %6, align 4
  br label %116

112:                                              ; preds = %94
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %5, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %6, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  br label %116

116:                                              ; preds = %112, %108
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #8
  invoke void @__cxa_end_catch()
          to label %121 unwind label %135

117:                                              ; preds = %95
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %5, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %6, align 4
  br label %122

121:                                              ; preds = %116
  br label %122

122:                                              ; preds = %121, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %123

123:                                              ; preds = %122, %82, %74
  call void @llvm.lifetime.end.p0(i64 96, ptr %10) #8
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %124

124:                                              ; preds = %123, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %125

125:                                              ; preds = %124, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #8
  br label %130

126:                                              ; preds = %30
  store i32 0, ptr %2, align 4
  br label %127

127:                                              ; preds = %126, %20
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #8
  %128 = load i32, ptr %2, align 4
  switch i32 %128, label %138 [
    i32 0, label %129
    i32 1, label %129
  ]

129:                                              ; preds = %127, %127, %16
  ret void

130:                                              ; preds = %125
  %131 = load ptr, ptr %5, align 8
  %132 = load i32, ptr %6, align 4
  %133 = insertvalue { ptr, i32 } poison, ptr %131, 0
  %134 = insertvalue { ptr, i32 } %133, i32 %132, 1
  resume { ptr, i32 } %134

135:                                              ; preds = %116
  %136 = landingpad { ptr, i32 }
          catch ptr null
  %137 = extractvalue { ptr, i32 } %136, 0
  call void @__clang_call_terminate(ptr %137) #9
  unreachable

138:                                              ; preds = %127, %103
  unreachable
}

declare noundef i64 @_ZNK3P3D11Application9Selection4sizeEv(ptr noundef nonnull align 8 dereferenceable(80)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D6Engine8RegistryImE3getINS_11Application4Comp8ColliderEEENS_13intrusive_ptrIT_EERKj(ptr dead_on_unwind noalias writable sret(%"class.P3D::intrusive_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(212), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D11Application9SelectionixEi(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef) #3

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

declare ptr @_ZN3P3D11Application9Selection5beginEv(ptr noundef nonnull align 8 dereferenceable(80)) #3

declare ptr @_ZN3P3D11Application9Selection3endEv(ptr noundef nonnull align 8 dereferenceable(80)) #3

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3P3D12GlobalCFrame13globalToLocalERKS0_(ptr dead_on_unwind noalias writable sret(%"struct.P3D::CFrameTemplate") align 8, ptr noundef nonnull align 8 dereferenceable(96), ptr noundef nonnull align 8 dereferenceable(96)) #5 align 2

declare void @_ZN3P3D16UpgradeableMutex4lockEv(ptr noundef nonnull align 8 dereferenceable(96)) #3

declare void @_ZN3P3D4Part6attachEPS0_RKNS_14CFrameTemplateIdEE(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef, ptr noundef nonnull align 8 dereferenceable(96)) #3

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_begin_catch(ptr)

declare void @_ZN3Log5debugENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEz(ptr noundef, ...) #3

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

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

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #7

declare void @_ZN3P3D16UpgradeableMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(96)) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 = { 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 #5 = { 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 #6 = { nounwind memory(none) }
attributes #7 = { noinline noreturn nounwind uwtable "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 #8 = { nounwind }
attributes #9 = { noreturn 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, !6, i64 16}
!10 = !{!"_ZTSN3P3D11Application4Comp8ColliderE", !11, i64 0, !6, i64 16}
!11 = !{!"_ZTSN3P3D2RCE", !12, i64 8}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 224}
!14 = !{!"_ZTSN3P3D11Application6ScreenE", !15, i64 0, !6, i64 216, !6, i64 224, !40, i64 232, !41, i64 240, !51, i64 816, !56, i64 848, !57, i64 912, !65, i64 992, !6, i64 1008, !6, i64 1016}
!15 = !{!"_ZTSN3P3D6Engine8RegistryImEE", !16, i64 0, !24, i64 48, !28, i64 72, !33, i64 128, !39, i64 208}
!16 = !{!"_ZTSSt3setImN3P3D6Engine8RegistryImE14entity_compareESaImEE", !17, i64 0}
!17 = !{!"_ZTSSt8_Rb_treeImmSt9_IdentityImEN3P3D6Engine8RegistryImE14entity_compareESaImEE", !18, i64 0}
!18 = !{!"_ZTSNSt8_Rb_treeImmSt9_IdentityImEN3P3D6Engine8RegistryImE14entity_compareESaImEE13_Rb_tree_implIS6_Lb1EEE", !19, i64 0, !21, i64 8}
!19 = !{!"_ZTSSt20_Rb_tree_key_compareIN3P3D6Engine8RegistryImE14entity_compareEE", !20, i64 0}
!20 = !{!"_ZTSN3P3D6Engine8RegistryImE14entity_compareE"}
!21 = !{!"_ZTSSt15_Rb_tree_header", !22, i64 0, !12, i64 32}
!22 = !{!"_ZTSSt18_Rb_tree_node_base", !23, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!23 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!24 = !{!"_ZTSSt6vectorIPSt18unordered_multimapIjN3P3D13intrusive_ptrINS1_2RCEEESt4hashIjESt8equal_toIjESaISt4pairIKjS4_EEESaISE_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIPSt18unordered_multimapIjN3P3D13intrusive_ptrINS1_2RCEEESt4hashIjESt8equal_toIjESaISt4pairIKjS4_EEESaISE_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIPSt18unordered_multimapIjN3P3D13intrusive_ptrINS1_2RCEEESt4hashIjESt8equal_toIjESaISt4pairIKjS4_EEESaISE_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIPSt18unordered_multimapIjN3P3D13intrusive_ptrINS1_2RCEEESt4hashIjESt8equal_toIjESaISt4pairIKjS4_EEESaISE_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!"_ZTSSt13unordered_mapItNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4hashItESt8equal_toItESaISt4pairIKtS5_EEE", !29, i64 0}
!29 = !{!"_ZTSSt10_HashtableItSt4pairIKtNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESaIS8_ENSt8__detail10_Select1stESt8equal_toItESt4hashItENSA_18_Mod_range_hashingENSA_20_Default_ranged_hashENSA_20_Prime_rehash_policyENSA_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !12, i64 8, !30, i64 16, !12, i64 24, !31, i64 32, !6, i64 48}
!30 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!31 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !32, i64 0, !12, i64 8}
!32 = !{!"float", !7, i64 0}
!33 = !{!"_ZTSSt5queueIjSt5dequeIjSaIjEEE", !34, i64 0}
!34 = !{!"_ZTSSt5dequeIjSaIjEE", !35, i64 0}
!35 = !{!"_ZTSSt11_Deque_baseIjSaIjEE", !36, i64 0}
!36 = !{!"_ZTSNSt11_Deque_baseIjSaIjEE11_Deque_implE", !37, i64 0}
!37 = !{!"_ZTSNSt11_Deque_baseIjSaIjEE16_Deque_impl_dataE", !6, i64 0, !12, i64 8, !38, i64 16, !38, i64 48}
!38 = !{!"_ZTSSt15_Deque_iteratorIjRjPjE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!39 = !{!"int", !7, i64 0}
!40 = !{!"_ZTSN3P3D6VectorIiLm2EEE", !7, i64 0}
!41 = !{!"_ZTSN3P3D11Application6CameraE", !7, i64 0, !42, i64 8, !42, i64 16, !43, i64 24, !44, i64 48, !42, i64 56, !42, i64 64, !43, i64 72, !44, i64 96, !44, i64 97, !45, i64 104, !42, i64 200, !42, i64 208, !44, i64 216, !42, i64 224, !32, i64 232, !32, i64 236, !32, i64 240, !32, i64 244, !50, i64 248, !50, i64 312, !50, i64 376, !50, i64 440, !50, i64 504, !6, i64 568}
!42 = !{!"double", !7, i64 0}
!43 = !{!"_ZTSN3P3D6VectorIdLm3EEE", !7, i64 0}
!44 = !{!"bool", !7, i64 0}
!45 = !{!"_ZTSN3P3D12GlobalCFrameE", !46, i64 0, !48, i64 24}
!46 = !{!"_ZTSN3P3D16PositionTemplateINS_3FixILl32EEEEE", !47, i64 0, !47, i64 8, !47, i64 16}
!47 = !{!"_ZTSN3P3D3FixILl32EEE", !12, i64 0}
!48 = !{!"_ZTSN3P3D22MatrixRotationTemplateIdEE", !49, i64 0}
!49 = !{!"_ZTSN3P3D6MatrixIdLm3ELm3EEE", !7, i64 0}
!50 = !{!"_ZTSN3P3D6MatrixIfLm4ELm4EEE", !7, i64 0}
!51 = !{!"_ZTSN3P3D6Engine10LayerStackE", !52, i64 0, !39, i64 24}
!52 = !{!"_ZTSSt6vectorIPN3P3D6Engine5LayerESaIS3_EE", !53, i64 0}
!53 = !{!"_ZTSSt12_Vector_baseIPN3P3D6Engine5LayerESaIS3_EE", !54, i64 0}
!54 = !{!"_ZTSNSt12_Vector_baseIPN3P3D6Engine5LayerESaIS3_EE12_Vector_implE", !55, i64 0}
!55 = !{!"_ZTSNSt12_Vector_baseIPN3P3D6Engine5LayerESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!56 = !{!"_ZTSN3P3D11Application12EventHandlerE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!57 = !{!"_ZTSN4Util10PropertiesE", !58, i64 0, !60, i64 32}
!58 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !59, i64 0, !12, i64 8, !7, i64 16}
!59 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!60 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St4lessIS5_ESaISt4pairIKS5_S5_EEE", !61, i64 0}
!61 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_S5_ESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE", !62, i64 0}
!62 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_S5_ESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE13_Rb_tree_implISC_Lb1EEE", !63, i64 0, !21, i64 8}
!63 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !64, i64 0}
!64 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!65 = !{!"_ZTSSt10shared_ptrIN3P3D8Graphics11FrameBufferEE", !66, i64 0}
!66 = !{!"_ZTSSt12__shared_ptrIN3P3D8Graphics11FrameBufferELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !67, i64 8}
!67 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!68 = !{!69, !69, i64 0}
!69 = !{!"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"

%"struct.P3D::Application::Selection" = type { %"class.std::optional", %"class.std::vector" }
%"class.std::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base.base", [7 x i8] }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<P3D::BoundingBoxTemplate<double>>::_Storage", i8 }>
%"union.std::_Optional_payload_base<P3D::BoundingBoxTemplate<double>>::_Storage" = type { %"struct.P3D::BoundingBoxTemplate" }
%"struct.P3D::BoundingBoxTemplate" = type { %"struct.P3D::Vector", %"struct.P3D::Vector" }
%"struct.P3D::Vector" = type { %union.anon.0 }
%union.anon.0 = type { [3 x double] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.P3D::Application::Screen" = type { %"class.P3D::Engine::Registry", ptr, ptr, %"struct.P3D::Vector.17", %"struct.P3D::Application::Camera", %"class.P3D::Engine::LayerStack", %"class.P3D::Application::EventHandler", %"class.Util::Properties", %"class.std::shared_ptr", ptr, ptr }
%"class.P3D::Engine::Registry" = type <{ %"class.std::set", %"class.std::vector.7", %"class.std::unordered_map", %"class.std::queue", i32, [4 x i8] }>
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned long, unsigned long, std::_Identity<unsigned long>, P3D::Engine::Registry<unsigned long>::entity_compare>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned long, unsigned long, std::_Identity<unsigned long>, P3D::Engine::Registry<unsigned long>::entity_compare>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *, std::allocator<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *, std::allocator<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *, std::allocator<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *, std::allocator<std::unordered_multimap<unsigned int, P3D::intrusive_ptr<P3D::RC>> *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<unsigned int, std::allocator<unsigned int>>::_Deque_impl" }
%"struct.std::_Deque_base<unsigned int, std::allocator<unsigned int>>::_Deque_impl" = type { %"struct.std::_Deque_base<unsigned int, std::allocator<unsigned int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<unsigned int, std::allocator<unsigned int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.P3D::Vector.17" = type { %union.anon.18 }
%union.anon.18 = type { [2 x i32] }
%"struct.P3D::Application::Camera" = type { i8, double, double, %"struct.P3D::Vector", i8, double, double, %"struct.P3D::Vector", i8, i8, %"class.P3D::GlobalCFrame", double, double, i8, double, float, float, float, float, %"class.P3D::Matrix.20", %"class.P3D::Matrix.20", %"class.P3D::Matrix.20", %"class.P3D::Matrix.20", %"class.P3D::Matrix.20", ptr }
%"class.P3D::GlobalCFrame" = type { %"struct.P3D::PositionTemplate", %"class.P3D::MatrixRotationTemplate" }
%"struct.P3D::PositionTemplate" = type { %"struct.P3D::Fix", %"struct.P3D::Fix", %"struct.P3D::Fix" }
%"struct.P3D::Fix" = type { i64 }
%"class.P3D::MatrixRotationTemplate" = type { %"class.P3D::Matrix" }
%"class.P3D::Matrix" = type { [9 x double] }
%"class.P3D::Matrix.20" = type { [16 x float] }
%"class.P3D::Engine::LayerStack" = type <{ %"class.std::vector.21", i32, [4 x i8] }>
%"class.std::vector.21" = type { %"struct.std::_Vector_base.22" }
%"struct.std::_Vector_base.22" = type { %"struct.std::_Vector_base<P3D::Engine::Layer *, std::allocator<P3D::Engine::Layer *>>::_Vector_impl" }
%"struct.std::_Vector_base<P3D::Engine::Layer *, std::allocator<P3D::Engine::Layer *>>::_Vector_impl" = type { %"struct.std::_Vector_base<P3D::Engine::Layer *, std::allocator<P3D::Engine::Layer *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<P3D::Engine::Layer *, std::allocator<P3D::Engine::Layer *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.P3D::Application::EventHandler" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.Util::Properties" = type { %"class.std::__cxx11::basic_string", %"class.std::map" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::map" = type { %"class.std::_Rb_tree.26" }
%"class.std::_Rb_tree.26" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.P3D::intrusive_ptr" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.P3D::CFrameTemplate" = type { %"struct.P3D::Vector", %"class.P3D::MatrixRotationTemplate" }
%"class.std::allocator" = type { i8 }

@_ZN3P3D11Application13SelectionTool9selectionE = external global %"struct.P3D::Application::Selection", align 8
@_ZN3P3D11Application6screenE = external global %"class.P3D::Application::Screen", align 8
@_ZTISt16invalid_argument = external constant ptr

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

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

; 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 @_ZN3P3D11Application14AttachmentTool15attachSelectionEv() local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.P3D::intrusive_ptr", align 8
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.P3D::intrusive_ptr", align 8
  %5 = alloca %"struct.P3D::CFrameTemplate", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = tail call noundef i64 @_ZNK3P3D11Application9Selection4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @_ZN3P3D11Application13SelectionTool9selectionE)
  %9 = icmp ult i64 %8, 2
  br i1 %9, label %92, label %10

10:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %11 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D11Application9SelectionixEi(ptr noundef nonnull align 8 dereferenceable(80) @_ZN3P3D11Application13SelectionTool9selectionE, i32 noundef 0)
  call void @_ZN3P3D6Engine8RegistryImE3getINS_11Application4Comp8ColliderEEENS_13intrusive_ptrIT_EERKj(ptr dead_on_unwind nonnull writable sret(%"class.P3D::intrusive_ptr") align 8 %1, ptr noundef nonnull align 8 dereferenceable(212) @_ZN3P3D11Application6screenE, ptr noundef nonnull align 4 dereferenceable(4) %11) #8
  %12 = call noundef zeroext i1 @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEE7invalidEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #8
  br i1 %12, label %91, label %13

13:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %14 = invoke ptr @_ZN3P3D11Application9Selection5beginEv(ptr noundef nonnull align 8 dereferenceable(80) @_ZN3P3D11Application13SelectionTool9selectionE)
          to label %15 unwind label %19

15:                                               ; preds = %13
  store ptr %14, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %16 = invoke ptr @_ZN3P3D11Application9Selection3endEv(ptr noundef nonnull align 8 dereferenceable(80) @_ZN3P3D11Application13SelectionTool9selectionE)
          to label %17 unwind label %23

17:                                               ; preds = %15
  store ptr %16, ptr %3, align 8
  %18 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  br i1 %18, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %76, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  br label %91

19:                                               ; preds = %13
  %20 = landingpad { ptr, i32 }
          cleanup
  %21 = extractvalue { ptr, i32 } %20, 0
  %22 = extractvalue { ptr, i32 } %20, 1
  br label %88

23:                                               ; preds = %15
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  %26 = extractvalue { ptr, i32 } %24, 1
  br label %87

.lr.ph:                                           ; preds = %17, %76
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  call void @_ZN3P3D6Engine8RegistryImE3getINS_11Application4Comp8ColliderEEENS_13intrusive_ptrIT_EERKj(ptr dead_on_unwind nonnull writable sret(%"class.P3D::intrusive_ptr") align 8 %4, ptr noundef nonnull align 8 dereferenceable(212) @_ZN3P3D11Application6screenE, ptr noundef nonnull align 4 dereferenceable(4) %27) #8
  %28 = call noundef zeroext i1 @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEE7invalidEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br i1 %28, label %76, label %29

29:                                               ; preds = %.lr.ph
  %30 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #8
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  %36 = icmp eq ptr %32, %35
  br i1 %36, label %76, label %37

37:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %5) #8
  %38 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #8
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  %41 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNK3P3D4Part9getCFrameEv(ptr noundef nonnull align 8 dereferenceable(200) %40)
  %42 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNK3P3D4Part9getCFrameEv(ptr noundef nonnull align 8 dereferenceable(200) %44)
  invoke void @_ZNK3P3D12GlobalCFrame13globalToLocalERKS0_(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::CFrameTemplate") align 8 %5, ptr noundef nonnull align 8 dereferenceable(96) %41, ptr noundef nonnull align 8 dereferenceable(96) %45)
          to label %46 unwind label %55

46:                                               ; preds = %37
  %47 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN3P3D11Application6screenE, i64 224), align 8, !tbaa !12
  invoke void @_ZN3P3D16UpgradeableMutex4lockEv(ptr noundef nonnull align 8 dereferenceable(96) %47)
          to label %48 unwind label %55

48:                                               ; preds = %46
  %49 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #8
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  invoke void @_ZN3P3D4Part6attachEPS0_RKNS_14CFrameTemplateIdEE(ptr noundef nonnull align 8 dereferenceable(200) %51, ptr noundef %54, ptr noundef nonnull align 8 dereferenceable(96) %5)
          to label %73 unwind label %59

55:                                               ; preds = %73, %46, %37
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  %58 = extractvalue { ptr, i32 } %56, 1
  br label %.loopexit

59:                                               ; preds = %48
  %60 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt16invalid_argument
  %61 = extractvalue { ptr, i32 } %60, 0
  %62 = extractvalue { ptr, i32 } %60, 1
  %63 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt16invalid_argument) #8
  %64 = icmp eq i32 %62, %63
  br i1 %64, label %65, label %.loopexit

65:                                               ; preds = %59
  %66 = call ptr @__cxa_begin_catch(ptr %61) #8
  %67 = load ptr, ptr %66, align 8, !tbaa !67
  %68 = getelementptr inbounds i8, ptr %67, i64 16
  %69 = load ptr, ptr %68, align 8
  %70 = call noundef ptr %69(ptr noundef nonnull align 8 dereferenceable(16) %66) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef %70, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %71 unwind label %79

71:                                               ; preds = %65
  invoke void (ptr, ...) @_ZN3Log5debugENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEz(ptr noundef nonnull %6)
          to label %72 unwind label %81

72:                                               ; preds = %71
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #8
  invoke void @__cxa_end_catch()
          to label %73 unwind label %84

73:                                               ; preds = %72, %48
  %74 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN3P3D11Application6screenE, i64 224), align 8, !tbaa !12
  invoke void @_ZN3P3D16UpgradeableMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(96) %74)
          to label %75 unwind label %55

75:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %5) #8
  br label %76

76:                                               ; preds = %29, %.lr.ph, %75
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #8
  %78 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  br i1 %78, label %.lr.ph, label %._crit_edge

79:                                               ; preds = %65
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %83

81:                                               ; preds = %71
  %82 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  br label %83

83:                                               ; preds = %81, %79
  %.pn = phi { ptr, i32 } [ %82, %81 ], [ %80, %79 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #8
  invoke void @__cxa_end_catch()
          to label %86 unwind label %93

84:                                               ; preds = %72
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %86

86:                                               ; preds = %83, %84
  %.pn14 = phi { ptr, i32 } [ %85, %84 ], [ %.pn, %83 ]
  %.1 = extractvalue { ptr, i32 } %.pn14, 0
  %.18 = extractvalue { ptr, i32 } %.pn14, 1
  br label %.loopexit

.loopexit:                                        ; preds = %59, %86, %55
  %.29 = phi i32 [ %58, %55 ], [ %.18, %86 ], [ %62, %59 ]
  %.2 = phi ptr [ %57, %55 ], [ %.1, %86 ], [ %61, %59 ]
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %5) #8
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br label %87

87:                                               ; preds = %.loopexit, %23
  %.310 = phi i32 [ %.29, %.loopexit ], [ %26, %23 ]
  %.3 = phi ptr [ %.2, %.loopexit ], [ %25, %23 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  br label %88

88:                                               ; preds = %87, %19
  %.411 = phi i32 [ %.310, %87 ], [ %22, %19 ]
  %.4 = phi ptr [ %.3, %87 ], [ %21, %19 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  %89 = insertvalue { ptr, i32 } poison, ptr %.4, 0
  %90 = insertvalue { ptr, i32 } %89, i32 %.411, 1
  resume { ptr, i32 } %90

91:                                               ; preds = %10, %._crit_edge
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  br label %92

92:                                               ; preds = %0, %91
  ret void

93:                                               ; preds = %83
  %94 = landingpad { ptr, i32 }
          catch ptr null
  %95 = extractvalue { ptr, i32 } %94, 0
  call void @__clang_call_terminate(ptr %95) #9
  unreachable
}

declare noundef i64 @_ZNK3P3D11Application9Selection4sizeEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D6Engine8RegistryImE3getINS_11Application4Comp8ColliderEEENS_13intrusive_ptrIT_EERKj(ptr dead_on_unwind noalias writable sret(%"class.P3D::intrusive_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(212), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D11Application9SelectionixEi(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef) local_unnamed_addr #3

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

declare ptr @_ZN3P3D11Application9Selection5beginEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3

declare ptr @_ZN3P3D11Application9Selection3endEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(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(96) ptr @_ZNK3P3D4Part9getCFrameEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3P3D12GlobalCFrame13globalToLocalERKS0_(ptr dead_on_unwind noalias writable sret(%"struct.P3D::CFrameTemplate") align 8, ptr noundef nonnull align 8 dereferenceable(96), ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #5 align 2

declare void @_ZN3P3D16UpgradeableMutex4lockEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #3

declare void @_ZN3P3D4Part6attachEPS0_RKNS_14CFrameTemplateIdEE(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef, ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #3

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @_ZN3Log5debugENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEz(ptr noundef, ...) local_unnamed_addr #3

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

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

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #7

declare void @_ZN3P3D16UpgradeableMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 = { 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 #5 = { 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 #6 = { nofree nosync nounwind memory(none) }
attributes #7 = { noinline noreturn nounwind uwtable "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 #8 = { nounwind }
attributes #9 = { noreturn 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, !11, i64 16}
!6 = !{!"_ZTSN3P3D11Application4Comp8ColliderE", !7, i64 0, !11, i64 16}
!7 = !{!"_ZTSN3P3D2RCE", !8, i64 8}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!13, !11, i64 224}
!13 = !{!"_ZTSN3P3D11Application6ScreenE", !14, i64 0, !11, i64 216, !11, i64 224, !39, i64 232, !40, i64 240, !50, i64 816, !55, i64 848, !56, i64 912, !64, i64 992, !11, i64 1008, !11, i64 1016}
!14 = !{!"_ZTSN3P3D6Engine8RegistryImEE", !15, i64 0, !23, i64 48, !27, i64 72, !32, i64 128, !38, i64 208}
!15 = !{!"_ZTSSt3setImN3P3D6Engine8RegistryImE14entity_compareESaImEE", !16, i64 0}
!16 = !{!"_ZTSSt8_Rb_treeImmSt9_IdentityImEN3P3D6Engine8RegistryImE14entity_compareESaImEE", !17, i64 0}
!17 = !{!"_ZTSNSt8_Rb_treeImmSt9_IdentityImEN3P3D6Engine8RegistryImE14entity_compareESaImEE13_Rb_tree_implIS6_Lb1EEE", !18, i64 0, !20, i64 8}
!18 = !{!"_ZTSSt20_Rb_tree_key_compareIN3P3D6Engine8RegistryImE14entity_compareEE", !19, i64 0}
!19 = !{!"_ZTSN3P3D6Engine8RegistryImE14entity_compareE"}
!20 = !{!"_ZTSSt15_Rb_tree_header", !21, i64 0, !8, i64 32}
!21 = !{!"_ZTSSt18_Rb_tree_node_base", !22, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!22 = !{!"_ZTSSt14_Rb_tree_color", !9, i64 0}
!23 = !{!"_ZTSSt6vectorIPSt18unordered_multimapIjN3P3D13intrusive_ptrINS1_2RCEEESt4hashIjESt8equal_toIjESaISt4pairIKjS4_EEESaISE_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIPSt18unordered_multimapIjN3P3D13intrusive_ptrINS1_2RCEEESt4hashIjESt8equal_toIjESaISt4pairIKjS4_EEESaISE_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIPSt18unordered_multimapIjN3P3D13intrusive_ptrINS1_2RCEEESt4hashIjESt8equal_toIjESaISt4pairIKjS4_EEESaISE_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIPSt18unordered_multimapIjN3P3D13intrusive_ptrINS1_2RCEEESt4hashIjESt8equal_toIjESaISt4pairIKjS4_EEESaISE_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!27 = !{!"_ZTSSt13unordered_mapItNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4hashItESt8equal_toItESaISt4pairIKtS5_EEE", !28, i64 0}
!28 = !{!"_ZTSSt10_HashtableItSt4pairIKtNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESaIS8_ENSt8__detail10_Select1stESt8equal_toItESt4hashItENSA_18_Mod_range_hashingENSA_20_Default_ranged_hashENSA_20_Prime_rehash_policyENSA_17_Hashtable_traitsILb0ELb0ELb1EEEE", !11, i64 0, !8, i64 8, !29, i64 16, !8, i64 24, !30, i64 32, !11, i64 48}
!29 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !11, i64 0}
!30 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !31, i64 0, !8, i64 8}
!31 = !{!"float", !9, i64 0}
!32 = !{!"_ZTSSt5queueIjSt5dequeIjSaIjEEE", !33, i64 0}
!33 = !{!"_ZTSSt5dequeIjSaIjEE", !34, i64 0}
!34 = !{!"_ZTSSt11_Deque_baseIjSaIjEE", !35, i64 0}
!35 = !{!"_ZTSNSt11_Deque_baseIjSaIjEE11_Deque_implE", !36, i64 0}
!36 = !{!"_ZTSNSt11_Deque_baseIjSaIjEE16_Deque_impl_dataE", !11, i64 0, !8, i64 8, !37, i64 16, !37, i64 48}
!37 = !{!"_ZTSSt15_Deque_iteratorIjRjPjE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!38 = !{!"int", !9, i64 0}
!39 = !{!"_ZTSN3P3D6VectorIiLm2EEE", !9, i64 0}
!40 = !{!"_ZTSN3P3D11Application6CameraE", !9, i64 0, !41, i64 8, !41, i64 16, !42, i64 24, !43, i64 48, !41, i64 56, !41, i64 64, !42, i64 72, !43, i64 96, !43, i64 97, !44, i64 104, !41, i64 200, !41, i64 208, !43, i64 216, !41, i64 224, !31, i64 232, !31, i64 236, !31, i64 240, !31, i64 244, !49, i64 248, !49, i64 312, !49, i64 376, !49, i64 440, !49, i64 504, !11, i64 568}
!41 = !{!"double", !9, i64 0}
!42 = !{!"_ZTSN3P3D6VectorIdLm3EEE", !9, i64 0}
!43 = !{!"bool", !9, i64 0}
!44 = !{!"_ZTSN3P3D12GlobalCFrameE", !45, i64 0, !47, i64 24}
!45 = !{!"_ZTSN3P3D16PositionTemplateINS_3FixILl32EEEEE", !46, i64 0, !46, i64 8, !46, i64 16}
!46 = !{!"_ZTSN3P3D3FixILl32EEE", !8, i64 0}
!47 = !{!"_ZTSN3P3D22MatrixRotationTemplateIdEE", !48, i64 0}
!48 = !{!"_ZTSN3P3D6MatrixIdLm3ELm3EEE", !9, i64 0}
!49 = !{!"_ZTSN3P3D6MatrixIfLm4ELm4EEE", !9, i64 0}
!50 = !{!"_ZTSN3P3D6Engine10LayerStackE", !51, i64 0, !38, i64 24}
!51 = !{!"_ZTSSt6vectorIPN3P3D6Engine5LayerESaIS3_EE", !52, i64 0}
!52 = !{!"_ZTSSt12_Vector_baseIPN3P3D6Engine5LayerESaIS3_EE", !53, i64 0}
!53 = !{!"_ZTSNSt12_Vector_baseIPN3P3D6Engine5LayerESaIS3_EE12_Vector_implE", !54, i64 0}
!54 = !{!"_ZTSNSt12_Vector_baseIPN3P3D6Engine5LayerESaIS3_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!55 = !{!"_ZTSN3P3D11Application12EventHandlerE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56}
!56 = !{!"_ZTSN4Util10PropertiesE", !57, i64 0, !59, i64 32}
!57 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !58, i64 0, !8, i64 8, !9, i64 16}
!58 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !11, i64 0}
!59 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St4lessIS5_ESaISt4pairIKS5_S5_EEE", !60, i64 0}
!60 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_S5_ESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE", !61, i64 0}
!61 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_S5_ESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE13_Rb_tree_implISC_Lb1EEE", !62, i64 0, !20, i64 8}
!62 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !63, i64 0}
!63 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!64 = !{!"_ZTSSt10shared_ptrIN3P3D8Graphics11FrameBufferEE", !65, i64 0}
!65 = !{!"_ZTSSt12__shared_ptrIN3P3D8Graphics11FrameBufferELN9__gnu_cxx12_Lock_policyE2EE", !11, i64 0, !66, i64 8}
!66 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !11, i64 0}
!67 = !{!68, !68, i64 0}
!68 = !{!"vtable pointer", !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass