; LLVM IR from merpheus-dev/LavaEngine :: src/Platforms/OpenGL (GLNonbatchedRenderer)

; 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 }
%"struct.glm::vec.8" = type { %union.anon.9, %union.anon.10, %union.anon.11 }
%union.anon.9 = type { float }
%union.anon.10 = type { float }
%union.anon.11 = type { float }
%"struct.glm::mat" = type { [4 x %"struct.glm::vec"] }
%"struct.glm::vec" = type { %union.anon, %union.anon.5, %union.anon.6, %union.anon.7 }
%union.anon = type { float }
%union.anon.5 = type { float }
%union.anon.6 = type { float }
%union.anon.7 = type { float }
%"struct.Lava::OpenGL::GLRenderObject" = type { %"struct.Lava::RenderObject", %"class.std::shared_ptr.33", %"class.std::shared_ptr.33", %"class.std::shared_ptr.36", %"class.std::shared_ptr.33", %"class.std::shared_ptr.33", ptr, ptr }
%"struct.Lava::RenderObject" = type { %"struct.Lava::Mesh", %"struct.Lava::Material" }
%"struct.Lava::Mesh" = type { ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32 }
%"struct.Lava::Material" = type <{ ptr, ptr, ptr, %"struct.glm::vec.8", [4 x i8], ptr, i32, i8, i8, [2 x i8], [3 x float], float, float, [4 x i8] }>
%"class.std::shared_ptr.36" = type { %"class.std::__shared_ptr.37" }
%"class.std::__shared_ptr.37" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.33" = type { %"class.std::__shared_ptr.34" }
%"class.std::__shared_ptr.34" = type { ptr, %"class.std::__shared_count" }
%"class.Lava::Entity" = type { %"class.Lava::SceneObject", ptr, ptr, ptr, ptr }
%"class.Lava::SceneObject" = type { ptr }
%"struct.Lava::Texture" = type <{ i32, i32, i32, i32, ptr, i8, [7 x i8] }>
%"class.Lava::OpenGL::GLNonbatchedRenderer" = type { %"class.Lava::NonbatchedRenderer", i32, ptr, ptr }
%"class.Lava::NonbatchedRenderer" = type { ptr, %"class.Lava::FrameBufferRenderer", %"class.std::vector", ptr }
%"class.Lava::FrameBufferRenderer" = type { i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Lava::Entity *, std::allocator<Lava::Entity *>>::_Vector_impl" }
%"struct.std::_Vector_base<Lava::Entity *, std::allocator<Lava::Entity *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Lava::Entity *, std::allocator<Lava::Entity *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Lava::Entity *, std::allocator<Lava::Entity *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.CameraData = type { %"struct.glm::mat", %"struct.glm::mat", %"struct.glm::mat", i32 }

@__glewActiveTexture = external global ptr, align 8
@.str.19 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [17 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Lava6OpenGL20GLNonbatchedRenderer10BindObjectEPNS_6EntityE(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef %1) unnamed_addr #3 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", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::shared_ptr", align 8
  %10 = alloca %"struct.glm::vec.8", align 4
  %11 = alloca { <2 x float>, float }, align 4
  %12 = alloca %"class.std::shared_ptr", align 8
  %13 = alloca %"class.std::shared_ptr", align 8
  %14 = alloca %"class.std::shared_ptr", align 8
  %15 = alloca %"class.std::shared_ptr", align 8
  %16 = alloca %"class.std::shared_ptr", align 8
  %17 = alloca %"struct.glm::mat", align 8
  %18 = alloca %"class.std::shared_ptr", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %19 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = call noundef ptr @_ZN4Lava6Entity15GetMeshRendererENS_8PlatformE(ptr noundef nonnull align 8 dereferenceable(40) %20, i32 noundef 0)
  %22 = call noundef ptr @_ZN4Lava12MeshRenderer15GetRenderObjectEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  store ptr %22, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.Lava::OpenGL::GLRenderObject", ptr %23, i32 0, i32 6
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = load ptr, ptr %25, align 8, !tbaa !23
  %27 = getelementptr inbounds ptr, ptr %26, i64 2
  %28 = load ptr, ptr %27, align 8
  call void %28(ptr noundef nonnull align 8 dereferenceable(56) %25)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load ptr, ptr %19, align 8, !tbaa !23
  %31 = getelementptr inbounds ptr, ptr %30, i64 7
  %32 = load ptr, ptr %31, align 8
  call void %32(ptr noundef nonnull align 8 dereferenceable(72) %19, ptr noundef %29)
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call noundef zeroext i1 @_ZN4Lava6OpenGL14GLRenderObject10HasTextureEv(ptr noundef nonnull align 8 dereferenceable(272) %33)
  br i1 %34, label %35, label %55

35:                                               ; preds = %2
  %36 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !5
  call void %36(i32 noundef 33984)
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.Lava::Entity", ptr %37, i32 0, i32 4
  %39 = load ptr, ptr %38, align 8, !tbaa !25
  %40 = getelementptr inbounds %"struct.Lava::Material", ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !28
  %42 = getelementptr inbounds %"struct.Lava::Texture", ptr %41, i32 0, i32 3
  %43 = load i32, ptr %42, align 4, !tbaa !29
  call void @glBindTexture(i32 noundef 3553, i32 noundef %43)
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #6
  %44 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %19, i32 0, i32 2
  %45 = load ptr, ptr %44, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %6, ptr noundef nonnull align 8 dereferenceable(40) %45, i32 noundef 1)
  %46 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  %47 = load ptr, ptr %46, align 8, !tbaa !23
  %48 = getelementptr inbounds ptr, ptr %47, i64 2
  %49 = load ptr, ptr %48, align 8
  invoke void %49(ptr noundef nonnull align 8 dereferenceable(36) %46, ptr noundef @.str.19, i32 noundef 0)
          to label %50 unwind label %51

50:                                               ; preds = %35
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  br label %55

51:                                               ; preds = %35
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %7, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  br label %187

55:                                               ; preds = %50, %2
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  %56 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %19, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %9, ptr noundef nonnull align 8 dereferenceable(40) %57, i32 noundef 1)
  %58 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %"class.Lava::Entity", ptr %59, i32 0, i32 4
  %61 = load ptr, ptr %60, align 8, !tbaa !25
  %62 = getelementptr inbounds %"struct.Lava::Material", ptr %61, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 8 %62, i64 12, i1 false), !tbaa.struct !39
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %10, i64 12, i1 false)
  %63 = getelementptr inbounds { <2 x float>, float }, ptr %11, i32 0, i32 0
  %64 = load <2 x float>, ptr %63, align 4
  %65 = getelementptr inbounds { <2 x float>, float }, ptr %11, i32 0, i32 1
  %66 = load float, ptr %65, align 4
  %67 = load ptr, ptr %58, align 8, !tbaa !23
  %68 = getelementptr inbounds ptr, ptr %67, i64 4
  %69 = load ptr, ptr %68, align 8
  invoke void %69(ptr noundef nonnull align 8 dereferenceable(36) %58, ptr noundef @.str.20, <2 x float> %64, float %66)
          to label %70 unwind label %89

70:                                               ; preds = %55
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = call noundef zeroext i1 @_ZN4Lava6OpenGL14GLRenderObject12HasNormalMapEv(ptr noundef nonnull align 8 dereferenceable(272) %71)
  br i1 %72, label %73, label %97

73:                                               ; preds = %70
  %74 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !5
  call void %74(i32 noundef 33985)
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %"class.Lava::Entity", ptr %75, i32 0, i32 4
  %77 = load ptr, ptr %76, align 8, !tbaa !25
  %78 = getelementptr inbounds %"struct.Lava::Material", ptr %77, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8, !tbaa !41
  %80 = getelementptr inbounds %"struct.Lava::Texture", ptr %79, i32 0, i32 3
  %81 = load i32, ptr %80, align 4, !tbaa !29
  call void @glBindTexture(i32 noundef 3553, i32 noundef %81)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %82 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %19, i32 0, i32 2
  %83 = load ptr, ptr %82, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %12, ptr noundef nonnull align 8 dereferenceable(40) %83, i32 noundef 1)
  %84 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  %85 = load ptr, ptr %84, align 8, !tbaa !23
  %86 = getelementptr inbounds ptr, ptr %85, i64 2
  %87 = load ptr, ptr %86, align 8
  invoke void %87(ptr noundef nonnull align 8 dereferenceable(36) %84, ptr noundef @.str.21, i32 noundef 1)
          to label %88 unwind label %93

88:                                               ; preds = %73
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  br label %97

89:                                               ; preds = %55
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %7, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  br label %187

93:                                               ; preds = %73
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %7, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  br label %187

97:                                               ; preds = %88, %70
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = call noundef zeroext i1 @_ZN4Lava6OpenGL14GLRenderObject14HasEmissionMapEv(ptr noundef nonnull align 8 dereferenceable(272) %98)
  br i1 %99, label %100, label %131

100:                                              ; preds = %97
  %101 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !5
  call void %101(i32 noundef 33989)
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %"class.Lava::Entity", ptr %102, i32 0, i32 4
  %104 = load ptr, ptr %103, align 8, !tbaa !25
  %105 = getelementptr inbounds %"struct.Lava::Material", ptr %104, i32 0, i32 2
  %106 = load ptr, ptr %105, align 8, !tbaa !42
  %107 = getelementptr inbounds %"struct.Lava::Texture", ptr %106, i32 0, i32 3
  %108 = load i32, ptr %107, align 4, !tbaa !29
  call void @glBindTexture(i32 noundef 3553, i32 noundef %108)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  %109 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %19, i32 0, i32 2
  %110 = load ptr, ptr %109, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %13, ptr noundef nonnull align 8 dereferenceable(40) %110, i32 noundef 1)
  %111 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  %112 = load ptr, ptr %111, align 8, !tbaa !23
  %113 = getelementptr inbounds ptr, ptr %112, i64 2
  %114 = load ptr, ptr %113, align 8
  invoke void %114(ptr noundef nonnull align 8 dereferenceable(36) %111, ptr noundef @.str.22, i32 noundef 5)
          to label %115 unwind label %123

115:                                              ; preds = %100
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %116 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %19, i32 0, i32 2
  %117 = load ptr, ptr %116, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %14, ptr noundef nonnull align 8 dereferenceable(40) %117, i32 noundef 1)
  %118 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %14) #6
  %119 = load ptr, ptr %118, align 8, !tbaa !23
  %120 = getelementptr inbounds ptr, ptr %119, i64 0
  %121 = load ptr, ptr %120, align 8
  invoke void %121(ptr noundef nonnull align 8 dereferenceable(36) %118, ptr noundef @.str.23, i1 noundef zeroext true)
          to label %122 unwind label %127

122:                                              ; preds = %115
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %131

123:                                              ; preds = %100
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %7, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  br label %187

127:                                              ; preds = %115
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %7, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %187

131:                                              ; preds = %122, %97
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  %132 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %19, i32 0, i32 2
  %133 = load ptr, ptr %132, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %15, ptr noundef nonnull align 8 dereferenceable(40) %133, i32 noundef 1)
  %134 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %15) #6
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %"class.Lava::Entity", ptr %135, i32 0, i32 4
  %137 = load ptr, ptr %136, align 8, !tbaa !25
  %138 = getelementptr inbounds %"struct.Lava::Material", ptr %137, i32 0, i32 8
  %139 = load i8, ptr %138, align 1, !tbaa !43, !range !44, !noundef !45
  %140 = trunc i8 %139 to i1
  %141 = load ptr, ptr %134, align 8, !tbaa !23
  %142 = getelementptr inbounds ptr, ptr %141, i64 0
  %143 = load ptr, ptr %142, align 8
  invoke void %143(ptr noundef nonnull align 8 dereferenceable(36) %134, ptr noundef @.str.24, i1 noundef zeroext %140)
          to label %144 unwind label %174

144:                                              ; preds = %131
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %"class.Lava::Entity", ptr %145, i32 0, i32 4
  %147 = load ptr, ptr %146, align 8, !tbaa !25
  %148 = getelementptr inbounds %"struct.Lava::Material", ptr %147, i32 0, i32 8
  %149 = load i8, ptr %148, align 1, !tbaa !43, !range !44, !noundef !45
  %150 = trunc i8 %149 to i1
  br i1 %150, label %151, label %186

151:                                              ; preds = %144
  %152 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !5
  call void %152(i32 noundef 33986)
  %153 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %19, i32 0, i32 3
  %154 = load ptr, ptr %153, align 8, !tbaa !46
  %155 = getelementptr inbounds %struct.CameraData, ptr %154, i32 0, i32 3
  %156 = load i32, ptr %155, align 4, !tbaa !47
  call void @glBindTexture(i32 noundef 3553, i32 noundef %156)
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  %157 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %19, i32 0, i32 2
  %158 = load ptr, ptr %157, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %16, ptr noundef nonnull align 8 dereferenceable(40) %158, i32 noundef 0)
  %159 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  %160 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %19, i32 0, i32 3
  %161 = load ptr, ptr %160, align 8, !tbaa !46
  %162 = getelementptr inbounds %struct.CameraData, ptr %161, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %162, i64 64, i1 false), !tbaa.struct !50
  %163 = load ptr, ptr %159, align 8, !tbaa !23
  %164 = getelementptr inbounds ptr, ptr %163, i64 6
  %165 = load ptr, ptr %164, align 8
  invoke void %165(ptr noundef nonnull align 8 dereferenceable(36) %159, ptr noundef @.str.25, ptr noundef byval(%"struct.glm::mat") align 8 %17)
          to label %166 unwind label %178

166:                                              ; preds = %151
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %167 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %19, i32 0, i32 2
  %168 = load ptr, ptr %167, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %18, ptr noundef nonnull align 8 dereferenceable(40) %168, i32 noundef 1)
  %169 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #6
  %170 = load ptr, ptr %169, align 8, !tbaa !23
  %171 = getelementptr inbounds ptr, ptr %170, i64 2
  %172 = load ptr, ptr %171, align 8
  invoke void %172(ptr noundef nonnull align 8 dereferenceable(36) %169, ptr noundef @.str.26, i32 noundef 2)
          to label %173 unwind label %182

173:                                              ; preds = %166
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %186

174:                                              ; preds = %131
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %7, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  br label %187

178:                                              ; preds = %151
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %7, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  br label %187

182:                                              ; preds = %166
  %183 = landingpad { ptr, i32 }
          cleanup
  %184 = extractvalue { ptr, i32 } %183, 0
  store ptr %184, ptr %7, align 8
  %185 = extractvalue { ptr, i32 } %183, 1
  store i32 %185, ptr %8, align 4
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %187

186:                                              ; preds = %173, %144
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void

187:                                              ; preds = %182, %178, %174, %127, %123, %93, %89, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %188

188:                                              ; preds = %187
  %189 = load ptr, ptr %7, align 8
  %190 = load i32, ptr %8, align 4
  %191 = insertvalue { ptr, i32 } poison, ptr %189, 0
  %192 = insertvalue { ptr, i32 } %191, i32 %190, 1
  resume { ptr, i32 } %192
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4Lava6Entity15GetMeshRendererENS_8PlatformE(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #4 align 2

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

declare noundef zeroext i1 @_ZN4Lava6OpenGL14GLRenderObject10HasTextureEv(ptr noundef nonnull align 8 dereferenceable(272)) #5

declare void @glBindTexture(i32 noundef, i32 noundef) #5

declare noundef zeroext i1 @_ZN4Lava6OpenGL14GLRenderObject12HasNormalMapEv(ptr noundef nonnull align 8 dereferenceable(272)) #5

declare noundef zeroext i1 @_ZN4Lava6OpenGL14GLRenderObject14HasEmissionMapEv(ptr noundef nonnull align 8 dereferenceable(272)) #5

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="64" "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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, !6, i64 256}
!10 = !{!"_ZTSN4Lava6OpenGL14GLRenderObjectE", !11, i64 0, !18, i64 176, !18, i64 192, !21, i64 208, !18, i64 224, !18, i64 240, !6, i64 256, !6, i64 264}
!11 = !{!"_ZTSN4Lava12RenderObjectE", !12, i64 0, !14, i64 96}
!12 = !{!"_ZTSN4Lava4MeshE", !6, i64 0, !13, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !13, i64 40, !6, i64 48, !13, i64 56, !6, i64 64, !13, i64 72, !6, i64 80, !13, i64 88}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSN4Lava8MaterialE", !6, i64 0, !6, i64 8, !6, i64 16, !15, i64 24, !6, i64 40, !13, i64 48, !16, i64 52, !16, i64 53, !7, i64 56, !17, i64 68, !17, i64 72}
!15 = !{!"_ZTSN3glm3vecILi3EfLNS_9qualifierE0EEE", !7, i64 0, !7, i64 4, !7, i64 8}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTSSt10shared_ptrIN4Lava6OpenGL14GLVertexBufferEE", !19, i64 0}
!19 = !{!"_ZTSSt12__shared_ptrIN4Lava6OpenGL14GLVertexBufferELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !20, i64 8}
!20 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!21 = !{!"_ZTSSt10shared_ptrIN4Lava6OpenGL13GLIndexBufferEE", !22, i64 0}
!22 = !{!"_ZTSSt12__shared_ptrIN4Lava6OpenGL13GLIndexBufferELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !20, i64 8}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !8, i64 0}
!25 = !{!26, !6, i64 32}
!26 = !{!"_ZTSN4Lava6EntityE", !27, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!27 = !{!"_ZTSN4Lava11SceneObjectE"}
!28 = !{!14, !6, i64 0}
!29 = !{!30, !13, i64 12}
!30 = !{!"_ZTSN4Lava7TextureE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !6, i64 16, !16, i64 24}
!31 = !{!32, !6, i64 56}
!32 = !{!"_ZTSN4Lava6OpenGL20GLNonbatchedRendererE", !33, i64 0, !13, i64 48, !6, i64 56, !6, i64 64}
!33 = !{!"_ZTSN4Lava18NonbatchedRendererE", !34, i64 8, !35, i64 16, !6, i64 40}
!34 = !{!"_ZTSN4Lava19FrameBufferRendererE", !13, i64 0}
!35 = !{!"_ZTSSt6vectorIPN4Lava6EntityESaIS2_EE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIPN4Lava6EntityESaIS2_EE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIPN4Lava6EntityESaIS2_EE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIPN4Lava6EntityESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!39 = !{i64 0, i64 4, !40, i64 4, i64 4, !40, i64 8, i64 4, !40}
!40 = !{!7, !7, i64 0}
!41 = !{!14, !6, i64 8}
!42 = !{!14, !6, i64 16}
!43 = !{!14, !16, i64 53}
!44 = !{i8 0, i8 2}
!45 = !{}
!46 = !{!32, !6, i64 64}
!47 = !{!48, !13, i64 192}
!48 = !{!"_ZTS10CameraData", !49, i64 0, !49, i64 64, !49, i64 128, !13, i64 192}
!49 = !{!"_ZTSN3glm3matILi4ELi4EfLNS_9qualifierE0EEE", !7, i64 0}
!50 = !{i64 0, i64 64, !40}


; 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 }
%"struct.glm::mat" = type { [4 x %"struct.glm::vec"] }
%"struct.glm::vec" = type { %union.anon, %union.anon.5, %union.anon.6, %union.anon.7 }
%union.anon = type { float }
%union.anon.5 = type { float }
%union.anon.6 = type { float }
%union.anon.7 = type { float }

@__glewActiveTexture = external local_unnamed_addr global ptr, align 8
@.str.19 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [17 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Lava6OpenGL20GLNonbatchedRenderer10BindObjectEPNS_6EntityE(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::shared_ptr", align 8
  %4 = alloca %"class.std::shared_ptr", align 8
  %5 = alloca %"class.std::shared_ptr", align 8
  %6 = alloca %"class.std::shared_ptr", align 8
  %7 = alloca %"class.std::shared_ptr", align 8
  %8 = alloca %"class.std::shared_ptr", align 8
  %9 = alloca %"class.std::shared_ptr", align 8
  %10 = alloca %"struct.glm::mat", align 8
  %11 = alloca %"class.std::shared_ptr", align 8
  %12 = tail call noundef ptr @_ZN4Lava6Entity15GetMeshRendererENS_8PlatformE(ptr noundef nonnull align 8 dereferenceable(40) %1, i32 noundef 0)
  %13 = tail call noundef ptr @_ZN4Lava12MeshRenderer15GetRenderObjectEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %14 = getelementptr inbounds i8, ptr %13, i64 256
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = load ptr, ptr %15, align 8, !tbaa !22
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  %18 = load ptr, ptr %17, align 8
  tail call void %18(ptr noundef nonnull align 8 dereferenceable(56) %15)
  %19 = load ptr, ptr %0, align 8, !tbaa !22
  %20 = getelementptr inbounds i8, ptr %19, i64 56
  %21 = load ptr, ptr %20, align 8
  tail call void %21(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull %1)
  %22 = tail call noundef zeroext i1 @_ZN4Lava6OpenGL14GLRenderObject10HasTextureEv(ptr noundef nonnull align 8 dereferenceable(272) %13)
  br i1 %22, label %23, label %39

23:                                               ; preds = %2
  %24 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !24
  tail call void %24(i32 noundef 33984)
  %25 = getelementptr inbounds i8, ptr %1, i64 32
  %26 = load ptr, ptr %25, align 8, !tbaa !25
  %27 = load ptr, ptr %26, align 8, !tbaa !28
  %28 = getelementptr inbounds i8, ptr %27, i64 12
  %29 = load i32, ptr %28, align 4, !tbaa !29
  tail call void @glBindTexture(i32 noundef 3553, i32 noundef %29)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  %30 = getelementptr inbounds i8, ptr %0, i64 56
  %31 = load ptr, ptr %30, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %3, ptr noundef nonnull align 8 dereferenceable(40) %31, i32 noundef 1)
  %32 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  %33 = load ptr, ptr %32, align 8, !tbaa !22
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %35 = load ptr, ptr %34, align 8
  invoke void %35(ptr noundef nonnull align 8 dereferenceable(36) %32, ptr noundef nonnull @.str.19, i32 noundef 0)
          to label %36 unwind label %37

36:                                               ; preds = %23
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  br label %39

37:                                               ; preds = %23
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  br label %133

39:                                               ; preds = %36, %2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  %40 = getelementptr inbounds i8, ptr %0, i64 56
  %41 = load ptr, ptr %40, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %4, ptr noundef nonnull align 8 dereferenceable(40) %41, i32 noundef 1)
  %42 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  %43 = getelementptr inbounds i8, ptr %1, i64 32
  %44 = load ptr, ptr %43, align 8, !tbaa !25
  %45 = getelementptr inbounds i8, ptr %44, i64 24
  %.sroa.01.0.copyload = load <2 x float>, ptr %45, align 8
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %44, i64 32
  %.sroa.22.0.copyload = load float, ptr %.sroa.22.0..sroa_idx, align 8, !tbaa !39
  %46 = load ptr, ptr %42, align 8, !tbaa !22
  %47 = getelementptr inbounds i8, ptr %46, i64 32
  %48 = load ptr, ptr %47, align 8
  invoke void %48(ptr noundef nonnull align 8 dereferenceable(36) %42, ptr noundef nonnull @.str.20, <2 x float> %.sroa.01.0.copyload, float %.sroa.22.0.copyload)
          to label %49 unwind label %64

49:                                               ; preds = %39
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  %50 = call noundef zeroext i1 @_ZN4Lava6OpenGL14GLRenderObject12HasNormalMapEv(ptr noundef nonnull align 8 dereferenceable(272) %13)
  br i1 %50, label %51, label %68

51:                                               ; preds = %49
  %52 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !24
  call void %52(i32 noundef 33985)
  %53 = load ptr, ptr %43, align 8, !tbaa !25
  %54 = getelementptr inbounds i8, ptr %53, i64 8
  %55 = load ptr, ptr %54, align 8, !tbaa !40
  %56 = getelementptr inbounds i8, ptr %55, i64 12
  %57 = load i32, ptr %56, align 4, !tbaa !29
  call void @glBindTexture(i32 noundef 3553, i32 noundef %57)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  %58 = load ptr, ptr %40, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %5, ptr noundef nonnull align 8 dereferenceable(40) %58, i32 noundef 1)
  %59 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  %60 = load ptr, ptr %59, align 8, !tbaa !22
  %61 = getelementptr inbounds i8, ptr %60, i64 16
  %62 = load ptr, ptr %61, align 8
  invoke void %62(ptr noundef nonnull align 8 dereferenceable(36) %59, ptr noundef nonnull @.str.21, i32 noundef 1)
          to label %63 unwind label %66

63:                                               ; preds = %51
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  br label %68

64:                                               ; preds = %39
  %65 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  br label %133

66:                                               ; preds = %51
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  br label %133

68:                                               ; preds = %63, %49
  %69 = call noundef zeroext i1 @_ZN4Lava6OpenGL14GLRenderObject14HasEmissionMapEv(ptr noundef nonnull align 8 dereferenceable(272) %13)
  br i1 %69, label %70, label %92

70:                                               ; preds = %68
  %71 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !24
  call void %71(i32 noundef 33989)
  %72 = load ptr, ptr %43, align 8, !tbaa !25
  %73 = getelementptr inbounds i8, ptr %72, i64 16
  %74 = load ptr, ptr %73, align 8, !tbaa !41
  %75 = getelementptr inbounds i8, ptr %74, i64 12
  %76 = load i32, ptr %75, align 4, !tbaa !29
  call void @glBindTexture(i32 noundef 3553, i32 noundef %76)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  %77 = load ptr, ptr %40, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %6, ptr noundef nonnull align 8 dereferenceable(40) %77, i32 noundef 1)
  %78 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  %79 = load ptr, ptr %78, align 8, !tbaa !22
  %80 = getelementptr inbounds i8, ptr %79, i64 16
  %81 = load ptr, ptr %80, align 8
  invoke void %81(ptr noundef nonnull align 8 dereferenceable(36) %78, ptr noundef nonnull @.str.22, i32 noundef 5)
          to label %82 unwind label %88

82:                                               ; preds = %70
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %83 = load ptr, ptr %40, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %7, ptr noundef nonnull align 8 dereferenceable(40) %83, i32 noundef 1)
  %84 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  %85 = load ptr, ptr %84, align 8, !tbaa !22
  %86 = load ptr, ptr %85, align 8
  invoke void %86(ptr noundef nonnull align 8 dereferenceable(36) %84, ptr noundef nonnull @.str.23, i1 noundef zeroext true)
          to label %87 unwind label %90

87:                                               ; preds = %82
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br label %92

88:                                               ; preds = %70
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  br label %133

90:                                               ; preds = %82
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br label %133

92:                                               ; preds = %87, %68
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  %93 = load ptr, ptr %40, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %8, ptr noundef nonnull align 8 dereferenceable(40) %93, i32 noundef 1)
  %94 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  %95 = load ptr, ptr %43, align 8, !tbaa !25
  %96 = getelementptr inbounds i8, ptr %95, i64 53
  %97 = load i8, ptr %96, align 1, !tbaa !42, !range !43, !noundef !44
  %98 = trunc nuw i8 %97 to i1
  %99 = load ptr, ptr %94, align 8, !tbaa !22
  %100 = load ptr, ptr %99, align 8
  invoke void %100(ptr noundef nonnull align 8 dereferenceable(36) %94, ptr noundef nonnull @.str.24, i1 noundef zeroext %98)
          to label %101 unwind label %126

101:                                              ; preds = %92
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  %102 = load ptr, ptr %43, align 8, !tbaa !25
  %103 = getelementptr inbounds i8, ptr %102, i64 53
  %104 = load i8, ptr %103, align 1, !tbaa !42, !range !43, !noundef !44
  %105 = trunc nuw i8 %104 to i1
  br i1 %105, label %106, label %132

106:                                              ; preds = %101
  %107 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !24
  call void %107(i32 noundef 33986)
  %108 = getelementptr inbounds i8, ptr %0, i64 64
  %109 = load ptr, ptr %108, align 8, !tbaa !45
  %110 = getelementptr inbounds i8, ptr %109, i64 192
  %111 = load i32, ptr %110, align 4, !tbaa !46
  call void @glBindTexture(i32 noundef 3553, i32 noundef %111)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  %112 = load ptr, ptr %40, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %9, ptr noundef nonnull align 8 dereferenceable(40) %112, i32 noundef 0)
  %113 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  %114 = load ptr, ptr %108, align 8, !tbaa !45
  %115 = getelementptr inbounds i8, ptr %114, i64 128
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %10, ptr noundef nonnull align 4 dereferenceable(64) %115, i64 64, i1 false), !tbaa.struct !49
  %116 = load ptr, ptr %113, align 8, !tbaa !22
  %117 = getelementptr inbounds i8, ptr %116, i64 48
  %118 = load ptr, ptr %117, align 8
  invoke void %118(ptr noundef nonnull align 8 dereferenceable(36) %113, ptr noundef nonnull @.str.25, ptr noundef nonnull byval(%"struct.glm::mat") align 8 %10)
          to label %119 unwind label %128

119:                                              ; preds = %106
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  %120 = load ptr, ptr %40, align 8, !tbaa !31
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %11, ptr noundef nonnull align 8 dereferenceable(40) %120, i32 noundef 1)
  %121 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %11) #6
  %122 = load ptr, ptr %121, align 8, !tbaa !22
  %123 = getelementptr inbounds i8, ptr %122, i64 16
  %124 = load ptr, ptr %123, align 8
  invoke void %124(ptr noundef nonnull align 8 dereferenceable(36) %121, ptr noundef nonnull @.str.26, i32 noundef 2)
          to label %125 unwind label %130

125:                                              ; preds = %119
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  br label %132

126:                                              ; preds = %92
  %127 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  br label %133

128:                                              ; preds = %106
  %129 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br label %133

130:                                              ; preds = %119
  %131 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  br label %133

132:                                              ; preds = %125, %101
  ret void

133:                                              ; preds = %130, %128, %126, %90, %88, %66, %64, %37
  %.pn = phi { ptr, i32 } [ %131, %130 ], [ %129, %128 ], [ %127, %126 ], [ %91, %90 ], [ %89, %88 ], [ %67, %66 ], [ %65, %64 ], [ %38, %37 ]
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4Lava6Entity15GetMeshRendererENS_8PlatformE(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #4 align 2

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

declare noundef zeroext i1 @_ZN4Lava6OpenGL14GLRenderObject10HasTextureEv(ptr noundef nonnull align 8 dereferenceable(272)) local_unnamed_addr #5

declare void @glBindTexture(i32 noundef, i32 noundef) local_unnamed_addr #5

declare noundef zeroext i1 @_ZN4Lava6OpenGL14GLRenderObject12HasNormalMapEv(ptr noundef nonnull align 8 dereferenceable(272)) local_unnamed_addr #5

declare noundef zeroext i1 @_ZN4Lava6OpenGL14GLRenderObject14HasEmissionMapEv(ptr noundef nonnull align 8 dereferenceable(272)) local_unnamed_addr #5

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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="64" "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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, !9, i64 256}
!6 = !{!"_ZTSN4Lava6OpenGL14GLRenderObjectE", !7, i64 0, !17, i64 176, !17, i64 192, !20, i64 208, !17, i64 224, !17, i64 240, !9, i64 256, !9, i64 264}
!7 = !{!"_ZTSN4Lava12RenderObjectE", !8, i64 0, !13, i64 96}
!8 = !{!"_ZTSN4Lava4MeshE", !9, i64 0, !12, i64 8, !9, i64 16, !12, i64 24, !9, i64 32, !12, i64 40, !9, i64 48, !12, i64 56, !9, i64 64, !12, i64 72, !9, i64 80, !12, i64 88}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"int", !10, i64 0}
!13 = !{!"_ZTSN4Lava8MaterialE", !9, i64 0, !9, i64 8, !9, i64 16, !14, i64 24, !9, i64 40, !12, i64 48, !15, i64 52, !15, i64 53, !10, i64 56, !16, i64 68, !16, i64 72}
!14 = !{!"_ZTSN3glm3vecILi3EfLNS_9qualifierE0EEE", !10, i64 0, !10, i64 4, !10, i64 8}
!15 = !{!"bool", !10, i64 0}
!16 = !{!"float", !10, i64 0}
!17 = !{!"_ZTSSt10shared_ptrIN4Lava6OpenGL14GLVertexBufferEE", !18, i64 0}
!18 = !{!"_ZTSSt12__shared_ptrIN4Lava6OpenGL14GLVertexBufferELN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0, !19, i64 8}
!19 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0}
!20 = !{!"_ZTSSt10shared_ptrIN4Lava6OpenGL13GLIndexBufferEE", !21, i64 0}
!21 = !{!"_ZTSSt12__shared_ptrIN4Lava6OpenGL13GLIndexBufferELN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0, !19, i64 8}
!22 = !{!23, !23, i64 0}
!23 = !{!"vtable pointer", !11, i64 0}
!24 = !{!9, !9, i64 0}
!25 = !{!26, !9, i64 32}
!26 = !{!"_ZTSN4Lava6EntityE", !27, i64 0, !9, i64 8, !9, i64 16, !9, i64 24, !9, i64 32}
!27 = !{!"_ZTSN4Lava11SceneObjectE"}
!28 = !{!13, !9, i64 0}
!29 = !{!30, !12, i64 12}
!30 = !{!"_ZTSN4Lava7TextureE", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !9, i64 16, !15, i64 24}
!31 = !{!32, !9, i64 56}
!32 = !{!"_ZTSN4Lava6OpenGL20GLNonbatchedRendererE", !33, i64 0, !12, i64 48, !9, i64 56, !9, i64 64}
!33 = !{!"_ZTSN4Lava18NonbatchedRendererE", !34, i64 8, !35, i64 16, !9, i64 40}
!34 = !{!"_ZTSN4Lava19FrameBufferRendererE", !12, i64 0}
!35 = !{!"_ZTSSt6vectorIPN4Lava6EntityESaIS2_EE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIPN4Lava6EntityESaIS2_EE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIPN4Lava6EntityESaIS2_EE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIPN4Lava6EntityESaIS2_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!39 = !{!10, !10, i64 0}
!40 = !{!13, !9, i64 8}
!41 = !{!13, !9, i64 16}
!42 = !{!13, !15, i64 53}
!43 = !{i8 0, i8 2}
!44 = !{}
!45 = !{!32, !9, i64 64}
!46 = !{!47, !12, i64 192}
!47 = !{!"_ZTS10CameraData", !48, i64 0, !48, i64 64, !48, i64 128, !12, i64 192}
!48 = !{!"_ZTSN3glm3matILi4ELi4EfLNS_9qualifierE0EEE", !10, i64 0}
!49 = !{i64 0, i64 64, !39}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass