; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Graphics/R3SpotLight.ll (ZNK11R3SpotLight4DrawEi)

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

@RN_PI = external constant double, align 8

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3SpotLight9DirectionEv(ptr noundef nonnull align 8 dereferenceable(168)) #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: mustprogress uwtable
define dso_local void @_ZNK11R3SpotLight4DrawEi(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef %1) unnamed_addr #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca [4 x float], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %8 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %9 = load i32, ptr %4, align 4, !tbaa !9
  %10 = add nsw i32 16384, %9
  store i32 %10, ptr %5, align 4, !tbaa !9
  %11 = load i32, ptr %5, align 4, !tbaa !9
  %12 = icmp ugt i32 %11, 16391
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  store i32 1, ptr %6, align 4
  br label %101

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #4
  %15 = call noundef double @_ZNK7R3Light9IntensityEv(ptr noundef nonnull align 8 dereferenceable(76) %8)
  %16 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Light5ColorEv(ptr noundef nonnull align 8 dereferenceable(76) %8)
  %17 = call noundef double @_ZNK5RNRgb1REv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %18 = fmul double %15, %17
  %19 = fptrunc double %18 to float
  %20 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  store float %19, ptr %20, align 16, !tbaa !11
  %21 = call noundef double @_ZNK7R3Light9IntensityEv(ptr noundef nonnull align 8 dereferenceable(76) %8)
  %22 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Light5ColorEv(ptr noundef nonnull align 8 dereferenceable(76) %8)
  %23 = call noundef double @_ZNK5RNRgb1GEv(ptr noundef nonnull align 8 dereferenceable(24) %22)
  %24 = fmul double %21, %23
  %25 = fptrunc double %24 to float
  %26 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 1
  store float %25, ptr %26, align 4, !tbaa !11
  %27 = call noundef double @_ZNK7R3Light9IntensityEv(ptr noundef nonnull align 8 dereferenceable(76) %8)
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Light5ColorEv(ptr noundef nonnull align 8 dereferenceable(76) %8)
  %29 = call noundef double @_ZNK5RNRgb1BEv(ptr noundef nonnull align 8 dereferenceable(24) %28)
  %30 = fmul double %27, %29
  %31 = fptrunc double %30 to float
  %32 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 2
  store float %31, ptr %32, align 8, !tbaa !11
  %33 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 3
  store float 1.000000e+00, ptr %33, align 4, !tbaa !11
  %34 = load i32, ptr %5, align 4, !tbaa !9
  %35 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  call void @glLightfv(i32 noundef %34, i32 noundef 4609, ptr noundef %35)
  %36 = load i32, ptr %5, align 4, !tbaa !9
  %37 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  call void @glLightfv(i32 noundef %36, i32 noundef 4610, ptr noundef %37)
  %38 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK12R3PointLight8PositionEv(ptr noundef nonnull align 8 dereferenceable(128) %8)
  %39 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %38)
  %40 = fptrunc double %39 to float
  %41 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  store float %40, ptr %41, align 16, !tbaa !11
  %42 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK12R3PointLight8PositionEv(ptr noundef nonnull align 8 dereferenceable(128) %8)
  %43 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %42)
  %44 = fptrunc double %43 to float
  %45 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 1
  store float %44, ptr %45, align 4, !tbaa !11
  %46 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK12R3PointLight8PositionEv(ptr noundef nonnull align 8 dereferenceable(128) %8)
  %47 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %46)
  %48 = fptrunc double %47 to float
  %49 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 2
  store float %48, ptr %49, align 8, !tbaa !11
  %50 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 3
  store float 1.000000e+00, ptr %50, align 4, !tbaa !11
  %51 = load i32, ptr %5, align 4, !tbaa !9
  %52 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  call void @glLightfv(i32 noundef %51, i32 noundef 4611, ptr noundef %52)
  %53 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3SpotLight9DirectionEv(ptr noundef nonnull align 8 dereferenceable(168) %8)
  %54 = call noundef double @_ZNK8R3Vector1XEv(ptr noundef nonnull align 8 dereferenceable(24) %53)
  %55 = fptrunc double %54 to float
  %56 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  store float %55, ptr %56, align 16, !tbaa !11
  %57 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3SpotLight9DirectionEv(ptr noundef nonnull align 8 dereferenceable(168) %8)
  %58 = call noundef double @_ZNK8R3Vector1YEv(ptr noundef nonnull align 8 dereferenceable(24) %57)
  %59 = fptrunc double %58 to float
  %60 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 1
  store float %59, ptr %60, align 4, !tbaa !11
  %61 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3SpotLight9DirectionEv(ptr noundef nonnull align 8 dereferenceable(168) %8)
  %62 = call noundef double @_ZNK8R3Vector1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %61)
  %63 = fptrunc double %62 to float
  %64 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 2
  store float %63, ptr %64, align 8, !tbaa !11
  %65 = load i32, ptr %5, align 4, !tbaa !9
  %66 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  call void @glLightfv(i32 noundef %65, i32 noundef 4612, ptr noundef %66)
  %67 = call noundef double @_ZNK11R3SpotLight11DropOffRateEv(ptr noundef nonnull align 8 dereferenceable(168) %8)
  %68 = fptrunc double %67 to float
  %69 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  store float %68, ptr %69, align 16, !tbaa !11
  %70 = load i32, ptr %5, align 4, !tbaa !9
  %71 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  %72 = load float, ptr %71, align 16, !tbaa !11
  call void @glLightf(i32 noundef %70, i32 noundef 4613, float noundef %72)
  %73 = call noundef double @_ZNK11R3SpotLight11CutOffAngleEv(ptr noundef nonnull align 8 dereferenceable(168) %8)
  %74 = load double, ptr @RN_PI, align 8, !tbaa !13
  %75 = fdiv double 1.800000e+02, %74
  %76 = fmul double %73, %75
  %77 = fptrunc double %76 to float
  %78 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  store float %77, ptr %78, align 16, !tbaa !11
  %79 = load i32, ptr %5, align 4, !tbaa !9
  %80 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  %81 = load float, ptr %80, align 16, !tbaa !11
  call void @glLightf(i32 noundef %79, i32 noundef 4614, float noundef %81)
  %82 = call noundef double @_ZNK12R3PointLight19ConstantAttenuationEv(ptr noundef nonnull align 8 dereferenceable(128) %8)
  %83 = fptrunc double %82 to float
  %84 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  store float %83, ptr %84, align 16, !tbaa !11
  %85 = call noundef double @_ZNK12R3PointLight17LinearAttenuationEv(ptr noundef nonnull align 8 dereferenceable(128) %8)
  %86 = fptrunc double %85 to float
  %87 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 1
  store float %86, ptr %87, align 4, !tbaa !11
  %88 = call noundef double @_ZNK12R3PointLight20QuadraticAttenuationEv(ptr noundef nonnull align 8 dereferenceable(128) %8)
  %89 = fptrunc double %88 to float
  %90 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 2
  store float %89, ptr %90, align 8, !tbaa !11
  %91 = load i32, ptr %5, align 4, !tbaa !9
  %92 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 0
  %93 = load float, ptr %92, align 16, !tbaa !11
  call void @glLightf(i32 noundef %91, i32 noundef 4615, float noundef %93)
  %94 = load i32, ptr %5, align 4, !tbaa !9
  %95 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 1
  %96 = load float, ptr %95, align 4, !tbaa !11
  call void @glLightf(i32 noundef %94, i32 noundef 4616, float noundef %96)
  %97 = load i32, ptr %5, align 4, !tbaa !9
  %98 = getelementptr inbounds [4 x float], ptr %7, i64 0, i64 2
  %99 = load float, ptr %98, align 8, !tbaa !11
  call void @glLightf(i32 noundef %97, i32 noundef 4617, float noundef %99)
  %100 = load i32, ptr %5, align 4, !tbaa !9
  call void @glEnable(i32 noundef %100)
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #4
  store i32 0, ptr %6, align 4
  br label %101

101:                                              ; preds = %14, %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  %102 = load i32, ptr %6, align 4
  switch i32 %102, label %104 [
    i32 0, label %103
    i32 1, label %103
  ]

103:                                              ; preds = %101, %101
  ret void

104:                                              ; preds = %101
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Light9IntensityEv(ptr noundef nonnull align 8 dereferenceable(76)) #1 align 2

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

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

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

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

declare void @glLightfv(i32 noundef, i32 noundef, ptr noundef) #3

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK11R3SpotLight11DropOffRateEv(ptr noundef nonnull align 8 dereferenceable(168)) #1 align 2

declare void @glLightf(i32 noundef, i32 noundef, float noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK11R3SpotLight11CutOffAngleEv(ptr noundef nonnull align 8 dereferenceable(168)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK12R3PointLight19ConstantAttenuationEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK12R3PointLight17LinearAttenuationEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK12R3PointLight20QuadraticAttenuationEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

declare void @glEnable(i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !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"

@RN_PI = external local_unnamed_addr constant double, align 8

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3SpotLight9DirectionEv(ptr noundef nonnull align 8 dereferenceable(168)) local_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: mustprogress uwtable
define dso_local void @_ZNK11R3SpotLight4DrawEi(ptr noundef nonnull align 8 dereferenceable(168) %0, i32 noundef %1) unnamed_addr #2 align 2 {
  %3 = alloca [4 x float], align 16
  %4 = add nsw i32 %1, 16384
  %5 = icmp ugt i32 %4, 16391
  br i1 %5, label %61, label %6

6:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  %7 = tail call noundef double @_ZNK7R3Light9IntensityEv(ptr noundef nonnull align 8 dereferenceable(76) %0)
  %8 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Light5ColorEv(ptr noundef nonnull align 8 dereferenceable(76) %0)
  %9 = tail call noundef double @_ZNK5RNRgb1REv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %10 = tail call noundef double @_ZNK7R3Light9IntensityEv(ptr noundef nonnull align 8 dereferenceable(76) %0)
  %11 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Light5ColorEv(ptr noundef nonnull align 8 dereferenceable(76) %0)
  %12 = tail call noundef double @_ZNK5RNRgb1GEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %13 = getelementptr inbounds i8, ptr %3, i64 4
  %14 = insertelement <2 x double> poison, double %7, i64 0
  %15 = insertelement <2 x double> %14, double %10, i64 1
  %16 = insertelement <2 x double> poison, double %9, i64 0
  %17 = insertelement <2 x double> %16, double %12, i64 1
  %18 = fmul <2 x double> %15, %17
  %19 = fptrunc <2 x double> %18 to <2 x float>
  store <2 x float> %19, ptr %3, align 16, !tbaa !5
  %20 = tail call noundef double @_ZNK7R3Light9IntensityEv(ptr noundef nonnull align 8 dereferenceable(76) %0)
  %21 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Light5ColorEv(ptr noundef nonnull align 8 dereferenceable(76) %0)
  %22 = tail call noundef double @_ZNK5RNRgb1BEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  %23 = fmul double %20, %22
  %24 = fptrunc double %23 to float
  %25 = getelementptr inbounds i8, ptr %3, i64 8
  store float %24, ptr %25, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %3, i64 12
  store float 1.000000e+00, ptr %26, align 4, !tbaa !5
  call void @glLightfv(i32 noundef %4, i32 noundef 4609, ptr noundef nonnull %3)
  call void @glLightfv(i32 noundef %4, i32 noundef 4610, ptr noundef nonnull %3)
  %27 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK12R3PointLight8PositionEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  %28 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  %29 = fptrunc double %28 to float
  store float %29, ptr %3, align 16, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK12R3PointLight8PositionEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  %31 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
  %32 = fptrunc double %31 to float
  store float %32, ptr %13, align 4, !tbaa !5
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK12R3PointLight8PositionEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  %34 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
  %35 = fptrunc double %34 to float
  store float %35, ptr %25, align 8, !tbaa !5
  store float 1.000000e+00, ptr %26, align 4, !tbaa !5
  call void @glLightfv(i32 noundef %4, i32 noundef 4611, ptr noundef nonnull %3)
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3SpotLight9DirectionEv(ptr noundef nonnull align 8 dereferenceable(168) %0)
  %37 = call noundef double @_ZNK8R3Vector1XEv(ptr noundef nonnull align 8 dereferenceable(24) %36)
  %38 = fptrunc double %37 to float
  store float %38, ptr %3, align 16, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3SpotLight9DirectionEv(ptr noundef nonnull align 8 dereferenceable(168) %0)
  %40 = call noundef double @_ZNK8R3Vector1YEv(ptr noundef nonnull align 8 dereferenceable(24) %39)
  %41 = fptrunc double %40 to float
  store float %41, ptr %13, align 4, !tbaa !5
  %42 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3SpotLight9DirectionEv(ptr noundef nonnull align 8 dereferenceable(168) %0)
  %43 = call noundef double @_ZNK8R3Vector1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %42)
  %44 = fptrunc double %43 to float
  store float %44, ptr %25, align 8, !tbaa !5
  call void @glLightfv(i32 noundef %4, i32 noundef 4612, ptr noundef nonnull %3)
  %45 = call noundef double @_ZNK11R3SpotLight11DropOffRateEv(ptr noundef nonnull align 8 dereferenceable(168) %0)
  %46 = fptrunc double %45 to float
  store float %46, ptr %3, align 16, !tbaa !5
  call void @glLightf(i32 noundef %4, i32 noundef 4613, float noundef %46)
  %47 = call noundef double @_ZNK11R3SpotLight11CutOffAngleEv(ptr noundef nonnull align 8 dereferenceable(168) %0)
  %48 = load double, ptr @RN_PI, align 8, !tbaa !9
  %49 = fdiv double 1.800000e+02, %48
  %50 = fmul double %47, %49
  %51 = fptrunc double %50 to float
  store float %51, ptr %3, align 16, !tbaa !5
  call void @glLightf(i32 noundef %4, i32 noundef 4614, float noundef %51)
  %52 = call noundef double @_ZNK12R3PointLight19ConstantAttenuationEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  %53 = fptrunc double %52 to float
  store float %53, ptr %3, align 16, !tbaa !5
  %54 = call noundef double @_ZNK12R3PointLight17LinearAttenuationEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  %55 = fptrunc double %54 to float
  store float %55, ptr %13, align 4, !tbaa !5
  %56 = call noundef double @_ZNK12R3PointLight20QuadraticAttenuationEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  %57 = fptrunc double %56 to float
  store float %57, ptr %25, align 8, !tbaa !5
  %58 = load float, ptr %3, align 16, !tbaa !5
  call void @glLightf(i32 noundef %4, i32 noundef 4615, float noundef %58)
  %59 = load float, ptr %13, align 4, !tbaa !5
  call void @glLightf(i32 noundef %4, i32 noundef 4616, float noundef %59)
  %60 = load float, ptr %25, align 8, !tbaa !5
  call void @glLightf(i32 noundef %4, i32 noundef 4617, float noundef %60)
  call void @glEnable(i32 noundef %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  br label %61

61:                                               ; preds = %2, %6
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Light9IntensityEv(ptr noundef nonnull align 8 dereferenceable(76)) local_unnamed_addr #1 align 2

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

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

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

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

declare void @glLightfv(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK11R3SpotLight11DropOffRateEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #1 align 2

declare void @glLightf(i32 noundef, i32 noundef, float noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK11R3SpotLight11CutOffAngleEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK12R3PointLight19ConstantAttenuationEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK12R3PointLight17LinearAttenuationEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK12R3PointLight20QuadraticAttenuationEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #1 align 2

declare void @glEnable(i32 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { 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 = !{!"double", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass