; LLVM IR from ThePhysicsGuys/Physics3D :: application/layer (modelLayer)

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

%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.56" = type { %"class.std::__shared_ptr.57" }
%"class.std::__shared_ptr.57" = type { ptr, %"class.std::__shared_count" }
%"class.P3D::Engine::Registry<unsigned long>::basic_view" = type <{ ptr, %class.filter_iterator, [8 x i8] }>
%class.filter_iterator = type { %"struct.std::_Rb_tree_const_iterator", %"struct.std::_Rb_tree_const_iterator", %class.anon }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%class.anon = type { %"class.std::set" }
%"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 }
%struct.iterator_end = type { i8 }
%"class.P3D::intrusive_ptr" = type { ptr }
%"struct.P3D::PositionTemplate" = type { %"struct.P3D::Fix", %"struct.P3D::Fix", %"struct.P3D::Fix" }
%"struct.P3D::Fix" = type { i64 }
%"class.P3D::intrusive_ptr.90" = type { ptr }
%"class.P3D::GlobalCFrame" = type { %"struct.P3D::PositionTemplate", %"class.P3D::MatrixRotationTemplate" }
%"class.P3D::MatrixRotationTemplate" = type { %"class.P3D::Matrix" }
%"class.P3D::Matrix" = type { [9 x double] }

@_ZN3P3D11Application7Shaders11basicShaderE = external global %"class.std::shared_ptr", align 8
@_ZN3P3D11Application7Shaders14instanceShaderE = external global %"class.std::shared_ptr.56", 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 noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application11BasicShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

declare i32 @__gxx_personality_v0(...)

; 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 @_ZN3P3D11Application10ModelLayer8onUpdateERNS_6Engine8RegistryImEE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(212) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.P3D::Engine::Registry<unsigned long>::basic_view", align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %class.filter_iterator, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.iterator_end, align 1
  %12 = alloca %struct.iterator_end, align 1
  %13 = alloca %struct.iterator_end, align 1
  %14 = alloca i64, align 8
  %15 = alloca %"class.P3D::intrusive_ptr", align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.P3D::PositionTemplate", align 8
  %18 = alloca %"class.P3D::intrusive_ptr.90", align 8
  %19 = alloca i32, align 4
  %20 = alloca %"struct.P3D::PositionTemplate", align 8
  %21 = alloca %"class.P3D::GlobalCFrame", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %22 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr %5) #6
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3P3D6Engine8RegistryImE4viewIJNS_11Application4Comp5LightEEEEDav(ptr dead_on_unwind writable sret(%"class.P3D::Engine::Registry<unsigned long>::basic_view") align 8 %5, ptr noundef nonnull align 8 dereferenceable(212) %23) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store ptr %5, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #6
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZNK3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_E5beginEv(ptr dead_on_unwind writable sret(%class.filter_iterator) align 8 %8, ptr noundef nonnull align 8 dereferenceable(73) %24)
          to label %25 unwind label %32

25:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZNK3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_E3endEv(ptr noundef nonnull align 8 dereferenceable(73) %26)
          to label %27 unwind label %36

27:                                               ; preds = %25
  br label %28

28:                                               ; preds = %82, %27
  %29 = invoke noundef zeroext i1 @_ZNK15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_EneES2_(ptr noundef nonnull align 8 dereferenceable(64) %8)
          to label %30 unwind label %36

30:                                               ; preds = %28
  br i1 %29, label %40, label %31

31:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @_ZN15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_ED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %8) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %92

32:                                               ; preds = %2
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %9, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %10, align 4
  br label %91

36:                                               ; preds = %80, %28, %25
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %9, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %10, align 4
  br label %90

40:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_EdeEv(ptr noundef nonnull align 8 dereferenceable(64) %8)
          to label %42 unwind label %55

42:                                               ; preds = %40
  %43 = load i64, ptr %41, align 8, !tbaa !9
  store i64 %43, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %44 = load i64, ptr %14, align 8, !tbaa !9
  %45 = trunc i64 %44 to i32
  store i32 %45, ptr %16, align 4, !tbaa !11
  invoke void @_ZN3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_E3getIS7_EENS_13intrusive_ptrIT_EERKj(ptr dead_on_unwind writable sret(%"class.P3D::intrusive_ptr") align 8 %15, ptr noundef nonnull align 8 dereferenceable(73) %5, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %46 unwind label %59

46:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #6
  call void @_ZN3P3D16PositionTemplateINS_3FixILl32EEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %48 = load i64, ptr %14, align 8, !tbaa !9
  %49 = trunc i64 %48 to i32
  store i32 %49, ptr %19, align 4, !tbaa !11
  call void @_ZN3P3D6Engine8RegistryImE3getINS_11Application4Comp9TransformEEENS_13intrusive_ptrIT_EERKj(ptr dead_on_unwind writable sret(%"class.P3D::intrusive_ptr.90") align 8 %18, ptr noundef nonnull align 8 dereferenceable(212) %47, ptr noundef nonnull align 4 dereferenceable(4) %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %50 = call noundef zeroext i1 @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEE5validEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  br i1 %50, label %51, label %67

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 96, ptr %21) #6
  %52 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  invoke void @_ZN3P3D11Application4Comp9Transform9getCFrameEv(ptr dead_on_unwind writable sret(%"class.P3D::GlobalCFrame") align 8 %21, ptr noundef nonnull align 8 dereferenceable(280) %52)
          to label %53 unwind label %63

53:                                               ; preds = %51
  invoke void @_ZNK3P3D12GlobalCFrame11getPositionEv(ptr dead_on_unwind writable sret(%"struct.P3D::PositionTemplate") align 8 %20, ptr noundef nonnull align 8 dereferenceable(96) %21)
          to label %54 unwind label %63

54:                                               ; preds = %53
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %20, i64 24, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 96, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  br label %67

55:                                               ; preds = %40
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %9, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %10, align 4
  br label %89

59:                                               ; preds = %42
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %9, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %88

63:                                               ; preds = %53, %51
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %9, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 96, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  br label %87

67:                                               ; preds = %54, %46
  %68 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application11BasicShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZN3P3D11Application7Shaders11basicShaderE) #6
  %69 = getelementptr inbounds i8, ptr %68, i64 8
  %70 = load i64, ptr %6, align 8, !tbaa !9
  %71 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp5LightEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  invoke void @_ZN3P3D11Application15BasicShaderBase11updateLightEmRKNS_16PositionTemplateINS_3FixILl32EEEEERKNS0_4Comp5LightE(ptr noundef nonnull align 8 dereferenceable(8) %69, i64 noundef %70, ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(48) %71)
          to label %72 unwind label %83

72:                                               ; preds = %67
  %73 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application14InstanceShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZN3P3D11Application7Shaders14instanceShaderE) #6
  %74 = getelementptr inbounds i8, ptr %73, i64 8
  %75 = load i64, ptr %6, align 8, !tbaa !9
  %76 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp5LightEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  invoke void @_ZN3P3D11Application15BasicShaderBase11updateLightEmRKNS_16PositionTemplateINS_3FixILl32EEEEERKNS0_4Comp5LightE(ptr noundef nonnull align 8 dereferenceable(8) %74, i64 noundef %75, ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(48) %76)
          to label %77 unwind label %83

77:                                               ; preds = %72
  %78 = load i64, ptr %6, align 8, !tbaa !9
  %79 = add i64 %78, 1
  store i64 %79, ptr %6, align 8, !tbaa !9
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp9TransformEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp5LightEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %80

80:                                               ; preds = %77
  %81 = invoke noundef nonnull align 8 dereferenceable(64) ptr @_ZN15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_EppEv(ptr noundef nonnull align 8 dereferenceable(64) %8)
          to label %82 unwind label %36

82:                                               ; preds = %80
  br label %28

83:                                               ; preds = %72, %67
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %9, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %10, align 4
  br label %87

87:                                               ; preds = %83, %63
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp9TransformEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp5LightEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  br label %88

88:                                               ; preds = %87, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %89

89:                                               ; preds = %88, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %90

90:                                               ; preds = %89, %36
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @_ZN15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_ED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %8) #6
  br label %91

91:                                               ; preds = %90, %32
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %105

92:                                               ; preds = %31
  %93 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application11BasicShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZN3P3D11Application7Shaders11basicShaderE) #6
  %94 = getelementptr inbounds i8, ptr %93, i64 8
  %95 = load i64, ptr %6, align 8, !tbaa !9
  invoke void @_ZN3P3D11Application15BasicShaderBase16updateLightCountEm(ptr noundef nonnull align 8 dereferenceable(8) %94, i64 noundef %95)
          to label %96 unwind label %101

96:                                               ; preds = %92
  %97 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application14InstanceShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZN3P3D11Application7Shaders14instanceShaderE) #6
  %98 = getelementptr inbounds i8, ptr %97, i64 8
  %99 = load i64, ptr %6, align 8, !tbaa !9
  invoke void @_ZN3P3D11Application15BasicShaderBase16updateLightCountEm(ptr noundef nonnull align 8 dereferenceable(8) %98, i64 noundef %99)
          to label %100 unwind label %101

100:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @_ZN3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_ED2Ev(ptr noundef nonnull align 8 dereferenceable(73) %5) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #6
  ret void

101:                                              ; preds = %96, %92
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %9, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %10, align 4
  br label %105

105:                                              ; preds = %101, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @_ZN3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_ED2Ev(ptr noundef nonnull align 8 dereferenceable(73) %5) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #6
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr %9, align 8
  %108 = load i32, ptr %10, align 4
  %109 = insertvalue { ptr, i32 } poison, ptr %107, 0
  %110 = insertvalue { ptr, i32 } %109, i32 %108, 1
  resume { ptr, i32 } %110
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D6Engine8RegistryImE4viewIJNS_11Application4Comp5LightEEEEDav(ptr dead_on_unwind noalias writable sret(%"class.P3D::Engine::Registry<unsigned long>::basic_view") align 8, ptr noundef nonnull align 8 dereferenceable(212)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_E5beginEv(ptr dead_on_unwind noalias writable sret(%class.filter_iterator) align 8, ptr noundef nonnull align 8 dereferenceable(73)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D16PositionTemplateINS_3FixILl32EEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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.90") align 8, ptr noundef nonnull align 8 dereferenceable(212), ptr noundef nonnull align 4 dereferenceable(4)) #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 nounwind uwtable
declare dso_local noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D11Application4Comp9Transform9getCFrameEv(ptr dead_on_unwind noalias writable sret(%"class.P3D::GlobalCFrame") align 8, ptr noundef nonnull align 8 dereferenceable(280)) #2 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)) #3 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare void @_ZN3P3D11Application15BasicShaderBase11updateLightEmRKNS_16PositionTemplateINS_3FixILl32EEEEERKNS0_4Comp5LightE(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application14InstanceShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #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 void @_ZN3P3D13intrusive_ptrINS_11Application4Comp5LightEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(64) ptr @_ZN15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_EppEv(ptr noundef nonnull align 8 dereferenceable(64)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_ED2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #3 align 2

declare void @_ZN3P3D11Application15BasicShaderBase16updateLightCountEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_ED2Ev(ptr noundef nonnull align 8 dereferenceable(73)) unnamed_addr #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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 8, !9, i64 8, i64 8, !9, i64 16, i64 8, !9}


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

%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.56" = type { %"class.std::__shared_ptr.57" }
%"class.std::__shared_ptr.57" = type { ptr, %"class.std::__shared_count" }
%"class.P3D::Engine::Registry<unsigned long>::basic_view" = type <{ ptr, %class.filter_iterator, [8 x i8] }>
%class.filter_iterator = type { %"struct.std::_Rb_tree_const_iterator", %"struct.std::_Rb_tree_const_iterator", %class.anon }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%class.anon = type { %"class.std::set" }
%"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.P3D::intrusive_ptr" = type { ptr }
%"struct.P3D::PositionTemplate" = type { %"struct.P3D::Fix", %"struct.P3D::Fix", %"struct.P3D::Fix" }
%"struct.P3D::Fix" = type { i64 }
%"class.P3D::intrusive_ptr.90" = type { ptr }
%"class.P3D::GlobalCFrame" = type { %"struct.P3D::PositionTemplate", %"class.P3D::MatrixRotationTemplate" }
%"class.P3D::MatrixRotationTemplate" = type { %"class.P3D::Matrix" }
%"class.P3D::Matrix" = type { [9 x double] }

@_ZN3P3D11Application7Shaders11basicShaderE = external global %"class.std::shared_ptr", align 8
@_ZN3P3D11Application7Shaders14instanceShaderE = external global %"class.std::shared_ptr.56", 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 noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application11BasicShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; 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 @_ZN3P3D11Application10ModelLayer8onUpdateERNS_6Engine8RegistryImEE(ptr nocapture noundef nonnull readnone align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(212) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.P3D::Engine::Registry<unsigned long>::basic_view", align 8
  %4 = alloca %class.filter_iterator, align 8
  %5 = alloca %"class.P3D::intrusive_ptr", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.P3D::PositionTemplate", align 8
  %8 = alloca %"class.P3D::intrusive_ptr.90", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.P3D::PositionTemplate", align 8
  %11 = alloca %"class.P3D::GlobalCFrame", align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #6
  call void @_ZN3P3D6Engine8RegistryImE4viewIJNS_11Application4Comp5LightEEEEDav(ptr dead_on_unwind nonnull writable sret(%"class.P3D::Engine::Registry<unsigned long>::basic_view") align 8 %3, ptr noundef nonnull align 8 dereferenceable(212) %1) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #6
  invoke void @_ZNK3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_E5beginEv(ptr dead_on_unwind nonnull writable sret(%class.filter_iterator) align 8 %4, ptr noundef nonnull align 8 dereferenceable(73) %3)
          to label %12 unwind label %18

12:                                               ; preds = %2
  call void @_ZNK3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_E3endEv(ptr noundef nonnull align 8 dereferenceable(73) %3)
  br label %13

13:                                               ; preds = %43, %12
  %.0 = phi i64 [ 0, %12 ], [ %44, %43 ]
  %14 = call noundef zeroext i1 @_ZNK15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_EneES2_(ptr noundef nonnull align 8 dereferenceable(64) %4)
  br i1 %14, label %22, label %15

15:                                               ; preds = %13
  call void @_ZN15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_ED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %4) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #6
  %16 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application11BasicShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZN3P3D11Application7Shaders11basicShaderE) #6
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  invoke void @_ZN3P3D11Application15BasicShaderBase16updateLightCountEm(ptr noundef nonnull align 8 dereferenceable(8) %17, i64 noundef %.0)
          to label %52 unwind label %56

18:                                               ; preds = %2
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %51

20:                                               ; preds = %43
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %50

22:                                               ; preds = %13
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_EdeEv(ptr noundef nonnull align 8 dereferenceable(64) %4)
  %24 = load i64, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %25 = trunc i64 %24 to i32
  store i32 %25, ptr %6, align 4, !tbaa !9
  invoke void @_ZN3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_E3getIS7_EENS_13intrusive_ptrIT_EERKj(ptr dead_on_unwind nonnull writable sret(%"class.P3D::intrusive_ptr") align 8 %5, ptr noundef nonnull align 8 dereferenceable(73) %3, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %26 unwind label %31

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @_ZN3P3D16PositionTemplateINS_3FixILl32EEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  store i32 %25, ptr %9, align 4, !tbaa !9
  call void @_ZN3P3D6Engine8RegistryImE3getINS_11Application4Comp9TransformEEENS_13intrusive_ptrIT_EERKj(ptr dead_on_unwind nonnull writable sret(%"class.P3D::intrusive_ptr.90") align 8 %8, ptr noundef nonnull align 8 dereferenceable(212) %1, ptr noundef nonnull align 4 dereferenceable(4) %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  %27 = call noundef zeroext i1 @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEE5validEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br i1 %27, label %28, label %35

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %11) #6
  %29 = call noundef ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp9TransformEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  invoke void @_ZN3P3D11Application4Comp9Transform9getCFrameEv(ptr dead_on_unwind nonnull writable sret(%"class.P3D::GlobalCFrame") align 8 %11, ptr noundef nonnull align 8 dereferenceable(280) %29)
          to label %30 unwind label %33

30:                                               ; preds = %28
  call void @_ZNK3P3D12GlobalCFrame11getPositionEv(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::PositionTemplate") align 8 %10, ptr noundef nonnull align 8 dereferenceable(96) %11)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %10, i64 24, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  br label %35

31:                                               ; preds = %22
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  br label %49

33:                                               ; preds = %28
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  br label %48

35:                                               ; preds = %30, %26
  %36 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application11BasicShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZN3P3D11Application7Shaders11basicShaderE) #6
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  %38 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp5LightEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  invoke void @_ZN3P3D11Application15BasicShaderBase11updateLightEmRKNS_16PositionTemplateINS_3FixILl32EEEEERKNS0_4Comp5LightE(ptr noundef nonnull align 8 dereferenceable(8) %37, i64 noundef %.0, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(48) %38)
          to label %39 unwind label %46

39:                                               ; preds = %35
  %40 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application14InstanceShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZN3P3D11Application7Shaders14instanceShaderE) #6
  %41 = getelementptr inbounds i8, ptr %40, i64 8
  %42 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK3P3D13intrusive_ptrINS_11Application4Comp5LightEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  invoke void @_ZN3P3D11Application15BasicShaderBase11updateLightEmRKNS_16PositionTemplateINS_3FixILl32EEEEERKNS0_4Comp5LightE(ptr noundef nonnull align 8 dereferenceable(8) %41, i64 noundef %.0, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(48) %42)
          to label %43 unwind label %46

43:                                               ; preds = %39
  %44 = add i64 %.0, 1
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp9TransformEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp5LightEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %45 = invoke noundef nonnull align 8 dereferenceable(64) ptr @_ZN15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_EppEv(ptr noundef nonnull align 8 dereferenceable(64) %4)
          to label %13 unwind label %20

46:                                               ; preds = %39, %35
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %48

48:                                               ; preds = %46, %33
  %.pn = phi { ptr, i32 } [ %47, %46 ], [ %34, %33 ]
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp9TransformEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @_ZN3P3D13intrusive_ptrINS_11Application4Comp5LightEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  br label %49

49:                                               ; preds = %48, %31
  %.pn.pn = phi { ptr, i32 } [ %.pn, %48 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %50

50:                                               ; preds = %49, %20
  %.pn21 = phi { ptr, i32 } [ %21, %20 ], [ %.pn.pn, %49 ]
  call void @_ZN15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_ED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %4) #6
  br label %51

51:                                               ; preds = %50, %18
  %.pn21.pn = phi { ptr, i32 } [ %.pn21, %50 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #6
  br label %58

52:                                               ; preds = %15
  %53 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application14InstanceShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZN3P3D11Application7Shaders14instanceShaderE) #6
  %54 = getelementptr inbounds i8, ptr %53, i64 8
  invoke void @_ZN3P3D11Application15BasicShaderBase16updateLightCountEm(ptr noundef nonnull align 8 dereferenceable(8) %54, i64 noundef %.0)
          to label %55 unwind label %56

55:                                               ; preds = %52
  call void @_ZN3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_ED2Ev(ptr noundef nonnull align 8 dereferenceable(73) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #6
  ret void

56:                                               ; preds = %52, %15
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %58

58:                                               ; preds = %56, %51
  %.pn21.pn.pn = phi { ptr, i32 } [ %.pn21.pn, %51 ], [ %57, %56 ]
  call void @_ZN3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_ED2Ev(ptr noundef nonnull align 8 dereferenceable(73) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn21.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D6Engine8RegistryImE4viewIJNS_11Application4Comp5LightEEEEDav(ptr dead_on_unwind noalias writable sret(%"class.P3D::Engine::Registry<unsigned long>::basic_view") align 8, ptr noundef nonnull align 8 dereferenceable(212)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_E5beginEv(ptr dead_on_unwind noalias writable sret(%class.filter_iterator) align 8, ptr noundef nonnull align 8 dereferenceable(73)) local_unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D16PositionTemplateINS_3FixILl32EEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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.90") align 8, ptr noundef nonnull align 8 dereferenceable(212), ptr noundef nonnull align 4 dereferenceable(4)) local_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 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 uwtable
declare dso_local void @_ZN3P3D11Application4Comp9Transform9getCFrameEv(ptr dead_on_unwind noalias writable sret(%"class.P3D::GlobalCFrame") align 8, ptr noundef nonnull align 8 dereferenceable(280)) local_unnamed_addr #2 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 #3 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare void @_ZN3P3D11Application15BasicShaderBase11updateLightEmRKNS_16PositionTemplateINS_3FixILl32EEEEERKNS0_4Comp5LightE(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application14InstanceShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) 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 void @_ZN3P3D13intrusive_ptrINS_11Application4Comp5LightEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZN3P3D6Engine8RegistryImE4viewIJNS3_11Application4Comp5LightEEEEDaNS6_4typeINS6_4disjIJDpT_EEEEEEUlRKS1_E_ED2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #3 align 2

declare void @_ZN3P3D11Application15BasicShaderBase16updateLightCountEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D6Engine8RegistryImE10basic_viewINS2_4disjIJNS_11Application4Comp5LightEEEE15filter_iteratorISt23_Rb_tree_const_iteratorImE12iterator_endZNS2_4viewIJS7_EEEDaNS2_4typeINS4_IJDpT_EEEEEEUlRKSB_E_ESC_ED2Ev(ptr noundef nonnull align 8 dereferenceable(73)) 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass