; LLVM IR from Angelo1211/HybridRenderingEngine :: src (sceneManager)

; 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.SceneManager = type { %"class.std::__cxx11::basic_string", ptr }
%"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.Scene = type { %struct.CubeMap, %struct.CubeMap, %struct.Texture, %struct.Skybox, i32, i8, ptr, %"class.std::__cxx11::basic_string", i8, %struct.DirectionalLight, ptr, %"class.std::vector", %"class.std::vector" }
%struct.CubeMap = type <{ %struct.Texture, i32, [4 x i8] }>
%struct.Texture = type { i32, i32, i32, i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }
%struct.Skybox = type { i32, %struct.Texture, %struct.CubeMap }
%struct.DirectionalLight = type { %struct.BaseLight, %"struct.glm::vec", %"struct.glm::mat", %"struct.glm::mat", float, float }
%struct.BaseLight = type { %"struct.glm::vec", %"struct.glm::mat", i8, float, float, float, i32, i32 }
%"struct.glm::vec" = type { %union.anon.0 }
%union.anon.0 = type { %struct.anon }
%struct.anon = type { float, float, float }
%"struct.glm::mat" = type { [4 x %"struct.glm::vec.3"] }
%"struct.glm::vec.3" = type { %union.anon.4 }
%union.anon.4 = type { %struct.anon.5 }
%struct.anon.5 = type { float, float, float, float }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Model *, std::allocator<Model *>>::_Vector_impl" }
%"struct.std::_Vector_base<Model *, std::allocator<Model *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Model *, std::allocator<Model *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Model *, std::allocator<Model *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN12SceneManager9loadSceneENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1) #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 i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  %8 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 792) #4
  invoke void @_ZN5SceneC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(792) %8, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %9 unwind label %17

9:                                                ; preds = %2
  %10 = getelementptr inbounds %class.SceneManager, ptr %7, i32 0, i32 1
  store ptr %8, ptr %10, align 8, !tbaa !9
  %11 = getelementptr inbounds %class.SceneManager, ptr %7, i32 0, i32 1
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = getelementptr inbounds %class.Scene, ptr %12, i32 0, i32 5
  %14 = load i8, ptr %13, align 4, !tbaa !14, !range !30, !noundef !31
  %15 = trunc i8 %14 to i1
  %16 = xor i1 %15, true
  ret i1 %16

17:                                               ; preds = %2
  %18 = landingpad { ptr, i32 }
          cleanup
  %19 = extractvalue { ptr, i32 } %18, 0
  store ptr %19, ptr %5, align 8
  %20 = extractvalue { ptr, i32 } %18, 1
  store i32 %20, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %8, i64 noundef 792) #5
  br label %21

21:                                               ; preds = %17
  %22 = load ptr, ptr %5, align 8
  %23 = load i32, ptr %6, align 4
  %24 = insertvalue { ptr, i32 } poison, ptr %22, 0
  %25 = insertvalue { ptr, i32 } %24, i32 %23, 1
  resume { ptr, i32 } %25
}

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_ZN5SceneC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(792), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

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 = { 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 #2 = { 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 #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 = { builtin allocsize(0) }
attributes #5 = { 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 32}
!10 = !{!"_ZTS12SceneManager", !11, i64 0, !6, i64 32}
!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, !20, i64 436}
!15 = !{!"_ZTS5Scene", !16, i64 0, !16, i64 88, !17, i64 176, !19, i64 256, !18, i64 432, !20, i64 436, !6, i64 440, !11, i64 448, !20, i64 480, !21, i64 484, !6, i64 736, !26, i64 744, !26, i64 768}
!16 = !{!"_ZTS7CubeMap", !17, i64 0, !18, i64 80}
!17 = !{!"_ZTS7Texture", !18, i64 0, !18, i64 4, !18, i64 8, !18, i64 12, !11, i64 16, !11, i64 48}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTS6Skybox", !18, i64 0, !17, i64 8, !16, i64 88}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTS16DirectionalLight", !22, i64 0, !23, i64 100, !24, i64 112, !24, i64 176, !25, i64 240, !25, i64 244}
!22 = !{!"_ZTS9BaseLight", !23, i64 0, !24, i64 12, !20, i64 76, !25, i64 80, !25, i64 84, !25, i64 88, !18, i64 92, !18, i64 96}
!23 = !{!"_ZTSN3glm3vecILi3EfLNS_9qualifierE0EEE", !7, i64 0}
!24 = !{!"_ZTSN3glm3matILi4ELi4EfLNS_9qualifierE0EEE", !7, i64 0}
!25 = !{!"float", !7, i64 0}
!26 = !{!"_ZTSSt6vectorIP5ModelSaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIP5ModelSaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIP5ModelSaIS1_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIP5ModelSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{i8 0, i8 2}
!31 = !{}


; 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"

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN12SceneManager9loadSceneENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(40) %0, ptr noundef %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = tail call noalias noundef nonnull dereferenceable(792) ptr @_Znwm(i64 noundef 792) #4
  invoke void @_ZN5SceneC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(792) %3, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %4 unwind label %10

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %3, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %3, i64 436
  %7 = load i8, ptr %6, align 4, !tbaa !13, !range !29, !noundef !30
  %8 = trunc nuw i8 %7 to i1
  %9 = xor i1 %8, true
  ret i1 %9

10:                                               ; preds = %2
  %11 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %3, i64 noundef 792) #5
  resume { ptr, i32 } %11
}

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_ZN5SceneC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(792), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

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 = { 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 #2 = { 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 #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 = { builtin allocsize(0) }
attributes #5 = { 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, !9, i64 32}
!6 = !{!"_ZTS12SceneManager", !7, i64 0, !9, i64 32}
!7 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !8, i64 0, !12, i64 8, !10, i64 16}
!8 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"long", !10, i64 0}
!13 = !{!14, !19, i64 436}
!14 = !{!"_ZTS5Scene", !15, i64 0, !15, i64 88, !16, i64 176, !18, i64 256, !17, i64 432, !19, i64 436, !9, i64 440, !7, i64 448, !19, i64 480, !20, i64 484, !9, i64 736, !25, i64 744, !25, i64 768}
!15 = !{!"_ZTS7CubeMap", !16, i64 0, !17, i64 80}
!16 = !{!"_ZTS7Texture", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12, !7, i64 16, !7, i64 48}
!17 = !{!"int", !10, i64 0}
!18 = !{!"_ZTS6Skybox", !17, i64 0, !16, i64 8, !15, i64 88}
!19 = !{!"bool", !10, i64 0}
!20 = !{!"_ZTS16DirectionalLight", !21, i64 0, !22, i64 100, !23, i64 112, !23, i64 176, !24, i64 240, !24, i64 244}
!21 = !{!"_ZTS9BaseLight", !22, i64 0, !23, i64 12, !19, i64 76, !24, i64 80, !24, i64 84, !24, i64 88, !17, i64 92, !17, i64 96}
!22 = !{!"_ZTSN3glm3vecILi3EfLNS_9qualifierE0EEE", !10, i64 0}
!23 = !{!"_ZTSN3glm3matILi4ELi4EfLNS_9qualifierE0EEE", !10, i64 0}
!24 = !{!"float", !10, i64 0}
!25 = !{!"_ZTSSt6vectorIP5ModelSaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIP5ModelSaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIP5ModelSaIS1_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIP5ModelSaIS1_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!29 = !{i8 0, i8 2}
!30 = !{}


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