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

; 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 @_ZN3P3D11Application19MotorConstraintTool18constrainSelectionEv() #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 %"struct.P3D::CFrameTemplate", align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::allocator", align 1
  %16 = call noundef i64 @_ZNK3P3D11Application9Selection4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @_ZN3P3D11Application13SelectionTool9selectionE)
  %17 = icmp ult i64 %16, 2
  br i1 %17, label %18, label %19

18:                                               ; preds = %0
  br label %145

19:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #10
  %20 = 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) %20) #10
  %21 = call noundef zeroext i1 @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEE7invalidEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #10
  br i1 %21, label %22, label %23

22:                                               ; preds = %19
  store i32 1, ptr %2, align 4
  br label %143

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

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

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

30:                                               ; preds = %121, %28
  %31 = 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) #10
  br i1 %31, label %41, label %32

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

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

37:                                               ; preds = %25
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %5, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %6, align 4
  br label %140

41:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #10
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #10
  store ptr %42, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #10
  %43 = 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) %43) #10
  %44 = call noundef zeroext i1 @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEE7invalidEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #10
  br i1 %44, label %45, label %46

45:                                               ; preds = %41
  store i32 3, ptr %2, align 4
  br label %115

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

54:                                               ; preds = %46
  store i32 3, ptr %2, align 4
  br label %115

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

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

65:                                               ; preds = %60
  invoke void @_ZNK3P3D12GlobalCFrame13globalToLocalERKS0_(ptr dead_on_unwind writable sret(%"struct.P3D::CFrameTemplate") align 8 %10, ptr noundef nonnull align 8 dereferenceable(96) %59, ptr noundef nonnull align 8 dereferenceable(96) %64)
          to label %66 unwind label %81

66:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #10
  %67 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 24) #11
          to label %68 unwind label %85

68:                                               ; preds = %66
  invoke void @_ZN3P3D23MotorConstraintTemplateINS_15ConstControllerEECI2NS_15ConstControllerEEd(ptr noundef nonnull align 8 dereferenceable(24) %67, double noundef 1.000000e+00)
          to label %69 unwind label %89

69:                                               ; preds = %68
  store ptr %67, ptr %11, align 8, !tbaa !5
  %70 = 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) %70)
          to label %71 unwind label %85

71:                                               ; preds = %69
  %72 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #10
  %73 = getelementptr inbounds %"struct.P3D::Application::Comp::Collider", ptr %72, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  %75 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #10
  %76 = getelementptr inbounds %"struct.P3D::Application::Comp::Collider", ptr %75, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 96, ptr %12) #10
  invoke void @_ZN3P3D14CFrameTemplateIdEC2Ev(ptr noundef nonnull align 8 dereferenceable(96) %12)
          to label %79 unwind label %93

79:                                               ; preds = %71
  invoke void @_ZN3P3D4Part6attachEPS0_PNS_14HardConstraintERKNS_14CFrameTemplateIdEES7_(ptr noundef nonnull align 8 dereferenceable(200) %74, ptr noundef %77, ptr noundef %78, ptr noundef nonnull align 8 dereferenceable(96) %10, ptr noundef nonnull align 8 dereferenceable(96) %12)
          to label %80 unwind label %93

80:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 96, ptr %12) #10
  br label %112

81:                                               ; preds = %65, %60, %55
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %5, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %6, align 4
  br label %139

85:                                               ; preds = %112, %69, %66
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %5, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %6, align 4
  br label %138

89:                                               ; preds = %68
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %5, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %67, i64 noundef 24) #12
  br label %138

93:                                               ; preds = %79, %71
  %94 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt16invalid_argument
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %5, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 96, ptr %12) #10
  br label %97

97:                                               ; preds = %93
  %98 = load i32, ptr %6, align 4
  %99 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt16invalid_argument) #10
  %100 = icmp eq i32 %98, %99
  br i1 %100, label %101, label %138

101:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  %102 = load ptr, ptr %5, align 8
  %103 = call ptr @__cxa_begin_catch(ptr %102) #10
  store ptr %103, ptr %13, align 8
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  %105 = load ptr, ptr %104, align 8, !tbaa !68
  %106 = getelementptr inbounds ptr, ptr %105, i64 2
  %107 = load ptr, ptr %106, align 8
  %108 = call noundef ptr %107(ptr noundef nonnull align 8 dereferenceable(16) %104) #10
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #10
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #10
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef %108, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %109 unwind label %123

109:                                              ; preds = %101
  invoke void (ptr, ...) @_ZN3Log5debugENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEz(ptr noundef %14)
          to label %110 unwind label %127

110:                                              ; preds = %109
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #10
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #10
  invoke void @__cxa_end_catch()
          to label %111 unwind label %132

111:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  br label %112

112:                                              ; preds = %111, %80
  %113 = 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) %113)
          to label %114 unwind label %85

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

115:                                              ; preds = %114, %54, %45
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #10
  %116 = load i32, ptr %2, align 4
  switch i32 %116, label %118 [
    i32 0, label %117
  ]

117:                                              ; preds = %115
  store i32 0, ptr %2, align 4
  br label %118

118:                                              ; preds = %117, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  %119 = load i32, ptr %2, align 4
  switch i32 %119, label %154 [
    i32 0, label %120
    i32 3, label %121
  ]

120:                                              ; preds = %118
  br label %121

121:                                              ; preds = %120, %118
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #10
  br label %30

123:                                              ; preds = %101
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %5, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %6, align 4
  br label %131

127:                                              ; preds = %109
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %5, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %6, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #10
  br label %131

131:                                              ; preds = %127, %123
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #10
  invoke void @__cxa_end_catch()
          to label %136 unwind label %151

132:                                              ; preds = %110
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %5, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %6, align 4
  br label %137

136:                                              ; preds = %131
  br label %137

137:                                              ; preds = %136, %132
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  br label %138

138:                                              ; preds = %137, %97, %89, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  br label %139

139:                                              ; preds = %138, %81
  call void @llvm.lifetime.end.p0(i64 96, ptr %10) #10
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  br label %140

140:                                              ; preds = %139, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  br label %141

141:                                              ; preds = %140, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #10
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #10
  br label %146

142:                                              ; preds = %32
  store i32 0, ptr %2, align 4
  br label %143

143:                                              ; preds = %142, %22
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #10
  %144 = load i32, ptr %2, align 4
  switch i32 %144, label %154 [
    i32 0, label %145
    i32 1, label %145
  ]

145:                                              ; preds = %143, %143, %18
  ret void

146:                                              ; preds = %141
  %147 = load ptr, ptr %5, align 8
  %148 = load i32, ptr %6, align 4
  %149 = insertvalue { ptr, i32 } poison, ptr %147, 0
  %150 = insertvalue { ptr, i32 } %149, i32 %148, 1
  resume { ptr, i32 } %150

151:                                              ; preds = %131
  %152 = landingpad { ptr, i32 }
          catch ptr null
  %153 = extractvalue { ptr, i32 } %152, 0
  call void @__clang_call_terminate(ptr %153) #13
  unreachable

154:                                              ; preds = %143, %118
  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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3P3D23MotorConstraintTemplateINS_15ConstControllerEECI2NS_15ConstControllerEEd(ptr noundef nonnull align 8 dereferenceable(24), double noundef) unnamed_addr #5 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #7

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

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

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

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

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) #9

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 = { nobuiltin allocsize(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 #7 = { nobuiltin nounwind "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 memory(none) }
attributes #9 = { 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 #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { builtin nounwind }
attributes #13 = { 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 @_ZN3P3D11Application19MotorConstraintTool18constrainSelectionEv() 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 %"struct.P3D::CFrameTemplate", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = tail call noundef i64 @_ZNK3P3D11Application9Selection4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @_ZN3P3D11Application13SelectionTool9selectionE)
  %10 = icmp ult i64 %9, 2
  br i1 %10, label %106, label %11

11:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #10
  %12 = 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) %12) #10
  %13 = call noundef zeroext i1 @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEE7invalidEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #10
  br i1 %13, label %105, label %14

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

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

18:                                               ; preds = %16
  store ptr %17, ptr %3, align 8
  %19 = 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) #10
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %90, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #10
  br label %105

20:                                               ; preds = %14
  %21 = landingpad { ptr, i32 }
          cleanup
  %22 = extractvalue { ptr, i32 } %21, 0
  %23 = extractvalue { ptr, i32 } %21, 1
  br label %102

24:                                               ; preds = %16
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  %27 = extractvalue { ptr, i32 } %25, 1
  br label %101

.lr.ph:                                           ; preds = %18, %90
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #10
  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) %28) #10
  %29 = call noundef zeroext i1 @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEE7invalidEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #10
  br i1 %29, label %90, label %30

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

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

47:                                               ; preds = %38
  %48 = invoke noalias noundef nonnull dereferenceable(24) ptr @_Znwm(i64 noundef 24) #11
          to label %49 unwind label %65

49:                                               ; preds = %47
  invoke void @_ZN3P3D23MotorConstraintTemplateINS_15ConstControllerEECI2NS_15ConstControllerEEd(ptr noundef nonnull align 8 dereferenceable(24) %48, double noundef 1.000000e+00)
          to label %50 unwind label %69

50:                                               ; preds = %49
  %51 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN3P3D11Application6screenE, i64 224), align 8, !tbaa !12
  invoke void @_ZN3P3D16UpgradeableMutex4lockEv(ptr noundef nonnull align 8 dereferenceable(96) %51)
          to label %52 unwind label %65

52:                                               ; preds = %50
  %53 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #10
  %54 = getelementptr inbounds i8, ptr %53, i64 16
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  %56 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp8ColliderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #10
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %6) #10
  invoke void @_ZN3P3D14CFrameTemplateIdEC2Ev(ptr noundef nonnull align 8 dereferenceable(96) %6)
          to label %59 unwind label %73

59:                                               ; preds = %52
  invoke void @_ZN3P3D4Part6attachEPS0_PNS_14HardConstraintERKNS_14CFrameTemplateIdEES7_(ptr noundef nonnull align 8 dereferenceable(200) %55, ptr noundef %58, ptr noundef nonnull %48, ptr noundef nonnull align 8 dereferenceable(96) %5, ptr noundef nonnull align 8 dereferenceable(96) %6)
          to label %60 unwind label %73

60:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %6) #10
  br label %87

61:                                               ; preds = %38
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  %64 = extractvalue { ptr, i32 } %62, 1
  br label %.loopexit

65:                                               ; preds = %87, %50, %47
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  %68 = extractvalue { ptr, i32 } %66, 1
  br label %.loopexit

69:                                               ; preds = %49
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  %72 = extractvalue { ptr, i32 } %70, 1
  call void @_ZdlPvm(ptr noundef nonnull %48, i64 noundef 24) #12
  br label %.loopexit

73:                                               ; preds = %59, %52
  %74 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt16invalid_argument
  %75 = extractvalue { ptr, i32 } %74, 0
  %76 = extractvalue { ptr, i32 } %74, 1
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %6) #10
  %77 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt16invalid_argument) #10
  %78 = icmp eq i32 %76, %77
  br i1 %78, label %79, label %.loopexit

79:                                               ; preds = %73
  %80 = call ptr @__cxa_begin_catch(ptr %75) #10
  %81 = load ptr, ptr %80, align 8, !tbaa !67
  %82 = getelementptr inbounds i8, ptr %81, i64 16
  %83 = load ptr, ptr %82, align 8
  %84 = call noundef ptr %83(ptr noundef nonnull align 8 dereferenceable(16) %80) #10
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #10
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #10
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef %84, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %85 unwind label %93

85:                                               ; preds = %79
  invoke void (ptr, ...) @_ZN3Log5debugENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEz(ptr noundef nonnull %7)
          to label %86 unwind label %95

86:                                               ; preds = %85
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #10
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #10
  invoke void @__cxa_end_catch()
          to label %87 unwind label %98

87:                                               ; preds = %86, %60
  %88 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN3P3D11Application6screenE, i64 224), align 8, !tbaa !12
  invoke void @_ZN3P3D16UpgradeableMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(96) %88)
          to label %89 unwind label %65

89:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %5) #10
  br label %90

90:                                               ; preds = %30, %.lr.ph, %89
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #10
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #10
  %92 = 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) #10
  br i1 %92, label %.lr.ph, label %._crit_edge

93:                                               ; preds = %79
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %97

95:                                               ; preds = %85
  %96 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #10
  br label %97

97:                                               ; preds = %95, %93
  %.pn = phi { ptr, i32 } [ %96, %95 ], [ %94, %93 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #10
  invoke void @__cxa_end_catch()
          to label %100 unwind label %107

98:                                               ; preds = %86
  %99 = landingpad { ptr, i32 }
          cleanup
  br label %100

100:                                              ; preds = %97, %98
  %.pn16 = phi { ptr, i32 } [ %99, %98 ], [ %.pn, %97 ]
  %.1 = extractvalue { ptr, i32 } %.pn16, 0
  %.19 = extractvalue { ptr, i32 } %.pn16, 1
  br label %.loopexit

.loopexit:                                        ; preds = %73, %65, %69, %100, %61
  %.311 = phi i32 [ %64, %61 ], [ %68, %65 ], [ %.19, %100 ], [ %72, %69 ], [ %76, %73 ]
  %.3 = phi ptr [ %63, %61 ], [ %67, %65 ], [ %.1, %100 ], [ %71, %69 ], [ %75, %73 ]
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %5) #10
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #10
  br label %101

101:                                              ; preds = %.loopexit, %24
  %.412 = phi i32 [ %.311, %.loopexit ], [ %27, %24 ]
  %.4 = phi ptr [ %.3, %.loopexit ], [ %26, %24 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  br label %102

102:                                              ; preds = %101, %20
  %.513 = phi i32 [ %.412, %101 ], [ %23, %20 ]
  %.5 = phi ptr [ %.4, %101 ], [ %22, %20 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #10
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp8ColliderEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #10
  %103 = insertvalue { ptr, i32 } poison, ptr %.5, 0
  %104 = insertvalue { ptr, i32 } %103, i32 %.513, 1
  resume { ptr, i32 } %104

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

106:                                              ; preds = %0, %105
  ret void

107:                                              ; preds = %97
  %108 = landingpad { ptr, i32 }
          catch ptr null
  %109 = extractvalue { ptr, i32 } %108, 0
  call void @__clang_call_terminate(ptr %109) #13
  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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3P3D23MotorConstraintTemplateINS_15ConstControllerEECI2NS_15ConstControllerEEd(ptr noundef nonnull align 8 dereferenceable(24), double noundef) unnamed_addr #5 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #7

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

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

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

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

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 #9

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 = { nobuiltin allocsize(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 #7 = { nobuiltin nounwind "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 = { nofree nosync nounwind memory(none) }
attributes #9 = { 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 #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { builtin nounwind }
attributes #13 = { 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: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass