; LLVM IR from Lut1n/ImpGears :: src/ImpGears/Renderer (SceneRenderer)

; 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.imp::Matrix4" = type { %"class.imp::Matrix" }
%"class.imp::Matrix" = type { %"class.imp::Object", [16 x float] }
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr" }
%"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.imp::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.imp::Vec.9" = type <{ %"class.imp::Object", [3 x float], [4 x i8] }>
%"class.imp::LightNode" = type <{ %"class.imp::Node", %"class.imp::Vec3", %"class.imp::Vec3", float, [4 x i8] }>
%"class.imp::Node" = type { %"class.imp::Object", %"class.std::shared_ptr.6", %"class.imp::Vec3", %"class.imp::Vec3", %"class.imp::Vec3", %"class.imp::Matrix4", %"class.imp::Matrix4", %"class.imp::Matrix4", %"class.imp::Matrix4", i8, %"class.std::__cxx11::list" }
%"class.std::shared_ptr.6" = type { %"class.std::__shared_ptr.7" }
%"class.std::__shared_ptr.7" = type { ptr, %"class.std::__shared_count" }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<std::shared_ptr<imp::Node>, std::allocator<std::shared_ptr<imp::Node>>>::_List_impl" }
%"struct.std::__cxx11::_List_base<std::shared_ptr<imp::Node>, std::allocator<std::shared_ptr<imp::Node>>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

; 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 noundef ptr @_ZN3imp13SceneRenderer7closestEPNS_4NodeERKSt6vectorIPNS_9LightNodeESaIS5_EE(ptr noundef nonnull align 8 dereferenceable(137) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.imp::Matrix4", align 8
  %8 = alloca %"class.imp::Vec3", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca float, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca ptr, align 8
  %17 = alloca float, align 4
  %18 = alloca %"class.imp::Vec.9", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 88, ptr %7) #5
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNK3imp4Node14getModelMatrixEv(ptr noundef nonnull align 8 dereferenceable(544) %20)
  call void @_ZN3imp7Matrix4C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(88) %7, ptr noundef nonnull align 8 dereferenceable(88) %21) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #5
  %22 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp6MatrixILi4ELi4EfEclEii(ptr noundef nonnull align 8 dereferenceable(88) %7, i32 noundef 3, i32 noundef 0)
          to label %23 unwind label %42

23:                                               ; preds = %3
  %24 = load float, ptr %22, align 4, !tbaa !9
  %25 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp6MatrixILi4ELi4EfEclEii(ptr noundef nonnull align 8 dereferenceable(88) %7, i32 noundef 3, i32 noundef 1)
          to label %26 unwind label %42

26:                                               ; preds = %23
  %27 = load float, ptr %25, align 4, !tbaa !9
  %28 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp6MatrixILi4ELi4EfEclEii(ptr noundef nonnull align 8 dereferenceable(88) %7, i32 noundef 3, i32 noundef 2)
          to label %29 unwind label %42

29:                                               ; preds = %26
  %30 = load float, ptr %28, align 4, !tbaa !9
  invoke void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36) %8, float noundef %24, float noundef %27, float noundef %30)
          to label %31 unwind label %42

31:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store float -1.000000e+00, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %32, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = call ptr @_ZNKSt6vectorIPN3imp9LightNodeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #5
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = call ptr @_ZNKSt6vectorIPN3imp9LightNodeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #5
  %38 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %37, ptr %38, align 8
  br label %39

39:                                               ; preds = %73, %31
  %40 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN3imp9LightNodeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  br i1 %40, label %46, label %41

41:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %75

42:                                               ; preds = %29, %26, %23, %3
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %9, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %10, align 4
  br label %77

46:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKPN3imp9LightNodeESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %48 = load ptr, ptr %47, align 8, !tbaa !5
  store ptr %48, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %18) #5
  %49 = load ptr, ptr %16, align 8, !tbaa !5
  %50 = getelementptr inbounds %"class.imp::LightNode", ptr %49, i32 0, i32 1
  invoke void @_ZNK3imp3VecILi3EfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.imp::Vec.9") align 8 %18, ptr noundef nonnull align 8 dereferenceable(36) %50, ptr noundef nonnull align 8 dereferenceable(36) %8)
          to label %51 unwind label %63

51:                                               ; preds = %46
  %52 = invoke noundef float @_ZNK3imp3VecILi3EfE7length2Ev(ptr noundef nonnull align 8 dereferenceable(36) %18)
          to label %53 unwind label %67

53:                                               ; preds = %51
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %18) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #5
  store float %52, ptr %17, align 4, !tbaa !9
  %54 = load float, ptr %12, align 4, !tbaa !9
  %55 = fcmp oeq float %54, -1.000000e+00
  br i1 %55, label %60, label %56

56:                                               ; preds = %53
  %57 = load float, ptr %17, align 4, !tbaa !9
  %58 = load float, ptr %12, align 4, !tbaa !9
  %59 = fcmp olt float %57, %58
  br i1 %59, label %60, label %72

60:                                               ; preds = %56, %53
  %61 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %61, ptr %11, align 8, !tbaa !5
  %62 = load float, ptr %17, align 4, !tbaa !9
  store float %62, ptr %12, align 4, !tbaa !9
  br label %72

63:                                               ; preds = %46
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %9, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %10, align 4
  br label %71

67:                                               ; preds = %51
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %9, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %10, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %18) #5
  br label %71

71:                                               ; preds = %67, %63
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #5
  br label %77

72:                                               ; preds = %60, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %73

73:                                               ; preds = %72
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKPN3imp9LightNodeESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br label %39

75:                                               ; preds = %41
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #5
  call void @_ZN3imp7Matrix4D1Ev(ptr noundef nonnull align 8 dereferenceable(88) %7) #5
  call void @llvm.lifetime.end.p0(i64 88, ptr %7) #5
  ret ptr %76

77:                                               ; preds = %71, %42
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #5
  call void @_ZN3imp7Matrix4D1Ev(ptr noundef nonnull align 8 dereferenceable(88) %7) #5
  call void @llvm.lifetime.end.p0(i64 88, ptr %7) #5
  br label %78

78:                                               ; preds = %77
  %79 = load ptr, ptr %9, align 8
  %80 = load i32, ptr %10, align 4
  %81 = insertvalue { ptr, i32 } poison, ptr %79, 0
  %82 = insertvalue { ptr, i32 } %81, i32 %80, 1
  resume { ptr, i32 } %82
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36), float noundef, float noundef, float noundef) unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp3VecILi3EfEmiERKS1_(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec.9") align 8, ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK3imp3VecILi3EfE7length2Ev(ptr noundef nonnull align 8 dereferenceable(36)) #1 align 2

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

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

; Function Attrs: nounwind
declare void @_ZN3imp7Matrix4D1Ev(ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #4

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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}


; 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.imp::Matrix4" = type { %"class.imp::Matrix" }
%"class.imp::Matrix" = type { %"class.imp::Object", [16 x float] }
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr" }
%"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.imp::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.imp::Vec.9" = type <{ %"class.imp::Object", [3 x float], [4 x i8] }>

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress 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 noundef ptr @_ZN3imp13SceneRenderer7closestEPNS_4NodeERKSt6vectorIPNS_9LightNodeESaIS5_EE(ptr nocapture noundef nonnull readnone align 8 dereferenceable(137) %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.imp::Matrix4", align 8
  %5 = alloca %"class.imp::Vec3", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.imp::Vec.9", align 8
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %4) #5
  %9 = tail call noundef nonnull align 8 dereferenceable(88) ptr @_ZNK3imp4Node14getModelMatrixEv(ptr noundef nonnull align 8 dereferenceable(544) %1)
  call void @_ZN3imp7Matrix4C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(88) %4, ptr noundef nonnull align 8 dereferenceable(88) %9) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #5
  %10 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp6MatrixILi4ELi4EfEclEii(ptr noundef nonnull align 8 dereferenceable(88) %4, i32 noundef 3, i32 noundef 0)
          to label %11 unwind label %23

11:                                               ; preds = %3
  %12 = load float, ptr %10, align 4, !tbaa !5
  %13 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp6MatrixILi4ELi4EfEclEii(ptr noundef nonnull align 8 dereferenceable(88) %4, i32 noundef 3, i32 noundef 1)
          to label %14 unwind label %23

14:                                               ; preds = %11
  %15 = load float, ptr %13, align 4, !tbaa !5
  %16 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp6MatrixILi4ELi4EfEclEii(ptr noundef nonnull align 8 dereferenceable(88) %4, i32 noundef 3, i32 noundef 2)
          to label %17 unwind label %23

17:                                               ; preds = %14
  %18 = load float, ptr %16, align 4, !tbaa !5
  invoke void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36) %5, float noundef %12, float noundef %15, float noundef %18)
          to label %19 unwind label %23

19:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %20 = call ptr @_ZNKSt6vectorIPN3imp9LightNodeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  store ptr %20, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %21 = call ptr @_ZNKSt6vectorIPN3imp9LightNodeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  store ptr %21, ptr %7, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN3imp9LightNodeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br i1 %22, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %30, %19
  %.015.lcssa = phi ptr [ null, %19 ], [ %.116, %30 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %5) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #5
  call void @_ZN3imp7Matrix4D1Ev(ptr noundef nonnull align 8 dereferenceable(88) %4) #5
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %4) #5
  ret ptr %.015.lcssa

23:                                               ; preds = %17, %14, %11, %3
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %40

.lr.ph:                                           ; preds = %19, %30
  %.01524 = phi ptr [ %.116, %30 ], [ null, %19 ]
  %.01723 = phi float [ %.118, %30 ], [ -1.000000e+00, %19 ]
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKPN3imp9LightNodeESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #5
  %27 = getelementptr inbounds i8, ptr %26, i64 544
  invoke void @_ZNK3imp3VecILi3EfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.imp::Vec.9") align 8 %8, ptr noundef nonnull align 8 dereferenceable(36) %27, ptr noundef nonnull align 8 dereferenceable(36) %5)
          to label %28 unwind label %35

28:                                               ; preds = %.lr.ph
  %29 = invoke noundef float @_ZNK3imp3VecILi3EfE7length2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8)
          to label %30 unwind label %37

30:                                               ; preds = %28
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #5
  %31 = fcmp oeq float %.01723, -1.000000e+00
  %32 = fcmp olt float %29, %.01723
  %or.cond = or i1 %31, %32
  %.118 = select i1 %or.cond, float %29, float %.01723
  %.116 = select i1 %or.cond, ptr %26, ptr %.01524
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKPN3imp9LightNodeESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %34 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKPN3imp9LightNodeESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br i1 %34, label %.lr.ph, label %._crit_edge

35:                                               ; preds = %.lr.ph
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %39

37:                                               ; preds = %28
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #5
  br label %39

39:                                               ; preds = %37, %35
  %.pn = phi { ptr, i32 } [ %38, %37 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %5) #5
  br label %40

40:                                               ; preds = %39, %23
  %.pn.pn = phi { ptr, i32 } [ %.pn, %39 ], [ %24, %23 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #5
  call void @_ZN3imp7Matrix4D1Ev(ptr noundef nonnull align 8 dereferenceable(88) %4) #5
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36), float noundef, float noundef, float noundef) unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3imp3VecILi3EfEmiERKS1_(ptr dead_on_unwind noalias writable sret(%"class.imp::Vec.9") align 8, ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK3imp3VecILi3EfE7length2Ev(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: nounwind
declare void @_ZN3imp7Matrix4D1Ev(ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #4

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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


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