; 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.__gnu_cxx::__normal_iterator" = 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 }
%"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.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 }
%"class.Lava::Entity" = type { %"class.Lava::SceneObject", ptr, ptr, ptr, ptr }
%"class.Lava::SceneObject" = type { ptr }
%"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] }>
%"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.Lava::Mesh" = type { ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32 }

@__glewBindFramebuffer = external global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [13 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 uwtable
define dso_local void @_ZN4Lava6OpenGL20GLNonbatchedRenderer6RenderER10CameraData(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 4 dereferenceable(196) %1) unnamed_addr #1 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.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.glm::mat", align 4
  %10 = alloca %"class.std::shared_ptr", align 8
  %11 = alloca %"struct.glm::mat", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::shared_ptr", align 8
  %15 = 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
  %16 = load ptr, ptr %3, align 8
  %17 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %16, i32 0, i32 2
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = load ptr, ptr %18, align 8, !tbaa !18
  %20 = getelementptr inbounds ptr, ptr %19, i64 3
  %21 = load ptr, ptr %20, align 8
  call void %21(ptr noundef nonnull align 8 dereferenceable(40) %18)
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = load ptr, ptr %16, align 8, !tbaa !18
  %24 = getelementptr inbounds ptr, ptr %23, i64 4
  %25 = load ptr, ptr %24, align 8
  call void %25(ptr noundef nonnull align 8 dereferenceable(72) %16, ptr noundef nonnull align 4 dereferenceable(196) %22)
  call void @glEnable(i32 noundef 12288)
  %26 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %16, i64 8
  %28 = getelementptr inbounds %"class.Lava::FrameBufferRenderer", ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !20
  call void %26(i32 noundef 36160, i32 noundef %29)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %30 = getelementptr inbounds %"class.Lava::NonbatchedRenderer", ptr %16, i32 0, i32 2
  store ptr %30, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = call ptr @_ZNSt6vectorIPN4Lava6EntityESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #6
  %33 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %32, ptr %33, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = call ptr @_ZNSt6vectorIPN4Lava6EntityESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #6
  %36 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %35, ptr %36, align 8
  br label %37

37:                                               ; preds = %90, %2
  %38 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN4Lava6EntityESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br i1 %38, label %40, label %39

39:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %105

40:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN4Lava6EntityESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  store ptr %42, ptr %8, align 8, !tbaa !5
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load ptr, ptr %16, align 8, !tbaa !18
  %45 = getelementptr inbounds ptr, ptr %44, i64 5
  %46 = load ptr, ptr %45, align 8
  call void %46(ptr noundef nonnull align 8 dereferenceable(72) %16, ptr noundef %43)
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #6
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.Lava::Entity", ptr %47, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !21
  call void @_ZN4Lava9Transform23GetTransformationMatrixEv(ptr dead_on_unwind writable sret(%"struct.glm::mat") align 4 %9, ptr noundef nonnull align 4 dereferenceable(36) %49)
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  %50 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %16, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %10, ptr noundef nonnull align 8 dereferenceable(40) %51, i32 noundef 0)
  %52 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %9, i64 64, i1 false), !tbaa.struct !24
  %53 = load ptr, ptr %52, align 8, !tbaa !18
  %54 = getelementptr inbounds ptr, ptr %53, i64 6
  %55 = load ptr, ptr %54, align 8
  invoke void %55(ptr noundef nonnull align 8 dereferenceable(36) %52, ptr noundef @.str.6, ptr noundef byval(%"struct.glm::mat") align 8 %11)
          to label %56 unwind label %92

56:                                               ; preds = %40
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %57 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %16, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %14, 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) %14) #6
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = getelementptr inbounds %"class.Lava::Entity", ptr %60, i32 0, i32 4
  %62 = load ptr, ptr %61, align 8, !tbaa !26
  %63 = getelementptr inbounds %"struct.Lava::Material", ptr %62, i32 0, i32 11
  %64 = load float, ptr %63, align 4, !tbaa !27
  %65 = load ptr, ptr %59, align 8, !tbaa !18
  %66 = getelementptr inbounds ptr, ptr %65, i64 1
  %67 = load ptr, ptr %66, align 8
  invoke void %67(ptr noundef nonnull align 8 dereferenceable(36) %59, ptr noundef @.str.7, float noundef %64)
          to label %68 unwind label %96

68:                                               ; preds = %56
  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
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  %69 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %16, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %15, ptr noundef nonnull align 8 dereferenceable(40) %70, i32 noundef 1)
  %71 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %15) #6
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %"class.Lava::Entity", ptr %72, i32 0, i32 4
  %74 = load ptr, ptr %73, align 8, !tbaa !26
  %75 = getelementptr inbounds %"struct.Lava::Material", ptr %74, i32 0, i32 12
  %76 = load float, ptr %75, align 8, !tbaa !32
  %77 = load ptr, ptr %71, align 8, !tbaa !18
  %78 = getelementptr inbounds ptr, ptr %77, i64 1
  %79 = load ptr, ptr %78, align 8
  invoke void %79(ptr noundef nonnull align 8 dereferenceable(36) %71, ptr noundef @.str.8, float noundef %76)
          to label %80 unwind label %100

80:                                               ; preds = %68
  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
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds %"class.Lava::Entity", ptr %81, i32 0, i32 3
  %83 = load ptr, ptr %82, align 8, !tbaa !33
  %84 = getelementptr inbounds %"struct.Lava::Mesh", ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 8, !tbaa !34
  call void @glDrawElements(i32 noundef 4, i32 noundef %85, i32 noundef 5125, ptr noundef null)
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = load ptr, ptr %16, align 8, !tbaa !18
  %88 = getelementptr inbounds ptr, ptr %87, i64 6
  %89 = load ptr, ptr %88, align 8
  call void %89(ptr noundef nonnull align 8 dereferenceable(72) %16, ptr noundef %86)
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %90

90:                                               ; preds = %80
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN4Lava6EntityESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br label %37

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

96:                                               ; preds = %56
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %12, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %13, 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 %104

100:                                              ; preds = %68
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %12, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %13, 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 %104

104:                                              ; preds = %100, %96, %92
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %112

105:                                              ; preds = %39
  %106 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !5
  call void %106(i32 noundef 36160, i32 noundef 0)
  call void @glDisable(i32 noundef 12288)
  %107 = getelementptr inbounds %"class.Lava::OpenGL::GLNonbatchedRenderer", ptr %16, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !9
  %109 = load ptr, ptr %108, align 8, !tbaa !18
  %110 = getelementptr inbounds ptr, ptr %109, i64 4
  %111 = load ptr, ptr %110, align 8
  call void %111(ptr noundef nonnull align 8 dereferenceable(40) %108)
  ret void

112:                                              ; preds = %104
  %113 = load ptr, ptr %12, align 8
  %114 = load i32, ptr %13, align 4
  %115 = insertvalue { ptr, i32 } poison, ptr %113, 0
  %116 = insertvalue { ptr, i32 } %115, i32 %114, 1
  resume { ptr, i32 } %116
}

declare void @glEnable(i32 noundef) #2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Lava9Transform23GetTransformationMatrixEv(ptr dead_on_unwind noalias writable sret(%"struct.glm::mat") align 4, ptr noundef nonnull align 4 dereferenceable(36)) #1 align 2

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

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

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

declare void @glDrawElements(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #2

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

declare void @glDisable(i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 56}
!10 = !{!"_ZTSN4Lava6OpenGL20GLNonbatchedRendererE", !11, i64 0, !13, i64 48, !6, i64 56, !6, i64 64}
!11 = !{!"_ZTSN4Lava18NonbatchedRendererE", !12, i64 8, !14, i64 16, !6, i64 40}
!12 = !{!"_ZTSN4Lava19FrameBufferRendererE", !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSSt6vectorIPN4Lava6EntityESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIPN4Lava6EntityESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPN4Lava6EntityESaIS2_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPN4Lava6EntityESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!19, !19, i64 0}
!19 = !{!"vtable pointer", !8, i64 0}
!20 = !{!12, !13, i64 0}
!21 = !{!22, !6, i64 8}
!22 = !{!"_ZTSN4Lava6EntityE", !23, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!23 = !{!"_ZTSN4Lava11SceneObjectE"}
!24 = !{i64 0, i64 64, !25}
!25 = !{!7, !7, i64 0}
!26 = !{!22, !6, i64 32}
!27 = !{!28, !31, i64 68}
!28 = !{!"_ZTSN4Lava8MaterialE", !6, i64 0, !6, i64 8, !6, i64 16, !29, i64 24, !6, i64 40, !13, i64 48, !30, i64 52, !30, i64 53, !7, i64 56, !31, i64 68, !31, i64 72}
!29 = !{!"_ZTSN3glm3vecILi3EfLNS_9qualifierE0EEE", !7, i64 0, !7, i64 4, !7, i64 8}
!30 = !{!"bool", !7, i64 0}
!31 = !{!"float", !7, i64 0}
!32 = !{!28, !31, i64 72}
!33 = !{!22, !6, i64 24}
!34 = !{!35, !13, i64 8}
!35 = !{!"_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}


; 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.__gnu_cxx::__normal_iterator" = 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 }
%"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 }

@__glewBindFramebuffer = external local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [13 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 uwtable
define dso_local void @_ZN4Lava6OpenGL20GLNonbatchedRenderer6RenderER10CameraData(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 4 dereferenceable(196) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"struct.glm::mat", 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 = getelementptr inbounds i8, ptr %0, i64 56
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = load ptr, ptr %10, align 8, !tbaa !17
  %12 = getelementptr inbounds i8, ptr %11, i64 24
  %13 = load ptr, ptr %12, align 8
  tail call void %13(ptr noundef nonnull align 8 dereferenceable(40) %10)
  %14 = load ptr, ptr %0, align 8, !tbaa !17
  %15 = getelementptr inbounds i8, ptr %14, i64 32
  %16 = load ptr, ptr %15, align 8
  tail call void %16(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 4 dereferenceable(196) %1)
  tail call void @glEnable(i32 noundef 12288)
  %17 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !19
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = load i32, ptr %18, align 8, !tbaa !20
  tail call void %17(i32 noundef 36160, i32 noundef %19)
  %20 = getelementptr inbounds i8, ptr %0, i64 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %21 = tail call ptr @_ZNSt6vectorIPN4Lava6EntityESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  store ptr %21, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %22 = tail call ptr @_ZNSt6vectorIPN4Lava6EntityESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  store ptr %22, ptr %4, align 8
  %23 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN4Lava6EntityESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  br i1 %23, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %60, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %24 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !19
  call void %24(i32 noundef 36160, i32 noundef 0)
  call void @glDisable(i32 noundef 12288)
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = load ptr, ptr %25, align 8, !tbaa !17
  %27 = getelementptr inbounds i8, ptr %26, i64 32
  %28 = load ptr, ptr %27, align 8
  call void %28(ptr noundef nonnull align 8 dereferenceable(40) %25)
  ret void

.lr.ph:                                           ; preds = %2, %60
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN4Lava6EntityESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %30 = load ptr, ptr %29, align 8, !tbaa !19
  %31 = load ptr, ptr %0, align 8, !tbaa !17
  %32 = getelementptr inbounds i8, ptr %31, i64 40
  %33 = load ptr, ptr %32, align 8
  call void %33(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef %30)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #5
  %34 = getelementptr inbounds i8, ptr %30, i64 8
  %35 = load ptr, ptr %34, align 8, !tbaa !21
  call void @_ZN4Lava9Transform23GetTransformationMatrixEv(ptr dead_on_unwind nonnull writable sret(%"struct.glm::mat") align 4 %5, ptr noundef nonnull align 4 dereferenceable(36) %35)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %6, ptr noundef nonnull align 8 dereferenceable(40) %36, i32 noundef 0)
  %37 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  %38 = load ptr, ptr %37, align 8, !tbaa !17
  %39 = getelementptr inbounds i8, ptr %38, i64 48
  %40 = load ptr, ptr %39, align 8
  invoke void %40(ptr noundef nonnull align 8 dereferenceable(36) %37, ptr noundef nonnull @.str.6, ptr noundef nonnull byval(%"struct.glm::mat") align 8 %5)
          to label %41 unwind label %70

41:                                               ; preds = %.lr.ph
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %7, ptr noundef nonnull align 8 dereferenceable(40) %42, i32 noundef 1)
  %43 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  %44 = getelementptr inbounds i8, ptr %30, i64 32
  %45 = load ptr, ptr %44, align 8, !tbaa !24
  %46 = getelementptr inbounds i8, ptr %45, i64 68
  %47 = load float, ptr %46, align 4, !tbaa !25
  %48 = load ptr, ptr %43, align 8, !tbaa !17
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  %50 = load ptr, ptr %49, align 8
  invoke void %50(ptr noundef nonnull align 8 dereferenceable(36) %43, ptr noundef nonnull @.str.7, float noundef %47)
          to label %51 unwind label %72

51:                                               ; preds = %41
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN4Lava10ShaderBank9GetShaderEi(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr") align 8 %8, ptr noundef nonnull align 8 dereferenceable(40) %52, i32 noundef 1)
  %53 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  %54 = load ptr, ptr %44, align 8, !tbaa !24
  %55 = getelementptr inbounds i8, ptr %54, i64 72
  %56 = load float, ptr %55, align 8, !tbaa !30
  %57 = load ptr, ptr %53, align 8, !tbaa !17
  %58 = getelementptr inbounds i8, ptr %57, i64 8
  %59 = load ptr, ptr %58, align 8
  invoke void %59(ptr noundef nonnull align 8 dereferenceable(36) %53, ptr noundef nonnull @.str.8, float noundef %56)
          to label %60 unwind label %74

60:                                               ; preds = %51
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  %61 = getelementptr inbounds i8, ptr %30, i64 24
  %62 = load ptr, ptr %61, align 8, !tbaa !31
  %63 = getelementptr inbounds i8, ptr %62, i64 8
  %64 = load i32, ptr %63, align 8, !tbaa !32
  call void @glDrawElements(i32 noundef 4, i32 noundef %64, i32 noundef 5125, ptr noundef null)
  %65 = load ptr, ptr %0, align 8, !tbaa !17
  %66 = getelementptr inbounds i8, ptr %65, i64 48
  %67 = load ptr, ptr %66, align 8
  call void %67(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull %30)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #5
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN4Lava6EntityESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %69 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN4Lava6EntityESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  br i1 %69, label %.lr.ph, label %._crit_edge

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

72:                                               ; preds = %41
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4Lava6ShaderELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  br label %76

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

76:                                               ; preds = %74, %72, %70
  %.pn = phi { ptr, i32 } [ %75, %74 ], [ %73, %72 ], [ %71, %70 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn
}

declare void @glEnable(i32 noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Lava9Transform23GetTransformationMatrixEv(ptr dead_on_unwind noalias writable sret(%"struct.glm::mat") align 4, ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #1 align 2

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

declare void @glDrawElements(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

declare void @glDisable(i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !16, i64 56}
!6 = !{!"_ZTSN4Lava6OpenGL20GLNonbatchedRendererE", !7, i64 0, !9, i64 48, !16, i64 56, !16, i64 64}
!7 = !{!"_ZTSN4Lava18NonbatchedRendererE", !8, i64 8, !12, i64 16, !16, i64 40}
!8 = !{!"_ZTSN4Lava19FrameBufferRendererE", !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSSt6vectorIPN4Lava6EntityESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIPN4Lava6EntityESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIPN4Lava6EntityESaIS2_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPN4Lava6EntityESaIS2_EE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!16 = !{!"any pointer", !10, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !11, i64 0}
!19 = !{!16, !16, i64 0}
!20 = !{!8, !9, i64 0}
!21 = !{!22, !16, i64 8}
!22 = !{!"_ZTSN4Lava6EntityE", !23, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32}
!23 = !{!"_ZTSN4Lava11SceneObjectE"}
!24 = !{!22, !16, i64 32}
!25 = !{!26, !29, i64 68}
!26 = !{!"_ZTSN4Lava8MaterialE", !16, i64 0, !16, i64 8, !16, i64 16, !27, i64 24, !16, i64 40, !9, i64 48, !28, i64 52, !28, i64 53, !10, i64 56, !29, i64 68, !29, i64 72}
!27 = !{!"_ZTSN3glm3vecILi3EfLNS_9qualifierE0EEE", !10, i64 0, !10, i64 4, !10, i64 8}
!28 = !{!"bool", !10, i64 0}
!29 = !{!"float", !10, i64 0}
!30 = !{!26, !29, i64 72}
!31 = !{!22, !16, i64 24}
!32 = !{!33, !9, i64 8}
!33 = !{!"_ZTSN4Lava4MeshE", !16, i64 0, !9, i64 8, !16, i64 16, !9, i64 24, !16, i64 32, !9, i64 40, !16, i64 48, !9, i64 56, !16, i64 64, !9, i64 72, !16, i64 80, !9, i64 88}


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