; LLVM IR from nikitakaraevv/ray-tracing-engine :: source/Main.ll (ZN8Renderer17calculateColorRayE3RayRbR6kdtree)

; 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.Vec3 = type { [3 x float] }
%class.Vec3.25 = type { [3 x i32] }
%class.Renderer = type <{ ptr, i32, i32, i32, i32, %class.PhotonMap, %class.PhotonMap, %class.RayTracer, %class.Scene, float, [4 x i8] }>
%class.PhotonMap = type <{ %class.RayTracer, %"class.std::vector", i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Particle, std::allocator<Particle>>::_Vector_impl" }
%"struct.std::_Vector_base<Particle, std::allocator<Particle>>::_Vector_impl" = type { %"struct.std::_Vector_base<Particle, std::allocator<Particle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Particle, std::allocator<Particle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.RayTracer = type { ptr }
%class.Scene = type { ptr, %class.Camera, %"class.std::vector.0", %"class.std::vector.5" }
%class.Camera = type { float, float, %class.Vec3, %class.Vec3, %class.Vec3, %class.Vec3 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<LightSource, std::allocator<LightSource>>::_Vector_impl" }
%"struct.std::_Vector_base<LightSource, std::allocator<LightSource>>::_Vector_impl" = type { %"struct.std::_Vector_base<LightSource, std::allocator<LightSource>>::_Vector_impl_data" }
%"struct.std::_Vector_base<LightSource, std::allocator<LightSource>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<Mesh, std::allocator<Mesh>>::_Vector_impl" }
%"struct.std::_Vector_base<Mesh, std::allocator<Mesh>>::_Vector_impl" = type { %"struct.std::_Vector_base<Mesh, std::allocator<Mesh>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Mesh, std::allocator<Mesh>>::_Vector_impl_data" = type { ptr, 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: mustprogress nounwind uwtable
declare dso_local void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4Vec3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9RayTracer8rayTraceERK3RayRK5SceneRmR4Vec3IiERfSA_SA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Renderer5shadeERK3RayR4Vec3IiERmRfS7_S7_RS3_IfES9_S9_R6kdtree(ptr noundef nonnull align 8 dereferenceable(228), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(80)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4Vec3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4Vec3IiEC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Renderer17calculateColorRayE3RayRbR6kdtree(ptr dead_on_unwind noalias writable sret(%class.Vec3) align 4 %0, ptr noundef nonnull align 8 dereferenceable(228) %1, ptr noundef %2, ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull align 8 dereferenceable(80) %4) #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca %class.Vec3.25, align 4
  %13 = alloca i1, align 1
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %class.Vec3, align 4
  %17 = alloca %class.Vec3, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca i8, align 1
  %22 = alloca i32, align 4
  store ptr %0, ptr %6, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %23 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #5
  call void @_ZN4Vec3IiEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %12)
  store i1 false, ptr %13, align 1
  invoke void @_ZN4Vec3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %0, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
          to label %24 unwind label %39

24:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #5
  invoke void @_ZN4Vec3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %16)
          to label %25 unwind label %43

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #5
  invoke void @_ZN4Vec3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %26 unwind label %47

26:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #5
  %27 = getelementptr inbounds %class.Renderer, ptr %23, i32 0, i32 7
  %28 = getelementptr inbounds %class.Renderer, ptr %23, i32 0, i32 8
  %29 = invoke noundef zeroext i1 @_ZN9RayTracer8rayTraceERK3RayRK5SceneRmR4Vec3IiERfSA_SA_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 4 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(112) %28, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %30 unwind label %51

30:                                               ; preds = %26
  %31 = zext i1 %29 to i8
  store i8 %31, ptr %21, align 1, !tbaa !9
  %32 = load i8, ptr %21, align 1, !tbaa !9, !range !11, !noundef !12
  %33 = trunc i8 %32 to i1
  br i1 %33, label %34, label %37

34:                                               ; preds = %30
  %35 = load float, ptr %20, align 4, !tbaa !13
  %36 = fcmp ogt float %35, 0.000000e+00
  br i1 %36, label %55, label %37

37:                                               ; preds = %34, %30
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  store i8 0, ptr %38, align 1, !tbaa !9
  store i1 true, ptr %13, align 1
  store i32 1, ptr %22, align 4
  br label %58

39:                                               ; preds = %5
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %14, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %15, align 4
  br label %64

43:                                               ; preds = %24
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %14, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %15, align 4
  br label %61

47:                                               ; preds = %25
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %14, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %15, align 4
  br label %60

51:                                               ; preds = %55, %26
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %14, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %17) #5
  br label %60

55:                                               ; preds = %34
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN8Renderer5shadeERK3RayR4Vec3IiERmRfS7_S7_RS3_IfES9_S9_R6kdtree(ptr noundef nonnull align 8 dereferenceable(228) %23, ptr noundef nonnull align 4 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 8 dereferenceable(80) %56)
          to label %57 unwind label %51

57:                                               ; preds = %55
  store i1 true, ptr %13, align 1
  store i32 1, ptr %22, align 4
  br label %58

58:                                               ; preds = %57, %37
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %17) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #5
  call void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %16) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #5
  %59 = load i1, ptr %13, align 1
  br i1 %59, label %63, label %62

60:                                               ; preds = %51, %47
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #5
  call void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %16) #5
  br label %61

61:                                               ; preds = %60, %43
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #5
  call void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #5
  br label %64

62:                                               ; preds = %58
  call void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #5
  br label %63

63:                                               ; preds = %62, %58
  call void @_ZN4Vec3IiED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  ret void

64:                                               ; preds = %61, %39
  call void @_ZN4Vec3IiED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %65

65:                                               ; preds = %64
  %66 = load ptr, ptr %14, align 8
  %67 = load i32, ptr %15, align 4
  %68 = insertvalue { ptr, i32 } poison, ptr %66, 0
  %69 = insertvalue { ptr, i32 } %68, i32 %67, 1
  resume { ptr, i32 } %69
}

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 = { 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 #3 = { inlinehint 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 #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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"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.Vec3 = type { [3 x float] }
%class.Vec3.25 = type { [3 x i32] }

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 nounwind uwtable
declare dso_local void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4Vec3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9RayTracer8rayTraceERK3RayRK5SceneRmR4Vec3IiERfSA_SA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Renderer5shadeERK3RayR4Vec3IiERmRfS7_S7_RS3_IfES9_S9_R6kdtree(ptr noundef nonnull align 8 dereferenceable(228), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4Vec3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4Vec3IiEC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Renderer17calculateColorRayE3RayRbR6kdtree(ptr dead_on_unwind noalias writable sret(%class.Vec3) align 4 %0, ptr noundef nonnull align 8 dereferenceable(228) %1, ptr noundef %2, ptr nocapture noundef nonnull writeonly align 1 dereferenceable(1) %3, ptr noundef nonnull align 8 dereferenceable(80) %4) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i64, align 8
  %7 = alloca %class.Vec3.25, align 4
  %8 = alloca %class.Vec3, align 4
  %9 = alloca %class.Vec3, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #5
  call void @_ZN4Vec3IiEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @_ZN4Vec3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %0, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #5
  call void @_ZN4Vec3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #5
  call void @_ZN4Vec3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  %13 = getelementptr inbounds i8, ptr %1, i64 104
  %14 = getelementptr inbounds i8, ptr %1, i64 112
  %15 = invoke noundef zeroext i1 @_ZN9RayTracer8rayTraceERK3RayRK5SceneRmR4Vec3IiERfSA_SA_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(112) %14, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %16 unwind label %20

16:                                               ; preds = %5
  %17 = load float, ptr %12, align 4
  %18 = fcmp ogt float %17, 0.000000e+00
  %or.cond = select i1 %15, i1 %18, i1 false
  br i1 %or.cond, label %22, label %19

19:                                               ; preds = %16
  store i8 0, ptr %3, align 1, !tbaa !5
  br label %23

20:                                               ; preds = %22, %5
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  call void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #5
  call void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #5
  call void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #5
  call void @_ZN4Vec3IiED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  resume { ptr, i32 } %21

22:                                               ; preds = %16
  invoke void @_ZN8Renderer5shadeERK3RayR4Vec3IiERmRfS7_S7_RS3_IfES9_S9_R6kdtree(ptr noundef nonnull align 8 dereferenceable(228) %1, ptr noundef nonnull align 4 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %23 unwind label %20

23:                                               ; preds = %22, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  call void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #5
  call void @_ZN4Vec3IfED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #5
  call void @_ZN4Vec3IiED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  ret void
}

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 = { 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 #3 = { inlinehint 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 #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 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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