; 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" }
%"struct.P3D::Graphics::BufferDataType::Info" = type <{ %"class.std::__cxx11::basic_string", i32, i32, i32, i8, [3 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::shared_ptr.28" = type { %"class.std::__shared_ptr.29" }
%"class.std::__shared_ptr.29" = type { ptr, %"class.std::__shared_count" }
%"struct.P3D::Graphics::BufferLayout" = type <{ %"class.std::vector.31", i32, [4 x i8] }>
%"class.std::vector.31" = type { %"struct.std::_Vector_base.32" }
%"struct.std::_Vector_base.32" = type { %"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl" }
%"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl" = type { %"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl_data" }
%"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%"struct.P3D::Graphics::BufferElement" = type <{ %"class.std::__cxx11::basic_string", %"struct.P3D::Graphics::BufferDataType::Info", i8, i8, [6 x i8] }>
%"class.std::allocator" = type { i8 }
%"class.std::allocator.33" = type { i8 }
%"class.P3D::Engine::Layer" = type <{ ptr, ptr, %"class.std::__cxx11::basic_string", i8, [7 x i8] }>
%"class.P3D::Application::ModelLayer" = type { %"class.P3D::Engine::Layer.base", ptr }
%"class.P3D::Engine::Layer.base" = type <{ ptr, ptr, %"class.std::__cxx11::basic_string", i8 }>

@_ZN3P3D11Application7Shaders11basicShaderE = external global %"class.std::shared_ptr", align 8
@_ZN3P3D11Application7Shaders14instanceShaderE = external global %"class.std::shared_ptr.56", align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@_ZN3P3D8Graphics14BufferDataType4MAT4E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@_ZN3P3D8Graphics14BufferDataType6FLOAT4E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@_ZN3P3D8Graphics14BufferDataType6FLOAT3E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@_ZN3P3D8Graphics14BufferDataType5UINT2E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D11Application10ModelLayer6onInitERNS_6Engine8RegistryImEE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(212) %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::shared_ptr.28", align 8
  %7 = alloca %"struct.P3D::Graphics::BufferLayout", align 8
  %8 = alloca %"class.std::vector.31", align 8
  %9 = alloca %"class.std::initializer_list", align 8
  %10 = alloca [4 x %"struct.P3D::Graphics::BufferElement"], align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator", align 1
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::allocator", align 1
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca %"class.std::allocator", align 1
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"class.std::allocator", align 1
  %22 = alloca i1, align 1
  %23 = alloca %"class.std::allocator.33", align 1
  %24 = alloca i1, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %25 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %26 = getelementptr inbounds %"class.P3D::Engine::Layer", ptr %25, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  store ptr %27, ptr %5, align 8, !tbaa !5
  %28 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application11BasicShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZN3P3D11Application7Shaders11basicShaderE) #7
  call void @_ZN3P3D11Application11BasicShader13updateTextureEb(ptr noundef nonnull align 8 dereferenceable(16) %28, i1 noundef zeroext false)
  %29 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #8
  store i1 true, ptr %24, align 1
  call void @_ZNSt10shared_ptrIN3P3D8Graphics6ShaderEEC2INS0_11Application14InstanceShaderEvEERKS_IT_E(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) @_ZN3P3D11Application7Shaders14instanceShaderE) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 352, ptr %10) #7
  store i1 true, ptr %22, align 1
  store ptr %10, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %30 unwind label %58

30:                                               ; preds = %2
  invoke void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82) %10, ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType4MAT4E, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %31 unwind label %62

31:                                               ; preds = %30
  %32 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %10, i64 1
  store ptr %32, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %33 unwind label %66

33:                                               ; preds = %31
  invoke void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82) %32, ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType6FLOAT4E, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %34 unwind label %70

34:                                               ; preds = %33
  %35 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %10, i64 2
  store ptr %35, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef @.str.2, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %36 unwind label %74

36:                                               ; preds = %34
  invoke void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82) %35, ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType6FLOAT3E, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %37 unwind label %78

37:                                               ; preds = %36
  %38 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %10, i64 3
  store ptr %38, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %39 unwind label %82

39:                                               ; preds = %37
  invoke void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82) %38, ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType5UINT2E, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %40 unwind label %86

40:                                               ; preds = %39
  store i1 false, ptr %22, align 1
  %41 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 0
  store ptr %10, ptr %41, align 8, !tbaa !14
  %42 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 1
  store i64 4, ptr %42, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #7
  call void @_ZNSaIN3P3D8Graphics13BufferElementEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #7
  %43 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8
  %45 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 1
  %46 = load i64, ptr %45, align 8
  invoke void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EEC2ESt16initializer_listIS2_ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr %44, i64 %46, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %47 unwind label %90

47:                                               ; preds = %40
  invoke void @_ZN3P3D8Graphics12BufferLayoutC2ERKSt6vectorINS0_13BufferElementESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(28) %7, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %48 unwind label %94

48:                                               ; preds = %47
  invoke void @_ZN3P3D8Graphics20InstanceBatchManagerC2ESt10shared_ptrINS0_6ShaderEERKNS0_12BufferLayoutE(ptr noundef nonnull align 8 dereferenceable(104) %29, ptr noundef %6, ptr noundef nonnull align 8 dereferenceable(28) %7)
          to label %49 unwind label %98

49:                                               ; preds = %48
  store i1 false, ptr %24, align 1
  %50 = getelementptr inbounds %"class.P3D::Application::ModelLayer", ptr %25, i32 0, i32 1
  store ptr %29, ptr %50, align 8, !tbaa !17
  call void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %7) #7
  call void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @_ZNSt15__new_allocatorIN3P3D8Graphics13BufferElementEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #7
  %51 = getelementptr inbounds [4 x %"struct.P3D::Graphics::BufferElement"], ptr %10, i32 0, i32 0
  %52 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %51, i64 4
  br label %53

53:                                               ; preds = %53, %49
  %54 = phi ptr [ %52, %49 ], [ %55, %53 ]
  %55 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %54, i64 -1
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %55) #7
  %56 = icmp eq ptr %55, %51
  br i1 %56, label %57, label %53

57:                                               ; preds = %53
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 352, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  call void @_ZNSt12__shared_ptrIN3P3D8Graphics6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  ret void

58:                                               ; preds = %2
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %14, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %15, align 4
  br label %118

62:                                               ; preds = %30
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %14, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %15, align 4
  br label %117

66:                                               ; preds = %31
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %14, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %15, align 4
  br label %116

70:                                               ; preds = %33
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %14, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %15, align 4
  br label %115

74:                                               ; preds = %34
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %14, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %15, align 4
  br label %114

78:                                               ; preds = %36
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %14, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %15, align 4
  br label %113

82:                                               ; preds = %37
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %14, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %15, align 4
  br label %112

86:                                               ; preds = %39
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %14, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %15, align 4
  br label %111

90:                                               ; preds = %40
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %14, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %15, align 4
  br label %103

94:                                               ; preds = %47
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %14, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %15, align 4
  br label %102

98:                                               ; preds = %48
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %14, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %15, align 4
  call void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %7) #7
  br label %102

102:                                              ; preds = %98, %94
  call void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  br label %103

103:                                              ; preds = %102, %90
  call void @_ZNSt15__new_allocatorIN3P3D8Graphics13BufferElementEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #7
  %104 = getelementptr inbounds [4 x %"struct.P3D::Graphics::BufferElement"], ptr %10, i32 0, i32 0
  %105 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %104, i64 4
  br label %106

106:                                              ; preds = %106, %103
  %107 = phi ptr [ %105, %103 ], [ %108, %106 ]
  %108 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %107, i64 -1
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %108) #7
  %109 = icmp eq ptr %108, %104
  br i1 %109, label %110, label %106

110:                                              ; preds = %106
  br label %111

111:                                              ; preds = %110, %86
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #7
  br label %112

112:                                              ; preds = %111, %82
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #7
  br label %113

113:                                              ; preds = %112, %78
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #7
  br label %114

114:                                              ; preds = %113, %74
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #7
  br label %115

115:                                              ; preds = %114, %70
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  br label %116

116:                                              ; preds = %115, %66
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #7
  br label %117

117:                                              ; preds = %116, %62
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  br label %118

118:                                              ; preds = %117, %58
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  %119 = load i1, ptr %22, align 1
  br i1 %119, label %120, label %128

120:                                              ; preds = %118
  %121 = load ptr, ptr %11, align 8
  %122 = icmp eq ptr %10, %121
  br i1 %122, label %127, label %123

123:                                              ; preds = %123, %120
  %124 = phi ptr [ %121, %120 ], [ %125, %123 ]
  %125 = getelementptr inbounds %"struct.P3D::Graphics::BufferElement", ptr %124, i64 -1
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %125) #7
  %126 = icmp eq ptr %125, %10
  br i1 %126, label %127, label %123

127:                                              ; preds = %123, %120
  br label %128

128:                                              ; preds = %127, %118
  call void @llvm.lifetime.end.p0(i64 352, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  call void @_ZNSt12__shared_ptrIN3P3D8Graphics6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  %129 = load i1, ptr %24, align 1
  br i1 %129, label %130, label %131

130:                                              ; preds = %128
  call void @_ZdlPvm(ptr noundef %29, i64 noundef 104) #9
  br label %131

131:                                              ; preds = %130, %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %132

132:                                              ; preds = %131
  %133 = load ptr, ptr %14, align 8
  %134 = load i32, ptr %15, align 4
  %135 = insertvalue { ptr, i32 } poison, ptr %133, 0
  %136 = insertvalue { ptr, i32 } %135, i32 %134, 1
  resume { ptr, i32 } %136
}

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

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

declare void @_ZN3P3D11Application11BasicShader13updateTextureEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #3

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(45), i1 noundef zeroext, i1 noundef zeroext) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EEC2ESt16initializer_listIS2_ERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D8Graphics12BufferLayoutC2ERKSt6vectorINS0_13BufferElementESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D8Graphics20InstanceBatchManagerC2ESt10shared_ptrINS0_6ShaderEERKNS0_12BufferLayoutE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef, ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #5 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82)) unnamed_addr #5 align 2

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

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { "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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTSN3P3D6Engine5LayerE", !6, i64 8, !11, i64 16, !7, i64 48}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !13, i64 8, !7, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSSt16initializer_listIN3P3D8Graphics13BufferElementEE", !6, i64 0, !13, i64 8}
!16 = !{!15, !13, i64 8}
!17 = !{!18, !6, i64 56}
!18 = !{!"_ZTSN3P3D11Application10ModelLayerE", !10, i64 0, !6, i64 56}


; 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" }
%"struct.P3D::Graphics::BufferDataType::Info" = type <{ %"class.std::__cxx11::basic_string", i32, i32, i32, i8, [3 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::shared_ptr.28" = type { %"class.std::__shared_ptr.29" }
%"class.std::__shared_ptr.29" = type { ptr, %"class.std::__shared_count" }
%"struct.P3D::Graphics::BufferLayout" = type <{ %"class.std::vector.31", i32, [4 x i8] }>
%"class.std::vector.31" = type { %"struct.std::_Vector_base.32" }
%"struct.std::_Vector_base.32" = type { %"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl" }
%"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl" = type { %"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl_data" }
%"struct.std::_Vector_base<P3D::Graphics::BufferElement, std::allocator<P3D::Graphics::BufferElement>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.P3D::Graphics::BufferElement" = type <{ %"class.std::__cxx11::basic_string", %"struct.P3D::Graphics::BufferDataType::Info", i8, i8, [6 x i8] }>
%"class.std::allocator" = type { i8 }
%"class.std::allocator.33" = type { i8 }

@_ZN3P3D11Application7Shaders11basicShaderE = external global %"class.std::shared_ptr", align 8
@_ZN3P3D11Application7Shaders14instanceShaderE = external global %"class.std::shared_ptr.56", align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@_ZN3P3D8Graphics14BufferDataType4MAT4E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@_ZN3P3D8Graphics14BufferDataType6FLOAT4E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@_ZN3P3D8Graphics14BufferDataType6FLOAT3E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@_ZN3P3D8Graphics14BufferDataType5UINT2E = external global %"struct.P3D::Graphics::BufferDataType::Info", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D11Application10ModelLayer6onInitERNS_6Engine8RegistryImEE(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(64) %0, ptr nocapture noundef nonnull readnone align 8 dereferenceable(212) %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::shared_ptr.28", align 8
  %4 = alloca %"struct.P3D::Graphics::BufferLayout", align 8
  %5 = alloca %"class.std::vector.31", align 8
  %6 = alloca [4 x %"struct.P3D::Graphics::BufferElement"], align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::allocator", align 1
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.std::allocator", align 1
  %15 = alloca %"class.std::allocator.33", align 1
  %16 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3P3D11Application11BasicShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZN3P3D11Application7Shaders11basicShaderE) #7
  tail call void @_ZN3P3D11Application11BasicShader13updateTextureEb(ptr noundef nonnull align 8 dereferenceable(16) %16, i1 noundef zeroext false)
  %17 = tail call noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #8
  call void @_ZNSt10shared_ptrIN3P3D8Graphics6ShaderEEC2INS0_11Application14InstanceShaderEvEERKS_IT_E(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) @_ZN3P3D11Application7Shaders14instanceShaderE) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 352, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull @.str, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %18 unwind label %.thread

18:                                               ; preds = %2
  invoke void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82) %6, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType4MAT4E, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %19 unwind label %37

19:                                               ; preds = %18
  %20 = getelementptr inbounds i8, ptr %6, i64 88
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %21 unwind label %39

21:                                               ; preds = %19
  invoke void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82) %20, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType6FLOAT4E, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %22 unwind label %41

22:                                               ; preds = %21
  %23 = getelementptr inbounds i8, ptr %6, i64 176
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull @.str.2, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %24 unwind label %43

24:                                               ; preds = %22
  invoke void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82) %23, ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType6FLOAT3E, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %25 unwind label %45

25:                                               ; preds = %24
  %26 = getelementptr inbounds i8, ptr %6, i64 264
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %14) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %27 unwind label %47

27:                                               ; preds = %25
  invoke void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82) %26, ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(45) @_ZN3P3D8Graphics14BufferDataType5UINT2E, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %28 unwind label %49

28:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %15) #7
  call void @_ZNSaIN3P3D8Graphics13BufferElementEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #7
  invoke void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EEC2ESt16initializer_listIS2_ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr nonnull %6, i64 4, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %29 unwind label %51

29:                                               ; preds = %28
  invoke void @_ZN3P3D8Graphics12BufferLayoutC2ERKSt6vectorINS0_13BufferElementESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(28) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %30 unwind label %53

30:                                               ; preds = %29
  invoke void @_ZN3P3D8Graphics20InstanceBatchManagerC2ESt10shared_ptrINS0_6ShaderEERKNS0_12BufferLayoutE(ptr noundef nonnull align 8 dereferenceable(104) %17, ptr noundef nonnull %3, ptr noundef nonnull align 8 dereferenceable(28) %4)
          to label %31 unwind label %55

31:                                               ; preds = %30
  %32 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %17, ptr %32, align 8, !tbaa !5
  call void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %4) #7
  call void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @_ZNSt15__new_allocatorIN3P3D8Graphics13BufferElementEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #7
  %33 = getelementptr inbounds i8, ptr %6, i64 264
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %33) #7
  %34 = getelementptr inbounds i8, ptr %6, i64 176
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %34) #7
  %35 = getelementptr inbounds i8, ptr %6, i64 88
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %35) #7
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %6) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 352, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  call void @_ZNSt12__shared_ptrIN3P3D8Graphics6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  ret void

.thread:                                          ; preds = %2
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  br label %.loopexit

37:                                               ; preds = %18
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %67

39:                                               ; preds = %19
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %66

41:                                               ; preds = %21
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %65

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

45:                                               ; preds = %24
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %63

47:                                               ; preds = %25
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %62

49:                                               ; preds = %27
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit46

51:                                               ; preds = %28
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit46.loopexit

53:                                               ; preds = %29
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %57

55:                                               ; preds = %30
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %4) #7
  br label %57

57:                                               ; preds = %55, %53
  %.pn = phi { ptr, i32 } [ %56, %55 ], [ %54, %53 ]
  call void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  br label %.loopexit46.loopexit

.loopexit46.loopexit:                             ; preds = %57, %51
  %.pn.pn = phi { ptr, i32 } [ %.pn, %57 ], [ %52, %51 ]
  call void @_ZNSt15__new_allocatorIN3P3D8Graphics13BufferElementEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #7
  %58 = getelementptr inbounds i8, ptr %6, i64 264
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %58) #7
  %59 = getelementptr inbounds i8, ptr %6, i64 176
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %59) #7
  %60 = getelementptr inbounds i8, ptr %6, i64 88
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %60) #7
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %6) #7
  br label %.loopexit46

.loopexit46:                                      ; preds = %.loopexit46.loopexit, %49
  %.pn.pn.pn = phi { ptr, i32 } [ %50, %49 ], [ %.pn.pn, %.loopexit46.loopexit ]
  %61 = phi i1 [ false, %49 ], [ true, %.loopexit46.loopexit ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  br label %62

62:                                               ; preds = %.loopexit46, %47
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %.loopexit46 ], [ %48, %47 ]
  %.1 = phi i1 [ %61, %.loopexit46 ], [ false, %47 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #7
  br label %63

63:                                               ; preds = %62, %45
  %.024 = phi ptr [ %26, %62 ], [ %23, %45 ]
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %62 ], [ %46, %45 ]
  %.2 = phi i1 [ %.1, %62 ], [ false, %45 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  br label %64

64:                                               ; preds = %63, %43
  %.125 = phi ptr [ %.024, %63 ], [ %23, %43 ]
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn, %63 ], [ %44, %43 ]
  %.3 = phi i1 [ %.2, %63 ], [ false, %43 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #7
  br label %65

65:                                               ; preds = %64, %41
  %.226 = phi ptr [ %.125, %64 ], [ %20, %41 ]
  %.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn, %64 ], [ %42, %41 ]
  %.4 = phi i1 [ %.3, %64 ], [ false, %41 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  br label %66

66:                                               ; preds = %65, %39
  %.327 = phi ptr [ %.226, %65 ], [ %20, %39 ]
  %.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn.pn, %65 ], [ %40, %39 ]
  %.5 = phi i1 [ %.4, %65 ], [ false, %39 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  br label %67

67:                                               ; preds = %37, %66
  %.428 = phi ptr [ %.327, %66 ], [ %6, %37 ]
  %.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn.pn.pn, %66 ], [ %38, %37 ]
  %.6 = phi i1 [ %.5, %66 ], [ false, %37 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  %68 = icmp eq ptr %6, %.428
  %or.cond = select i1 %.6, i1 true, i1 %68
  br i1 %or.cond, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %67, %.preheader
  %69 = phi ptr [ %70, %.preheader ], [ %.428, %67 ]
  %70 = getelementptr inbounds i8, ptr %69, i64 -88
  call void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82) %70) #7
  %71 = icmp eq ptr %70, %6
  br i1 %71, label %.loopexit, label %.preheader

.loopexit:                                        ; preds = %.preheader, %.thread, %67
  %.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn45 = phi { ptr, i32 } [ %36, %.thread ], [ %.pn.pn.pn.pn.pn.pn.pn.pn.pn, %67 ], [ %.pn.pn.pn.pn.pn.pn.pn.pn.pn, %.preheader ]
  call void @llvm.lifetime.end.p0(i64 352, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  call void @_ZNSt12__shared_ptrIN3P3D8Graphics6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @_ZdlPvm(ptr noundef nonnull %17, i64 noundef 104) #9
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn45
}

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

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

declare void @_ZN3P3D11Application11BasicShader13updateTextureEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #3

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D8Graphics13BufferElementC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_14BufferDataType4InfoEbb(ptr noundef nonnull align 8 dereferenceable(82), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(45), i1 noundef zeroext, i1 noundef zeroext) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3P3D8Graphics13BufferElementESaIS2_EEC2ESt16initializer_listIS2_ERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D8Graphics12BufferLayoutC2ERKSt6vectorINS0_13BufferElementESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3P3D8Graphics20InstanceBatchManagerC2ESt10shared_ptrINS0_6ShaderEERKNS0_12BufferLayoutE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef, ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D8Graphics12BufferLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #5 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D8Graphics13BufferElementD2Ev(ptr noundef nonnull align 8 dereferenceable(82)) unnamed_addr #5 align 2

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

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

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { "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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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, !8, i64 56}
!6 = !{!"_ZTSN3P3D11Application10ModelLayerE", !7, i64 0, !8, i64 56}
!7 = !{!"_ZTSN3P3D6Engine5LayerE", !8, i64 8, !11, i64 16, !9, i64 48}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !13, i64 8, !9, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !8, i64 0}
!13 = !{!"long", !9, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass