; LLVM IR from The-Order-of-the-Simulation/Path-Tracing-Renderer :: cpu/main.ll (Z8radianceRK4vec3S1_)

; 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 { float, float, float }
%class.intersection = type { float, float, i8, %class.vec3, %class.material }
%class.material = type { i8, %class.vec3, float, float }

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9normalizeRK4vec3(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12)) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7reflectRK4vec3S1_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec3miERKS_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec3mlEf(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) #0 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12intersectionC2Ev(ptr noundef nonnull align 4 dereferenceable(48)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec3plERKS_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 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) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6nrand3f4vec3(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, float noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec3mlERKS_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8skyColorRK4vec3(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12)) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5traceRK4vec3S1_(ptr dead_on_unwind noalias writable sret(%class.intersection) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8radianceRK4vec3S1_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %class.vec3, align 4
  %8 = alloca %class.vec3, align 4
  %9 = alloca %class.vec3, align 4
  %10 = alloca %class.intersection, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %class.intersection, align 4
  %14 = alloca %class.vec3, align 4
  %15 = alloca %class.vec3, align 4
  %16 = alloca %class.vec3, align 4
  %17 = alloca %class.vec3, align 4
  %18 = alloca %class.vec3, align 4
  %19 = alloca %class.vec3, align 4
  %20 = alloca %class.vec3, align 4
  %21 = alloca %class.vec3, align 4
  %22 = alloca %class.vec3, align 4
  %23 = alloca %class.vec3, align 4
  %24 = alloca %class.vec3, align 4
  %25 = alloca %class.vec3, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN4vec3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %26)
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN4vec3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %27)
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #5
  call void @_ZN4vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 48, ptr %10) #5
  call void @_ZN12intersectionC2Ev(ptr noundef nonnull align 4 dereferenceable(48) %10)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %41, %3
  %29 = load i32, ptr %11, align 4, !tbaa !9
  %30 = icmp slt i32 %29, 16
  br i1 %30, label %32, label %31

31:                                               ; preds = %28
  store i32 2, ptr %12, align 4
  br label %44

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 48, ptr %13) #5
  call void @_Z5traceRK4vec3S1_(ptr dead_on_unwind writable sret(%class.intersection) align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %8)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %13, i64 48, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #5
  %33 = getelementptr inbounds %class.intersection, ptr %10, i32 0, i32 2
  %34 = load i8, ptr %33, align 4, !tbaa !16, !range !20, !noundef !21
  %35 = trunc i8 %34 to i1
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #5
  call void @_Z8skyColorRK4vec3(ptr dead_on_unwind writable sret(%class.vec3) align 4 %14, ptr noundef nonnull align 4 dereferenceable(12) %8)
  call void @_ZNK4vec3mlERKS_(ptr dead_on_unwind writable sret(%class.vec3) align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %9)
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  store i32 1, ptr %12, align 4
  br label %44

37:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #5
  %38 = getelementptr inbounds %class.intersection, ptr %10, i32 0, i32 0
  %39 = load float, ptr %38, align 4, !tbaa !22
  call void @_ZNK4vec3mlEf(ptr dead_on_unwind writable sret(%class.vec3) align 4 %17, ptr noundef nonnull align 4 dereferenceable(12) %8, float noundef %39)
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #5
  call void @_ZN4vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %18, float noundef 0x3F1A36E2E0000000)
  call void @_ZNK4vec3miERKS_(ptr dead_on_unwind writable sret(%class.vec3) align 4 %16, ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %18)
  call void @_ZNK4vec3plERKS_(ptr dead_on_unwind writable sret(%class.vec3) align 4 %15, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %16)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %15, i64 12, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #5
  call void @_ZN4vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %20, float noundef 0x3FE3333340000000, float noundef 0x3FE6666660000000, float noundef 0x3FE99999A0000000)
  call void @_ZNK4vec3mlERKS_(ptr dead_on_unwind writable sret(%class.vec3) align 4 %19, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %20)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %19, i64 12, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #5
  %40 = getelementptr inbounds %class.intersection, ptr %10, i32 0, i32 3
  call void @_ZN4vec3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %25, ptr noundef nonnull align 4 dereferenceable(12) %40)
  call void @_Z6nrand3f4vec3(ptr dead_on_unwind writable sret(%class.vec3) align 4 %24, float noundef 5.000000e-01, ptr noundef %25)
  call void @_Z9normalizeRK4vec3(ptr dead_on_unwind writable sret(%class.vec3) align 4 %23, ptr noundef nonnull align 4 dereferenceable(12) %24)
  call void @_Z7reflectRK4vec3S1_(ptr dead_on_unwind writable sret(%class.vec3) align 4 %22, ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %23)
  call void @_Z9normalizeRK4vec3(ptr dead_on_unwind writable sret(%class.vec3) align 4 %21, ptr noundef nonnull align 4 dereferenceable(12) %22)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %21, i64 12, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #5
  br label %41

41:                                               ; preds = %37
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %11, align 4, !tbaa !9
  br label %28, !llvm.loop !24

44:                                               ; preds = %36, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %45 = load i32, ptr %12, align 4
  switch i32 %45, label %47 [
    i32 2, label %46
  ]

46:                                               ; preds = %44
  call void @_ZN4vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %0, float noundef -1.000000e+00)
  store i32 1, ptr %12, align 4
  br label %47

47:                                               ; preds = %46, %44
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #5
  ret void
}

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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 4, !12, i64 4, i64 4, !12, i64 8, i64 1, !14, i64 12, i64 4, !12, i64 16, i64 4, !12, i64 20, i64 4, !12, i64 24, i64 1, !14, i64 28, i64 4, !12, i64 32, i64 4, !12, i64 36, i64 4, !12, i64 40, i64 4, !12, i64 44, i64 4, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!17, !15, i64 8}
!17 = !{!"_ZTS12intersection", !13, i64 0, !13, i64 4, !15, i64 8, !18, i64 12, !19, i64 24}
!18 = !{!"_ZTS4vec3", !13, i64 0, !13, i64 4, !13, i64 8}
!19 = !{!"_ZTS8material", !15, i64 0, !18, i64 4, !13, i64 16, !13, i64 20}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!17, !13, i64 0}
!23 = !{i64 0, i64 4, !12, i64 4, i64 4, !12, i64 8, i64 4, !12}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; 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 { float, float, float }
%class.intersection = type { float, float, i8, %class.vec3, %class.material }
%class.material = type { i8, %class.vec3, float, float }

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9normalizeRK4vec3(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7reflectRK4vec3S1_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec3miERKS_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec3mlEf(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12intersectionC2Ev(ptr noundef nonnull align 4 dereferenceable(48)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec3plERKS_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6nrand3f4vec3(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, float noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec3mlERKS_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8skyColorRK4vec3(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5traceRK4vec3S1_(ptr dead_on_unwind noalias writable sret(%class.intersection) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8radianceRK4vec3S1_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #0 {
  %4 = alloca %class.vec3, align 4
  %5 = alloca %class.vec3, align 4
  %6 = alloca %class.vec3, align 4
  %7 = alloca %class.intersection, align 4
  %8 = alloca %class.intersection, align 4
  %9 = alloca %class.vec3, align 4
  %10 = alloca %class.vec3, align 4
  %11 = alloca %class.vec3, align 4
  %12 = alloca %class.vec3, align 4
  %13 = alloca %class.vec3, align 4
  %14 = alloca %class.vec3, align 4
  %15 = alloca %class.vec3, align 4
  %16 = alloca %class.vec3, align 4
  %17 = alloca %class.vec3, align 4
  %18 = alloca %class.vec3, align 4
  %19 = alloca %class.vec3, align 4
  %20 = alloca %class.vec3, align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #5
  call void @_ZN4vec3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %1)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #5
  call void @_ZN4vec3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %2)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #5
  call void @_ZN4vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #5
  call void @_ZN12intersectionC2Ev(ptr noundef nonnull align 4 dereferenceable(48) %7)
  %21 = getelementptr inbounds i8, ptr %7, i64 8
  %22 = getelementptr inbounds i8, ptr %7, i64 12
  br label %23

23:                                               ; preds = %3, %27
  %.045 = phi i32 [ 0, %3 ], [ %29, %27 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %8) #5
  call void @_Z5traceRK4vec3S1_(ptr dead_on_unwind nonnull writable sret(%class.intersection) align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(48) %7, ptr noundef nonnull align 4 dereferenceable(48) %8, i64 48, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #5
  %24 = load i8, ptr %21, align 4, !tbaa !12, !range !16, !noundef !17
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #5
  call void @_Z8skyColorRK4vec3(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %9, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @_ZNK4vec3mlERKS_(ptr dead_on_unwind writable sret(%class.vec3) align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #5
  br label %30

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #5
  %28 = load float, ptr %7, align 4, !tbaa !18
  call void @_ZNK4vec3mlEf(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %5, float noundef %28)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #5
  call void @_ZN4vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %13, float noundef 0x3F1A36E2E0000000)
  call void @_ZNK4vec3miERKS_(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @_ZNK4vec3plERKS_(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %10, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %10, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #5
  call void @_ZN4vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %15, float noundef 0x3FE3333340000000, float noundef 0x3FE6666660000000, float noundef 0x3FE99999A0000000)
  call void @_ZNK4vec3mlERKS_(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %14, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %15)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %14, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %18) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %19) #5
  call void @_ZN4vec3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %20, ptr noundef nonnull align 4 dereferenceable(12) %22)
  call void @_Z6nrand3f4vec3(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %19, float noundef 5.000000e-01, ptr noundef nonnull %20)
  call void @_Z9normalizeRK4vec3(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %18, ptr noundef nonnull align 4 dereferenceable(12) %19)
  call void @_Z7reflectRK4vec3S1_(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %17, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %18)
  call void @_Z9normalizeRK4vec3(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %16, ptr noundef nonnull align 4 dereferenceable(12) %17)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %16, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #5
  %29 = add nuw nsw i32 %.045, 1
  %exitcond = icmp eq i32 %29, 16
  br i1 %exitcond, label %.critedge, label %23, !llvm.loop !20

.critedge:                                        ; preds = %27
  call void @_ZN4vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %0, float noundef -1.000000e+00)
  br label %30

30:                                               ; preds = %26, %.critedge
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #5
  ret void
}

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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 1, !10, i64 12, i64 4, !6, i64 16, i64 4, !6, i64 20, i64 4, !6, i64 24, i64 1, !10, i64 28, i64 4, !6, i64 32, i64 4, !6, i64 36, i64 4, !6, i64 40, i64 4, !6, i64 44, i64 4, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!13, !11, i64 8}
!13 = !{!"_ZTS12intersection", !7, i64 0, !7, i64 4, !11, i64 8, !14, i64 12, !15, i64 24}
!14 = !{!"_ZTS4vec3", !7, i64 0, !7, i64 4, !7, i64 8}
!15 = !{!"_ZTS8material", !11, i64 0, !14, i64 4, !7, i64 16, !7, i64 20}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!13, !7, i64 0}
!19 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,SROAPass,SimplifyCFGPass