; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Graphics (R3AreaLight)

; 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.R3Triad = type { [3 x %class.R3Vector] }
%class.R3Vector = type { [3 x double] }
%class.RNRgb = type { [3 x double] }
%class.R3Point = type { [3 x double] }
%class.R3AreaLight = type { %class.R3Light.base, %class.R3Circle, double, double, double }
%class.R3Light.base = type <{ ptr, ptr, i32, [4 x i8], ptr, i32, [4 x i8], double, %class.RNRgb, i32 }>
%class.R3Circle = type { %class.R3Surface, %class.R3Point, double, %class.R3Plane }
%class.R3Surface = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Plane = type { %class.R3Vector, double }

@R3xyz_triad = external global %class.R3Triad, align 8
@RN_EPSILON = external global double, align 8
@RNblack_rgb = external global %class.RNRgb, align 8

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK11R3AreaLight6RadiusEv(ptr noundef nonnull align 8 dereferenceable(176)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3AreaLight8PositionEv(ptr noundef nonnull align 8 dereferenceable(176)) #0 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK8R3Circle6NormalEv(ptr noundef nonnull align 8 dereferenceable(72)) #0 align 2

declare void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

declare noundef i32 @_ZNK8R3Vector12MinDimensionEv(ptr noundef nonnull align 8 dereferenceable(24)) #3

declare void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #0 align 2

declare void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3

declare noundef double @_Z14RNRandomScalarv() #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

declare void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmldRK8R3Vector(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) #0

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

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

declare void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

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

declare noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef, double noundef) #2

declare noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12RNIsPositivedd(double noundef, double noundef) #2

declare noundef double @_ZNK8R3Circle4AreaEv(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #3

declare void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmlRK5RNRgbS1_(ptr dead_on_unwind noalias writable sret(%class.RNRgb) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmldRK5RNRgb(ptr dead_on_unwind noalias writable sret(%class.RNRgb) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) #0

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN5RNRgbpLERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN5RNRgbdVEd(ptr noundef nonnull align 8 dereferenceable(24), double noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK11R3AreaLight18SpecularReflectionERK6R3BrdfRK7R3PointS5_RK8R3Vector(ptr dead_on_unwind noalias writable sret(%class.RNRgb) align 8 %0, ptr noundef nonnull align 8 dereferenceable(176) %1, ptr noundef nonnull align 8 dereferenceable(180) %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5) unnamed_addr #5 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca double, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %class.R3Vector, align 8
  %19 = alloca i32, align 4
  %20 = alloca %class.R3Vector, align 8
  %21 = alloca %class.R3Vector, align 8
  %22 = alloca i32, align 4
  %23 = alloca %class.RNRgb, align 8
  %24 = alloca i32, align 4
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca %class.R3Point, align 8
  %28 = alloca %class.R3Vector, align 8
  %29 = alloca %class.R3Vector, align 8
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca %class.R3Vector, align 8
  %34 = alloca double, align 8
  %35 = alloca %class.R3Vector, align 8
  %36 = alloca %class.R3Vector, align 8
  %37 = alloca %class.R3Vector, align 8
  %38 = alloca double, align 8
  %39 = alloca %class.RNRgb, align 8
  %40 = alloca %class.RNRgb, align 8
  %41 = alloca double, align 8
  %42 = alloca %class.RNRgb, align 8
  store ptr %0, ptr %7, align 8
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %43 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 8, ptr %13, align 4, !tbaa !9
  %44 = call noundef i32 @_ZNK7R3Light8IsActiveEv(ptr noundef nonnull align 8 dereferenceable(76) %43)
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %47, label %46

46:                                               ; preds = %6
  call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @RNblack_rgb)
  store i32 1, ptr %14, align 4
  br label %164

47:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Brdf8SpecularEv(ptr noundef nonnull align 8 dereferenceable(180) %48)
  store ptr %49, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = call noundef double @_ZNK6R3Brdf9ShininessEv(ptr noundef nonnull align 8 dereferenceable(180) %50)
  store double %51, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %52 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Light5ColorEv(ptr noundef nonnull align 8 dereferenceable(76) %43)
  store ptr %52, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #7
  %53 = getelementptr inbounds %class.R3AreaLight, ptr %43, i32 0, i32 1
  %54 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK8R3Circle6NormalEv(ptr noundef nonnull align 8 dereferenceable(72) %53)
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %54)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %55 = call noundef i32 @_ZNK8R3Vector12MinDimensionEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  store i32 %55, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #7
  %56 = load i32, ptr %19, align 4, !tbaa !9
  %57 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) @R3xyz_triad, i32 noundef %56)
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %20, ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %57)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #7
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %21, ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #7
  call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) @RNblack_rgb)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %147, %47
  %59 = load i32, ptr %24, align 4, !tbaa !9
  %60 = icmp slt i32 %59, 8
  br i1 %60, label %62, label %61

61:                                               ; preds = %58
  store i32 2, ptr %14, align 4
  br label %150

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %63 = call noundef double @_Z14RNRandomScalarv()
  %64 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %63, double -1.000000e+00)
  store double %64, ptr %25, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %65 = call noundef double @_Z14RNRandomScalarv()
  %66 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %65, double -1.000000e+00)
  store double %66, ptr %26, align 8, !tbaa !11
  %67 = load double, ptr %25, align 8, !tbaa !11
  %68 = load double, ptr %25, align 8, !tbaa !11
  %69 = load double, ptr %26, align 8, !tbaa !11
  %70 = load double, ptr %26, align 8, !tbaa !11
  %71 = fmul double %69, %70
  %72 = call double @llvm.fmuladd.f64(double %67, double %68, double %71)
  %73 = fcmp ogt double %72, 1.000000e+00
  br i1 %73, label %74, label %75

74:                                               ; preds = %62
  store i32 4, ptr %14, align 4
  br label %144

75:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #7
  %76 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3AreaLight8PositionEv(ptr noundef nonnull align 8 dereferenceable(176) %43)
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %76)
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #7
  %77 = load double, ptr %25, align 8, !tbaa !11
  %78 = call noundef double @_ZNK11R3AreaLight6RadiusEv(ptr noundef nonnull align 8 dereferenceable(176) %43)
  %79 = fmul double %77, %78
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %28, double noundef %79, ptr noundef nonnull align 8 dereferenceable(24) %20)
  %80 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %28)
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #7
  %81 = load double, ptr %26, align 8, !tbaa !11
  %82 = call noundef double @_ZNK11R3AreaLight6RadiusEv(ptr noundef nonnull align 8 dereferenceable(176) %43)
  %83 = fmul double %81, %82
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %29, double noundef %83, ptr noundef nonnull align 8 dereferenceable(24) %21)
  %84 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %29)
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #7
  %85 = load i32, ptr %22, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %87 = call noundef double @_ZNK7R3Light9IntensityEv(ptr noundef nonnull align 8 dereferenceable(76) %43)
  store double %87, ptr %30, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = call noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %88, ptr noundef nonnull align 8 dereferenceable(24) %27)
  store double %89, ptr %31, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %90 = getelementptr inbounds %class.R3AreaLight, ptr %43, i32 0, i32 2
  %91 = load double, ptr %90, align 8, !tbaa !13
  store double %91, ptr %32, align 8, !tbaa !11
  %92 = load double, ptr %31, align 8, !tbaa !11
  %93 = getelementptr inbounds %class.R3AreaLight, ptr %43, i32 0, i32 3
  %94 = load double, ptr %93, align 8, !tbaa !23
  %95 = load double, ptr %32, align 8, !tbaa !11
  %96 = call double @llvm.fmuladd.f64(double %92, double %94, double %95)
  store double %96, ptr %32, align 8, !tbaa !11
  %97 = load double, ptr %31, align 8, !tbaa !11
  %98 = load double, ptr %31, align 8, !tbaa !11
  %99 = fmul double %97, %98
  %100 = getelementptr inbounds %class.R3AreaLight, ptr %43, i32 0, i32 4
  %101 = load double, ptr %100, align 8, !tbaa !24
  %102 = load double, ptr %32, align 8, !tbaa !11
  %103 = call double @llvm.fmuladd.f64(double %99, double %101, double %102)
  store double %103, ptr %32, align 8, !tbaa !11
  %104 = load double, ptr %32, align 8, !tbaa !11
  %105 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %106 = call noundef i32 @_Z12RNIsPositivedd(double noundef %104, double noundef %105)
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %112

108:                                              ; preds = %75
  %109 = load double, ptr %32, align 8, !tbaa !11
  %110 = load double, ptr %30, align 8, !tbaa !11
  %111 = fdiv double %110, %109
  store double %111, ptr %30, align 8, !tbaa !11
  br label %112

112:                                              ; preds = %108, %75
  call void @llvm.lifetime.start.p0(i64 24, ptr %33) #7
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %33, ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %113)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %114, ptr noundef nonnull align 8 dereferenceable(24) %33)
  store double %115, ptr %34, align 8, !tbaa !11
  %116 = load double, ptr %34, align 8, !tbaa !11
  %117 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %118 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %116, double noundef %117)
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %112
  call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @RNblack_rgb)
  store i32 1, ptr %14, align 4
  br label %143

121:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 24, ptr %35) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %36) #7
  %122 = load double, ptr %34, align 8, !tbaa !11
  %123 = fmul double 2.000000e+00, %122
  %124 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %36, double noundef %123, ptr noundef nonnull align 8 dereferenceable(24) %124)
  call void @_ZmiRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %35, ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(24) %33)
  call void @llvm.lifetime.end.p0(i64 24, ptr %36) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %37) #7
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %37, ptr noundef nonnull align 8 dereferenceable(24) %125, ptr noundef nonnull align 8 dereferenceable(24) %126)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %37)
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #7
  %127 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 8 dereferenceable(24) %35)
  store double %127, ptr %38, align 8, !tbaa !11
  %128 = load double, ptr %38, align 8, !tbaa !11
  %129 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %130 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %128, double noundef %129)
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %133

132:                                              ; preds = %121
  store i32 4, ptr %14, align 4
  br label %142

133:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 24, ptr %39) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %40) #7
  %134 = load double, ptr %30, align 8, !tbaa !11
  %135 = load double, ptr %38, align 8, !tbaa !11
  %136 = load double, ptr %16, align 8, !tbaa !11
  %137 = call double @pow(double noundef %135, double noundef %136) #7
  %138 = fmul double %134, %137
  %139 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZmldRK5RNRgb(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %40, double noundef %138, ptr noundef nonnull align 8 dereferenceable(24) %139)
  %140 = load ptr, ptr %17, align 8, !tbaa !5
  call void @_ZmlRK5RNRgbS1_(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %39, ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(24) %140)
  %141 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5RNRgbpLERKS_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %39)
  call void @llvm.lifetime.end.p0(i64 24, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %39) #7
  store i32 0, ptr %14, align 4
  br label %142

142:                                              ; preds = %133, %132
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %35) #7
  br label %143

143:                                              ; preds = %142, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #7
  br label %144

144:                                              ; preds = %143, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  %145 = load i32, ptr %14, align 4
  switch i32 %145, label %150 [
    i32 0, label %146
    i32 4, label %147
  ]

146:                                              ; preds = %144
  br label %147

147:                                              ; preds = %146, %144
  %148 = load i32, ptr %24, align 4, !tbaa !9
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %24, align 4, !tbaa !9
  br label %58, !llvm.loop !25

150:                                              ; preds = %144, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  %151 = load i32, ptr %14, align 4
  switch i32 %151, label %163 [
    i32 2, label %152
  ]

152:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #7
  %153 = getelementptr inbounds %class.R3AreaLight, ptr %43, i32 0, i32 1
  %154 = call noundef double @_ZNK8R3Circle4AreaEv(ptr noundef nonnull align 8 dereferenceable(72) %153)
  store double %154, ptr %41, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %42) #7
  call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %42, ptr noundef nonnull align 8 dereferenceable(24) %23)
  %155 = load i32, ptr %22, align 4, !tbaa !9
  %156 = icmp sgt i32 %155, 0
  br i1 %156, label %157, label %161

157:                                              ; preds = %152
  %158 = load i32, ptr %22, align 4, !tbaa !9
  %159 = sitofp i32 %158 to double
  %160 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5RNRgbdVEd(ptr noundef nonnull align 8 dereferenceable(24) %42, double noundef %159)
  br label %161

161:                                              ; preds = %157, %152
  %162 = load double, ptr %41, align 8, !tbaa !11
  call void @_ZmldRK5RNRgb(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %0, double noundef %162, ptr noundef nonnull align 8 dereferenceable(24) %42)
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #7
  br label %163

163:                                              ; preds = %161, %150
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %164

164:                                              ; preds = %163, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  ret void
}

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

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

declare void @_ZmiRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #6

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { 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 #7 = { 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 = !{!"double", !7, i64 0}
!13 = !{!14, !12, i64 152}
!14 = !{!"_ZTS11R3AreaLight", !15, i64 0, !17, i64 80, !12, i64 152, !12, i64 160, !12, i64 168}
!15 = !{!"_ZTS7R3Light", !6, i64 8, !10, i64 16, !6, i64 24, !10, i64 32, !12, i64 40, !16, i64 48, !10, i64 72}
!16 = !{!"_ZTS5RNRgb", !7, i64 0}
!17 = !{!"_ZTS8R3Circle", !18, i64 0, !20, i64 8, !12, i64 32, !21, i64 40}
!18 = !{!"_ZTS9R3Surface", !19, i64 0}
!19 = !{!"_ZTS7R3Shape"}
!20 = !{!"_ZTS7R3Point", !7, i64 0}
!21 = !{!"_ZTS7R3Plane", !22, i64 0, !12, i64 24}
!22 = !{!"_ZTS8R3Vector", !7, i64 0}
!23 = !{!14, !12, i64 160}
!24 = !{!14, !12, i64 168}
!25 = distinct !{!25, !26}
!26 = !{!"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.R3Triad = type { [3 x %class.R3Vector] }
%class.R3Vector = type { [3 x double] }
%class.RNRgb = type { [3 x double] }
%class.R3Point = type { [3 x double] }

@R3xyz_triad = external global %class.R3Triad, align 8
@RN_EPSILON = external local_unnamed_addr global double, align 8
@RNblack_rgb = external global %class.RNRgb, align 8

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK11R3AreaLight6RadiusEv(ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3AreaLight8PositionEv(ptr noundef nonnull align 8 dereferenceable(176)) 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) #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK8R3Circle6NormalEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #0 align 2

declare void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

declare noundef i32 @_ZNK8R3Vector12MinDimensionEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

declare void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #0 align 2

declare void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

declare noundef double @_Z14RNRandomScalarv() local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

declare void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmldRK8R3Vector(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

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

declare void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

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

declare noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef, double noundef) local_unnamed_addr #2

declare noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12RNIsPositivedd(double noundef, double noundef) local_unnamed_addr #2

declare noundef double @_ZNK8R3Circle4AreaEv(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #3

declare void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3

; 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 #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmlRK5RNRgbS1_(ptr dead_on_unwind noalias writable sret(%class.RNRgb) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmldRK5RNRgb(ptr dead_on_unwind noalias writable sret(%class.RNRgb) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN5RNRgbpLERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN5RNRgbdVEd(ptr noundef nonnull align 8 dereferenceable(24), double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK11R3AreaLight18SpecularReflectionERK6R3BrdfRK7R3PointS5_RK8R3Vector(ptr dead_on_unwind noalias writable sret(%class.RNRgb) align 8 %0, ptr noundef nonnull align 8 dereferenceable(176) %1, ptr noundef nonnull align 8 dereferenceable(180) %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5) unnamed_addr #5 align 2 {
  %7 = alloca %class.R3Vector, align 8
  %8 = alloca %class.R3Vector, align 8
  %9 = alloca %class.R3Vector, align 8
  %10 = alloca %class.RNRgb, align 8
  %11 = alloca %class.R3Point, align 8
  %12 = alloca %class.R3Vector, align 8
  %13 = alloca %class.R3Vector, align 8
  %14 = alloca %class.R3Vector, align 8
  %15 = alloca %class.R3Vector, align 8
  %16 = alloca %class.R3Vector, align 8
  %17 = alloca %class.R3Vector, align 8
  %18 = alloca %class.RNRgb, align 8
  %19 = alloca %class.RNRgb, align 8
  %20 = alloca %class.RNRgb, align 8
  %21 = tail call noundef i32 @_ZNK7R3Light8IsActiveEv(ptr noundef nonnull align 8 dereferenceable(76) %1)
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %22, label %23

22:                                               ; preds = %6
  tail call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @RNblack_rgb)
  br label %85

23:                                               ; preds = %6
  %24 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Brdf8SpecularEv(ptr noundef nonnull align 8 dereferenceable(180) %2)
  %25 = tail call noundef double @_ZNK6R3Brdf9ShininessEv(ptr noundef nonnull align 8 dereferenceable(180) %2)
  %26 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Light5ColorEv(ptr noundef nonnull align 8 dereferenceable(76) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  %27 = getelementptr inbounds i8, ptr %1, i64 80
  %28 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK8R3Circle6NormalEv(ptr noundef nonnull align 8 dereferenceable(72) %27)
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %28)
  %29 = call noundef i32 @_ZNK8R3Vector12MinDimensionEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  %30 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) @R3xyz_triad, i32 noundef %29)
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %30)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) @RNblack_rgb)
  %31 = getelementptr inbounds i8, ptr %1, i64 152
  %32 = getelementptr inbounds i8, ptr %1, i64 160
  %33 = getelementptr inbounds i8, ptr %1, i64 168
  br label %34

34:                                               ; preds = %23, %.thread
  %.03957 = phi i32 [ 0, %23 ], [ %.14049, %.thread ]
  %.04256 = phi i32 [ 0, %23 ], [ %75, %.thread ]
  %35 = call noundef double @_Z14RNRandomScalarv()
  %36 = call double @llvm.fmuladd.f64(double %35, double 2.000000e+00, double -1.000000e+00)
  %37 = call noundef double @_Z14RNRandomScalarv()
  %38 = call double @llvm.fmuladd.f64(double %37, double 2.000000e+00, double -1.000000e+00)
  %39 = fmul double %38, %38
  %40 = call double @llvm.fmuladd.f64(double %36, double %36, double %39)
  %41 = fcmp ogt double %40, 1.000000e+00
  br i1 %41, label %.thread, label %42

42:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #7
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3AreaLight8PositionEv(ptr noundef nonnull align 8 dereferenceable(176) %1)
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %43)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #7
  %44 = call noundef double @_ZNK11R3AreaLight6RadiusEv(ptr noundef nonnull align 8 dereferenceable(176) %1)
  %45 = fmul double %36, %44
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %12, double noundef %45, ptr noundef nonnull align 8 dereferenceable(24) %8)
  %46 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  %47 = call noundef double @_ZNK11R3AreaLight6RadiusEv(ptr noundef nonnull align 8 dereferenceable(176) %1)
  %48 = fmul double %38, %47
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %13, double noundef %48, ptr noundef nonnull align 8 dereferenceable(24) %9)
  %49 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  %50 = add nsw i32 %.03957, 1
  %51 = call noundef double @_ZNK7R3Light9IntensityEv(ptr noundef nonnull align 8 dereferenceable(76) %1)
  %52 = call noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %11)
  %53 = load double, ptr %31, align 8, !tbaa !5
  %54 = load double, ptr %32, align 8, !tbaa !20
  %55 = call double @llvm.fmuladd.f64(double %52, double %54, double %53)
  %56 = fmul double %52, %52
  %57 = load double, ptr %33, align 8, !tbaa !21
  %58 = call double @llvm.fmuladd.f64(double %56, double %57, double %55)
  %59 = load double, ptr @RN_EPSILON, align 8, !tbaa !22
  %60 = call noundef i32 @_Z12RNIsPositivedd(double noundef %58, double noundef %59)
  %.not44 = icmp eq i32 %60, 0
  %61 = fdiv double %51, %58
  %.043 = select i1 %.not44, double %51, double %61
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #7
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %4)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
  %62 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %14)
  %63 = load double, ptr @RN_EPSILON, align 8, !tbaa !22
  %64 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %62, double noundef %63)
  %.not45 = icmp eq i32 %64, 0
  br i1 %.not45, label %65, label %76

65:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #7
  %66 = fmul double %62, 2.000000e+00
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %16, double noundef %66, ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @_ZmiRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #7
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %17, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17)
  %67 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %15)
  %68 = load double, ptr @RN_EPSILON, align 8, !tbaa !22
  %69 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %67, double noundef %68)
  %.not46 = icmp eq i32 %69, 0
  br i1 %.not46, label %70, label %74

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %19) #7
  %71 = call double @pow(double noundef %67, double noundef %25) #7
  %72 = fmul double %.043, %71
  call void @_ZmldRK5RNRgb(ptr dead_on_unwind nonnull writable sret(%class.RNRgb) align 8 %19, double noundef %72, ptr noundef nonnull align 8 dereferenceable(24) %24)
  call void @_ZmlRK5RNRgbS1_(ptr dead_on_unwind nonnull writable sret(%class.RNRgb) align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %26)
  %73 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5RNRgbpLERKS_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %18)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #7
  br label %74

74:                                               ; preds = %70, %65
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  br label %.thread

.thread:                                          ; preds = %34, %74
  %.14049 = phi i32 [ %50, %74 ], [ %.03957, %34 ]
  %75 = add nuw nsw i32 %.04256, 1
  %exitcond = icmp eq i32 %75, 8
  br i1 %exitcond, label %77, label %34, !llvm.loop !23

76:                                               ; preds = %42
  call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @RNblack_rgb)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  br label %84

77:                                               ; preds = %.thread
  %78 = call noundef double @_ZNK8R3Circle4AreaEv(ptr noundef nonnull align 8 dereferenceable(72) %27)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %20) #7
  call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %10)
  %79 = icmp sgt i32 %.14049, 0
  br i1 %79, label %80, label %83

80:                                               ; preds = %77
  %81 = uitofp nneg i32 %.14049 to double
  %82 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5RNRgbdVEd(ptr noundef nonnull align 8 dereferenceable(24) %20, double noundef %81)
  br label %83

83:                                               ; preds = %80, %77
  call void @_ZmldRK5RNRgb(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %0, double noundef %78, ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %20) #7
  br label %84

84:                                               ; preds = %76, %83
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  br label %85

85:                                               ; preds = %84, %22
  ret void
}

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

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

declare void @_ZmiRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #6

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(write) "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 #7 = { 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, !12, i64 152}
!6 = !{!"_ZTS11R3AreaLight", !7, i64 0, !14, i64 80, !12, i64 152, !12, i64 160, !12, i64 168}
!7 = !{!"_ZTS7R3Light", !8, i64 8, !11, i64 16, !8, i64 24, !11, i64 32, !12, i64 40, !13, i64 48, !11, i64 72}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"double", !9, i64 0}
!13 = !{!"_ZTS5RNRgb", !9, i64 0}
!14 = !{!"_ZTS8R3Circle", !15, i64 0, !17, i64 8, !12, i64 32, !18, i64 40}
!15 = !{!"_ZTS9R3Surface", !16, i64 0}
!16 = !{!"_ZTS7R3Shape"}
!17 = !{!"_ZTS7R3Point", !9, i64 0}
!18 = !{!"_ZTS7R3Plane", !19, i64 0, !12, i64 24}
!19 = !{!"_ZTS8R3Vector", !9, i64 0}
!20 = !{!6, !12, i64 160}
!21 = !{!6, !12, i64 168}
!22 = !{!12, !12, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass