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

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

%"class.P3D::Application::Screen" = type { %"class.P3D::Engine::Registry", ptr, ptr, %"struct.P3D::Vector.13", %"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.3", %"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.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = 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.13" = type { %union.anon.14 }
%union.anon.14 = 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.16", %"class.P3D::Matrix.16", %"class.P3D::Matrix.16", %"class.P3D::Matrix.16", %"class.P3D::Matrix.16", ptr }
%"struct.P3D::Vector" = type { %union.anon }
%union.anon = type { [3 x double] }
%"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.16" = type { [16 x float] }
%"class.P3D::Engine::LayerStack" = type <{ %"class.std::vector.17", i32, [4 x i8] }>
%"class.std::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = 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.25 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.25 = 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.std::optional.81" = type { %"struct.std::_Optional_base.82" }
%"struct.std::_Optional_base.82" = type { %"struct.std::_Optional_payload.84" }
%"struct.std::_Optional_payload.84" = type { %"struct.std::_Optional_payload_base.base.86", [7 x i8] }
%"struct.std::_Optional_payload_base.base.86" = type <{ %"union.std::_Optional_payload_base<P3D::GlobalCFrame>::_Storage", i8 }>
%"union.std::_Optional_payload_base<P3D::GlobalCFrame>::_Storage" = type { %"class.P3D::GlobalCFrame" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.P3D::Vector.89" = type { %union.anon.90 }
%union.anon.90 = type { [3 x %"struct.P3D::Fix"] }
%"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" }
%"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 }

@_ZN3P3D11Application6screenE = external global %"class.P3D::Application::Screen", align 8

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

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

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

; 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)) #2

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local 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 @_ZN3P3D6Engine8RegistryImE3getINS_11Application4Comp9TransformEEENS_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 i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D11Application9Selection6rotateERKNS_6VectorIdLm3EEEd(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, double noundef %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca %"class.std::optional.81", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.P3D::MatrixRotationTemplate", align 8
  %10 = alloca %"struct.P3D::Vector", align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.P3D::intrusive_ptr", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"struct.P3D::Vector", align 8
  %19 = alloca %"struct.P3D::Vector.89", align 8
  %20 = alloca %"struct.P3D::PositionTemplate", align 8
  %21 = alloca %"struct.P3D::PositionTemplate", align 8
  %22 = alloca %"struct.P3D::Vector", align 8
  %23 = alloca %"struct.P3D::Vector", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !9
  %24 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 104, ptr %7) #4
  call void @_ZNK3P3D11Application9Selection9getCFrameEv(ptr dead_on_unwind writable sret(%"class.std::optional.81") align 8 %7, ptr noundef nonnull align 8 dereferenceable(80) %24)
  %25 = call noundef zeroext i1 @_ZNKSt8optionalIN3P3D12GlobalCFrameEE9has_valueEv(ptr noundef nonnull align 8 dereferenceable(104) %7) #4
  br i1 %25, label %27, label %26

26:                                               ; preds = %3
  store i32 1, ptr %8, align 4
  br label %81

27:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 72, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #4
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %10, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(24) %28) #4
  call void @_ZN3P3D22MatrixRotationTemplateIdE18fromRotationVectorERKNS_6VectorIdLm3EEE(ptr dead_on_unwind writable sret(%"class.P3D::MatrixRotationTemplate") align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %29 = getelementptr inbounds %"struct.P3D::Application::Selection", ptr %24, i32 0, i32 1
  store ptr %29, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  %31 = call ptr @_ZNSt6vectorIjSaIjEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #4
  %32 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %31, ptr %32, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %33 = load ptr, ptr %11, align 8, !tbaa !5
  %34 = call ptr @_ZNSt6vectorIjSaIjEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #4
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  br label %36

36:                                               ; preds = %77, %27
  %37 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  br i1 %37, label %39, label %38

38:                                               ; preds = %36
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %80

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  %41 = load i32, ptr %40, align 4, !tbaa !11
  store i32 %41, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @_ZN3P3D6Engine8RegistryImE3getINS_11Application4Comp9TransformEEENS_13intrusive_ptrIT_EERKj(ptr dead_on_unwind writable sret(%"class.P3D::intrusive_ptr") align 8 %15, ptr noundef nonnull align 8 dereferenceable(212) @_ZN3P3D11Application6screenE, ptr noundef nonnull align 4 dereferenceable(4) %14) #4
  %42 = call noundef zeroext i1 @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEE5validEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  br i1 %42, label %43, label %76

43:                                               ; preds = %39
  %44 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  invoke void @_ZN3P3D11Application4Comp9Transform6rotateERKNS_22MatrixRotationTemplateIdEE(ptr noundef nonnull align 8 dereferenceable(280) %44, ptr noundef nonnull align 8 dereferenceable(72) %9)
          to label %45 unwind label %53

45:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #4
  %46 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  invoke void @_ZN3P3D11Application4Comp9Transform11getPositionEv(ptr dead_on_unwind writable sret(%"struct.P3D::PositionTemplate") align 8 %20, ptr noundef nonnull align 8 dereferenceable(280) %46)
          to label %47 unwind label %57

47:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #4
  %48 = call noundef ptr @_ZNSt8optionalIN3P3D12GlobalCFrameEEptEv(ptr noundef nonnull align 8 dereferenceable(104) %7) #4
  invoke void @_ZNK3P3D12GlobalCFrame11getPositionEv(ptr dead_on_unwind writable sret(%"struct.P3D::PositionTemplate") align 8 %21, ptr noundef nonnull align 8 dereferenceable(96) %48)
          to label %49 unwind label %61

49:                                               ; preds = %47
  call void @_ZN3P3DmiINS_3FixILl32EEEEENS_6VectorIT_Lm3EEERKNS_16PositionTemplateIS4_EES9_(ptr dead_on_unwind writable sret(%"struct.P3D::Vector.89") align 8 %19, ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  call void @_ZNK3P3D6VectorINS_3FixILl32EEELm3EEcvNS0_IT_Lm3EEEIdEEv(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %19) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #4
  invoke void @_ZNK3P3D22MatrixRotationTemplateIdEmlERKNS_6VectorIdLm3EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %23, ptr noundef nonnull align 8 dereferenceable(72) %9, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %50 unwind label %66

50:                                               ; preds = %49
  call void @_ZN3P3DmiIddLm3EEENS_6VectorIDTmiixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #4
  %51 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  invoke void @_ZN3P3D11Application4Comp9Transform9translateERKNS_6VectorIdLm3EEE(ptr noundef nonnull align 8 dereferenceable(280) %51, ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %52 unwind label %70

52:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #4
  br label %76

53:                                               ; preds = %43
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %16, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %17, align 4
  br label %79

57:                                               ; preds = %45
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %16, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %17, align 4
  br label %65

61:                                               ; preds = %47
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %16, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #4
  br label %65

65:                                               ; preds = %61, %57
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #4
  br label %75

66:                                               ; preds = %49
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %16, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #4
  br label %74

70:                                               ; preds = %50
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %16, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %17, align 4
  br label %74

74:                                               ; preds = %70, %66
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #4
  br label %75

75:                                               ; preds = %74, %65
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #4
  br label %79

76:                                               ; preds = %52, %39
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp9TransformEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %77

77:                                               ; preds = %76
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  br label %36

79:                                               ; preds = %75, %53
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp9TransformEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 104, ptr %7) #4
  br label %84

80:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 72, ptr %9) #4
  store i32 0, ptr %8, align 4
  br label %81

81:                                               ; preds = %80, %26
  call void @llvm.lifetime.end.p0(i64 104, ptr %7) #4
  %82 = load i32, ptr %8, align 4
  switch i32 %82, label %89 [
    i32 0, label %83
    i32 1, label %83
  ]

83:                                               ; preds = %81, %81
  ret void

84:                                               ; preds = %79
  %85 = load ptr, ptr %16, align 8
  %86 = load i32, ptr %17, align 4
  %87 = insertvalue { ptr, i32 } poison, ptr %85, 0
  %88 = insertvalue { ptr, i32 } %87, i32 %86, 1
  resume { ptr, i32 } %88

89:                                               ; preds = %81
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3P3D11Application9Selection9getCFrameEv(ptr dead_on_unwind noalias writable sret(%"class.std::optional.81") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D22MatrixRotationTemplateIdE18fromRotationVectorERKNS_6VectorIdLm3EEE(ptr dead_on_unwind noalias writable sret(%"class.P3D::MatrixRotationTemplate") align 8, ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D11Application4Comp9Transform6rotateERKNS_22MatrixRotationTemplateIdEE(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef nonnull align 8 dereferenceable(72)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmiINS_3FixILl32EEEEENS_6VectorIT_Lm3EEERKNS_16PositionTemplateIS4_EES9_(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector.89") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D11Application4Comp9Transform11getPositionEv(ptr dead_on_unwind noalias writable sret(%"struct.P3D::PositionTemplate") align 8, ptr noundef nonnull align 8 dereferenceable(280)) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK3P3D6VectorINS_3FixILl32EEELm3EEcvNS0_IT_Lm3EEEIdEEv(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmiIddLm3EEENS_6VectorIDTmiixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3P3D22MatrixRotationTemplateIdEmlERKNS_6VectorIdLm3EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(24)) #3 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 = { 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 #3 = { 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 #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}


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

%"class.P3D::Application::Screen" = type { %"class.P3D::Engine::Registry", ptr, ptr, %"struct.P3D::Vector.13", %"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.3", %"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.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = 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.13" = type { %union.anon.14 }
%union.anon.14 = 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.16", %"class.P3D::Matrix.16", %"class.P3D::Matrix.16", %"class.P3D::Matrix.16", %"class.P3D::Matrix.16", ptr }
%"struct.P3D::Vector" = type { %union.anon }
%union.anon = type { [3 x double] }
%"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.16" = type { [16 x float] }
%"class.P3D::Engine::LayerStack" = type <{ %"class.std::vector.17", i32, [4 x i8] }>
%"class.std::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = 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.25 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.25 = 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.std::optional.81" = type { %"struct.std::_Optional_base.82" }
%"struct.std::_Optional_base.82" = type { %"struct.std::_Optional_payload.84" }
%"struct.std::_Optional_payload.84" = type { %"struct.std::_Optional_payload_base.base.86", [7 x i8] }
%"struct.std::_Optional_payload_base.base.86" = type <{ %"union.std::_Optional_payload_base<P3D::GlobalCFrame>::_Storage", i8 }>
%"union.std::_Optional_payload_base<P3D::GlobalCFrame>::_Storage" = type { %"class.P3D::GlobalCFrame" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.P3D::Vector.89" = type { %union.anon.90 }
%union.anon.90 = type { [3 x %"struct.P3D::Fix"] }

@_ZN3P3D11Application6screenE = external global %"class.P3D::Application::Screen", align 8

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

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

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

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

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local 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 @_ZN3P3D6Engine8RegistryImE3getINS_11Application4Comp9TransformEEENS_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 i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D11Application9Selection6rotateERKNS_6VectorIdLm3EEEd(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, double noundef %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca double, align 8
  %5 = alloca %"class.std::optional.81", align 8
  %6 = alloca %"class.P3D::MatrixRotationTemplate", align 8
  %7 = alloca %"struct.P3D::Vector", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.P3D::intrusive_ptr", align 8
  %12 = alloca %"struct.P3D::Vector", align 8
  %13 = alloca %"struct.P3D::Vector.89", align 8
  %14 = alloca %"struct.P3D::PositionTemplate", align 8
  %15 = alloca %"struct.P3D::PositionTemplate", align 8
  %16 = alloca %"struct.P3D::Vector", align 8
  %17 = alloca %"struct.P3D::Vector", align 8
  store double %2, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %5) #4
  call void @_ZNK3P3D11Application9Selection9getCFrameEv(ptr dead_on_unwind nonnull writable sret(%"class.std::optional.81") align 8 %5, ptr noundef nonnull align 8 dereferenceable(80) %0)
  %18 = call noundef zeroext i1 @_ZNKSt8optionalIN3P3D12GlobalCFrameEE9has_valueEv(ptr noundef nonnull align 8 dereferenceable(104) %5) #4
  br i1 %18, label %19, label %50

19:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  call void @_ZN3P3D22MatrixRotationTemplateIdE18fromRotationVectorERKNS_6VectorIdLm3EEE(ptr dead_on_unwind nonnull writable sret(%"class.P3D::MatrixRotationTemplate") align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  %20 = getelementptr inbounds i8, ptr %0, i64 56
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %21 = call ptr @_ZNSt6vectorIjSaIjEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  store ptr %21, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %22 = call ptr @_ZNSt6vectorIjSaIjEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  store ptr %22, ptr %9, align 8
  %23 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  br i1 %23, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %46, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #4
  br label %50

.lr.ph:                                           ; preds = %19, %46
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %25 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %25, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  call void @_ZN3P3D6Engine8RegistryImE3getINS_11Application4Comp9TransformEEENS_13intrusive_ptrIT_EERKj(ptr dead_on_unwind nonnull writable sret(%"class.P3D::intrusive_ptr") align 8 %11, ptr noundef nonnull align 8 dereferenceable(212) @_ZN3P3D11Application6screenE, ptr noundef nonnull align 4 dereferenceable(4) %10) #4
  %26 = call noundef zeroext i1 @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEE5validEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  br i1 %26, label %27, label %46

27:                                               ; preds = %.lr.ph
  %28 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  invoke void @_ZN3P3D11Application4Comp9Transform6rotateERKNS_22MatrixRotationTemplateIdEE(ptr noundef nonnull align 8 dereferenceable(280) %28, ptr noundef nonnull align 8 dereferenceable(72) %6)
          to label %29 unwind label %36

29:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #4
  %30 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  invoke void @_ZN3P3D11Application4Comp9Transform11getPositionEv(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::PositionTemplate") align 8 %14, ptr noundef nonnull align 8 dereferenceable(280) %30)
          to label %31 unwind label %38

31:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #4
  %32 = call noundef ptr @_ZNSt8optionalIN3P3D12GlobalCFrameEEptEv(ptr noundef nonnull align 8 dereferenceable(104) %5) #4
  call void @_ZNK3P3D12GlobalCFrame11getPositionEv(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::PositionTemplate") align 8 %15, ptr noundef nonnull align 8 dereferenceable(96) %32)
  call void @_ZN3P3DmiINS_3FixILl32EEEEENS_6VectorIT_Lm3EEERKNS_16PositionTemplateIS4_EES9_(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector.89") align 8 %13, ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %15) #4
  call void @_ZNK3P3D6VectorINS_3FixILl32EEELm3EEcvNS0_IT_Lm3EEEIdEEv(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %12, ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #4
  invoke void @_ZNK3P3D22MatrixRotationTemplateIdEmlERKNS_6VectorIdLm3EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %17, ptr noundef nonnull align 8 dereferenceable(72) %6, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %33 unwind label %40

33:                                               ; preds = %31
  call void @_ZN3P3DmiIddLm3EEENS_6VectorIDTmiixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %16, ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #4
  %34 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  invoke void @_ZN3P3D11Application4Comp9Transform9translateERKNS_6VectorIdLm3EEE(ptr noundef nonnull align 8 dereferenceable(280) %34, ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %35 unwind label %42

35:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #4
  br label %46

36:                                               ; preds = %27
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %49

38:                                               ; preds = %29
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #4
  br label %45

40:                                               ; preds = %31
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #4
  br label %44

42:                                               ; preds = %33
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %44

44:                                               ; preds = %42, %40
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #4
  br label %45

45:                                               ; preds = %44, %38
  %.pn.pn = phi { ptr, i32 } [ %.pn, %44 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #4
  br label %49

46:                                               ; preds = %35, %.lr.ph
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp9TransformEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPjSt6vectorIjSaIjEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %48 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPjSt6vectorIjSaIjEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  br i1 %48, label %.lr.ph, label %._crit_edge

49:                                               ; preds = %45, %36
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %45 ], [ %37, %36 ]
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp9TransformEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %5) #4
  resume { ptr, i32 } %.pn.pn.pn

50:                                               ; preds = %3, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %5) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3P3D11Application9Selection9getCFrameEv(ptr dead_on_unwind noalias writable sret(%"class.std::optional.81") align 8, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D22MatrixRotationTemplateIdE18fromRotationVectorERKNS_6VectorIdLm3EEE(ptr dead_on_unwind noalias writable sret(%"class.P3D::MatrixRotationTemplate") align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D11Application4Comp9Transform6rotateERKNS_22MatrixRotationTemplateIdEE(ptr noundef nonnull align 8 dereferenceable(280), ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmiINS_3FixILl32EEEEENS_6VectorIT_Lm3EEERKNS_16PositionTemplateIS4_EES9_(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector.89") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D11Application4Comp9Transform11getPositionEv(ptr dead_on_unwind noalias writable sret(%"struct.P3D::PositionTemplate") align 8, ptr noundef nonnull align 8 dereferenceable(280)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK3P3D6VectorINS_3FixILl32EEELm3EEcvNS0_IT_Lm3EEEIdEEv(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmiIddLm3EEENS_6VectorIDTmiixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3P3D22MatrixRotationTemplateIdEmlERKNS_6VectorIdLm3EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 #3 = { 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 #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}


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