; 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 @_ZNK11R3AreaLight9DirectionEv(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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK8R3Circle5PlaneEv(ptr noundef nonnull align 8 dereferenceable(72)) #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

declare void @_ZngRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK11R3AreaLight17DiffuseReflectionERK6R3BrdfRK7R3PointRK8R3Vector(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) unnamed_addr #5 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %class.R3Vector, align 8
  %16 = alloca i32, align 4
  %17 = alloca %class.R3Vector, align 8
  %18 = alloca %class.R3Vector, align 8
  %19 = alloca i32, align 4
  %20 = alloca %class.RNRgb, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca %class.R3Point, align 8
  %24 = alloca %class.R3Vector, align 8
  %25 = alloca %class.R3Vector, align 8
  %26 = alloca %class.R3Vector, align 8
  %27 = alloca double, align 8
  %28 = alloca %class.R3Vector, align 8
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca %class.RNRgb, align 8
  %33 = alloca %class.RNRgb, align 8
  %34 = alloca double, align 8
  %35 = alloca %class.RNRgb, align 8
  store ptr %0, ptr %6, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %36 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 4, ptr %11, align 4, !tbaa !9
  %37 = call noundef i32 @_ZNK7R3Light8IsActiveEv(ptr noundef nonnull align 8 dereferenceable(76) %36)
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %40, label %39

39:                                               ; preds = %5
  call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @RNblack_rgb)
  store i32 1, ptr %12, align 4
  br label %151

40:                                               ; preds = %5
  %41 = getelementptr inbounds %class.R3AreaLight, ptr %36, i32 0, i32 1
  %42 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK8R3Circle5PlaneEv(ptr noundef nonnull align 8 dereferenceable(72) %41)
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %42, ptr noundef nonnull align 8 dereferenceable(24) %43)
  %45 = fcmp ole double %44, 0.000000e+00
  br i1 %45, label %46, label %47

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

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

56:                                               ; preds = %138, %136, %47
  %57 = load i32, ptr %19, align 4, !tbaa !9
  %58 = icmp slt i32 %57, 4
  br i1 %58, label %59, label %139

59:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %60 = call noundef double @_Z14RNRandomScalarv()
  %61 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %60, double -1.000000e+00)
  store double %61, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %62 = call noundef double @_Z14RNRandomScalarv()
  %63 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %62, double -1.000000e+00)
  store double %63, ptr %22, align 8, !tbaa !11
  %64 = load double, ptr %21, align 8, !tbaa !11
  %65 = load double, ptr %21, align 8, !tbaa !11
  %66 = load double, ptr %22, align 8, !tbaa !11
  %67 = load double, ptr %22, align 8, !tbaa !11
  %68 = fmul double %66, %67
  %69 = call double @llvm.fmuladd.f64(double %64, double %65, double %68)
  %70 = fcmp ogt double %69, 1.000000e+00
  br i1 %70, label %71, label %72

71:                                               ; preds = %59
  store i32 2, ptr %12, align 4
  br label %136, !llvm.loop !13

72:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #6
  %73 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3AreaLight8PositionEv(ptr noundef nonnull align 8 dereferenceable(176) %36)
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %73)
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #6
  %74 = load double, ptr %21, align 8, !tbaa !11
  %75 = call noundef double @_ZNK11R3AreaLight6RadiusEv(ptr noundef nonnull align 8 dereferenceable(176) %36)
  %76 = fmul double %74, %75
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %24, double noundef %76, ptr noundef nonnull align 8 dereferenceable(24) %17)
  %77 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %24)
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #6
  %78 = load double, ptr %22, align 8, !tbaa !11
  %79 = call noundef double @_ZNK11R3AreaLight6RadiusEv(ptr noundef nonnull align 8 dereferenceable(176) %36)
  %80 = fmul double %78, %79
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %25, double noundef %80, ptr noundef nonnull align 8 dereferenceable(24) %18)
  %81 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %25)
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #6
  %82 = load i32, ptr %19, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #6
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %26, ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %84)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26)
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %85 = call noundef double @_ZNK7R3Light9IntensityEv(ptr noundef nonnull align 8 dereferenceable(76) %36)
  %86 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3AreaLight9DirectionEv(ptr noundef nonnull align 8 dereferenceable(176) %36)
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #6
  call void @_ZngRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %28, ptr noundef nonnull align 8 dereferenceable(24) %26)
  %87 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %86, ptr noundef nonnull align 8 dereferenceable(24) %28)
  %88 = fmul double %85, %87
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #6
  store double %88, ptr %27, align 8, !tbaa !11
  %89 = load double, ptr %27, align 8, !tbaa !11
  %90 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %91 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %89, double noundef %90)
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %94

93:                                               ; preds = %72
  call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @RNblack_rgb)
  store i32 1, ptr %12, align 4
  br label %135

94:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = call noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %95, ptr noundef nonnull align 8 dereferenceable(24) %23)
  store double %96, ptr %29, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %97 = getelementptr inbounds %class.R3AreaLight, ptr %36, i32 0, i32 2
  %98 = load double, ptr %97, align 8, !tbaa !15
  store double %98, ptr %30, align 8, !tbaa !11
  %99 = load double, ptr %29, align 8, !tbaa !11
  %100 = getelementptr inbounds %class.R3AreaLight, ptr %36, i32 0, i32 3
  %101 = load double, ptr %100, align 8, !tbaa !25
  %102 = load double, ptr %30, align 8, !tbaa !11
  %103 = call double @llvm.fmuladd.f64(double %99, double %101, double %102)
  store double %103, ptr %30, align 8, !tbaa !11
  %104 = load double, ptr %29, align 8, !tbaa !11
  %105 = load double, ptr %29, align 8, !tbaa !11
  %106 = fmul double %104, %105
  %107 = getelementptr inbounds %class.R3AreaLight, ptr %36, i32 0, i32 4
  %108 = load double, ptr %107, align 8, !tbaa !26
  %109 = load double, ptr %30, align 8, !tbaa !11
  %110 = call double @llvm.fmuladd.f64(double %106, double %108, double %109)
  store double %110, ptr %30, align 8, !tbaa !11
  %111 = load double, ptr %30, align 8, !tbaa !11
  %112 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %113 = call noundef i32 @_Z12RNIsPositivedd(double noundef %111, double noundef %112)
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %119

115:                                              ; preds = %94
  %116 = load double, ptr %30, align 8, !tbaa !11
  %117 = load double, ptr %27, align 8, !tbaa !11
  %118 = fdiv double %117, %116
  store double %118, ptr %27, align 8, !tbaa !11
  br label %119

119:                                              ; preds = %115, %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  %120 = load ptr, ptr %10, align 8, !tbaa !5
  %121 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %120, ptr noundef nonnull align 8 dereferenceable(24) %26)
  store double %121, ptr %31, align 8, !tbaa !11
  %122 = load double, ptr %31, align 8, !tbaa !11
  %123 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %124 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %122, double noundef %123)
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %127

126:                                              ; preds = %119
  store i32 2, ptr %12, align 4
  br label %134, !llvm.loop !13

127:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 24, ptr %32) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %33) #6
  %128 = load double, ptr %27, align 8, !tbaa !11
  %129 = load double, ptr %31, align 8, !tbaa !11
  %130 = fmul double %128, %129
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZmldRK5RNRgb(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %33, double noundef %130, ptr noundef nonnull align 8 dereferenceable(24) %131)
  %132 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZmlRK5RNRgbS1_(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %32, ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 8 dereferenceable(24) %132)
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #6
  %133 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5RNRgbpLERKS_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %32)
  call void @llvm.lifetime.end.p0(i64 24, ptr %32) #6
  store i32 0, ptr %12, align 4
  br label %134

134:                                              ; preds = %127, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  br label %135

135:                                              ; preds = %134, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #6
  br label %136

136:                                              ; preds = %135, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  %137 = load i32, ptr %12, align 4
  switch i32 %137, label %150 [
    i32 0, label %138
    i32 2, label %56
  ]

138:                                              ; preds = %136
  br label %56, !llvm.loop !13

139:                                              ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  %140 = getelementptr inbounds %class.R3AreaLight, ptr %36, i32 0, i32 1
  %141 = call noundef double @_ZNK8R3Circle4AreaEv(ptr noundef nonnull align 8 dereferenceable(72) %140)
  store double %141, ptr %34, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %35) #6
  call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %35, ptr noundef nonnull align 8 dereferenceable(24) %20)
  %142 = load i32, ptr %19, align 4, !tbaa !9
  %143 = icmp sgt i32 %142, 0
  br i1 %143, label %144, label %148

144:                                              ; preds = %139
  %145 = load i32, ptr %19, align 4, !tbaa !9
  %146 = sitofp i32 %145 to double
  %147 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5RNRgbdVEd(ptr noundef nonnull align 8 dereferenceable(24) %35, double noundef %146)
  br label %148

148:                                              ; preds = %144, %139
  %149 = load double, ptr %34, align 8, !tbaa !11
  call void @_ZmldRK5RNRgb(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %0, double noundef %149, ptr noundef nonnull align 8 dereferenceable(24) %35)
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  br label %150

150:                                              ; preds = %148, %136
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %151

151:                                              ; preds = %150, %46, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  ret void
}

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 @_ZNK6R3Brdf7DiffuseEv(ptr noundef nonnull align 8 dereferenceable(180)) #2 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)) #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

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 }

!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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !12, i64 152}
!16 = !{!"_ZTS11R3AreaLight", !17, i64 0, !19, i64 80, !12, i64 152, !12, i64 160, !12, i64 168}
!17 = !{!"_ZTS7R3Light", !6, i64 8, !10, i64 16, !6, i64 24, !10, i64 32, !12, i64 40, !18, i64 48, !10, i64 72}
!18 = !{!"_ZTS5RNRgb", !7, i64 0}
!19 = !{!"_ZTS8R3Circle", !20, i64 0, !22, i64 8, !12, i64 32, !23, i64 40}
!20 = !{!"_ZTS9R3Surface", !21, i64 0}
!21 = !{!"_ZTS7R3Shape"}
!22 = !{!"_ZTS7R3Point", !7, i64 0}
!23 = !{!"_ZTS7R3Plane", !24, i64 0, !12, i64 24}
!24 = !{!"_ZTS8R3Vector", !7, i64 0}
!25 = !{!16, !12, i64 160}
!26 = !{!16, !12, i64 168}


; 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 @_ZNK11R3AreaLight9DirectionEv(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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK8R3Circle5PlaneEv(ptr noundef nonnull align 8 dereferenceable(72)) 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

declare void @_ZngRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK11R3AreaLight17DiffuseReflectionERK6R3BrdfRK7R3PointRK8R3Vector(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) unnamed_addr #5 align 2 {
  %6 = alloca %class.R3Vector, align 8
  %7 = alloca %class.R3Vector, align 8
  %8 = alloca %class.R3Vector, align 8
  %9 = alloca %class.RNRgb, align 8
  %10 = alloca %class.R3Point, align 8
  %11 = alloca %class.R3Vector, align 8
  %12 = alloca %class.R3Vector, align 8
  %13 = alloca %class.R3Vector, align 8
  %14 = alloca %class.R3Vector, align 8
  %15 = alloca %class.RNRgb, align 8
  %16 = alloca %class.RNRgb, align 8
  %17 = alloca %class.RNRgb, align 8
  %18 = tail call noundef i32 @_ZNK7R3Light8IsActiveEv(ptr noundef nonnull align 8 dereferenceable(76) %1)
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %19, label %20

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

20:                                               ; preds = %5
  %21 = getelementptr inbounds i8, ptr %1, i64 80
  %22 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK8R3Circle5PlaneEv(ptr noundef nonnull align 8 dereferenceable(72) %21)
  %23 = tail call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef nonnull align 8 dereferenceable(24) %3)
  %24 = fcmp ugt double %23, 0.000000e+00
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %20
  %27 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Brdf7DiffuseEv(ptr noundef nonnull align 8 dereferenceable(180) %2)
  %28 = 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 %6) #6
  %29 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK8R3Circle6NormalEv(ptr noundef nonnull align 8 dereferenceable(72) %21)
  call void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %29)
  %30 = call noundef i32 @_ZNK8R3Vector12MinDimensionEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  %31 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) @R3xyz_triad, i32 noundef %30)
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %7, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %31)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) @RNblack_rgb)
  %32 = getelementptr inbounds i8, ptr %1, i64 152
  %33 = getelementptr inbounds i8, ptr %1, i64 160
  %34 = getelementptr inbounds i8, ptr %1, i64 168
  br label %35

35:                                               ; preds = %26, %.backedge
  %.03239 = phi i32 [ 0, %26 ], [ %.13344, %.backedge ]
  %36 = call noundef double @_Z14RNRandomScalarv()
  %37 = call double @llvm.fmuladd.f64(double %36, double 2.000000e+00, double -1.000000e+00)
  %38 = call noundef double @_Z14RNRandomScalarv()
  %39 = call double @llvm.fmuladd.f64(double %38, double 2.000000e+00, double -1.000000e+00)
  %40 = fmul double %39, %39
  %41 = call double @llvm.fmuladd.f64(double %37, double %37, double %40)
  %42 = fcmp ogt double %41, 1.000000e+00
  br i1 %42, label %.backedge, label %43, !llvm.loop !5

43:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  %44 = 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) %10, ptr noundef nonnull align 8 dereferenceable(24) %44)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #6
  %45 = call noundef double @_ZNK11R3AreaLight6RadiusEv(ptr noundef nonnull align 8 dereferenceable(176) %1)
  %46 = fmul double %37, %45
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %11, double noundef %46, ptr noundef nonnull align 8 dereferenceable(24) %7)
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #6
  %48 = call noundef double @_ZNK11R3AreaLight6RadiusEv(ptr noundef nonnull align 8 dereferenceable(176) %1)
  %49 = fmul double %39, %48
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %12, double noundef %49, ptr noundef nonnull align 8 dereferenceable(24) %8)
  %50 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointpLERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #6
  %51 = add nsw i32 %.03239, 1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #6
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %13, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  %52 = call noundef double @_ZNK7R3Light9IntensityEv(ptr noundef nonnull align 8 dereferenceable(76) %1)
  %53 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3AreaLight9DirectionEv(ptr noundef nonnull align 8 dereferenceable(176) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #6
  call void @_ZngRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %13)
  %54 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %53, ptr noundef nonnull align 8 dereferenceable(24) %14)
  %55 = fmul double %52, %54
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #6
  %56 = load double, ptr @RN_EPSILON, align 8, !tbaa !7
  %57 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %55, double noundef %56)
  %.not35 = icmp eq i32 %57, 0
  br i1 %.not35, label %58, label %.loopexit.loopexit

58:                                               ; preds = %43
  %59 = call noundef double @_Z10R3DistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %10)
  %60 = load double, ptr %32, align 8, !tbaa !11
  %61 = load double, ptr %33, align 8, !tbaa !23
  %62 = call double @llvm.fmuladd.f64(double %59, double %61, double %60)
  %63 = fmul double %59, %59
  %64 = load double, ptr %34, align 8, !tbaa !24
  %65 = call double @llvm.fmuladd.f64(double %63, double %64, double %62)
  %66 = load double, ptr @RN_EPSILON, align 8, !tbaa !7
  %67 = call noundef i32 @_Z12RNIsPositivedd(double noundef %65, double noundef %66)
  %68 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %13)
  %69 = load double, ptr @RN_EPSILON, align 8, !tbaa !7
  %70 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %68, double noundef %69)
  %.not37 = icmp eq i32 %70, 0
  br i1 %.not37, label %71, label %.thread45, !llvm.loop !5

71:                                               ; preds = %58
  %.not36 = icmp eq i32 %67, 0
  %72 = fdiv double %55, %65
  %.034 = select i1 %.not36, double %55, double %72
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #6
  %73 = fmul double %68, %.034
  call void @_ZmldRK5RNRgb(ptr dead_on_unwind nonnull writable sret(%class.RNRgb) align 8 %16, double noundef %73, ptr noundef nonnull align 8 dereferenceable(24) %27)
  call void @_ZmlRK5RNRgbS1_(ptr dead_on_unwind nonnull writable sret(%class.RNRgb) align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %28)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #6
  %74 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5RNRgbpLERKS_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %15)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #6
  br label %.thread45

.thread45:                                        ; preds = %71, %58
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  br label %.backedge

.backedge:                                        ; preds = %35, %.thread45
  %.13344 = phi i32 [ %51, %.thread45 ], [ %.03239, %35 ]
  %75 = icmp slt i32 %.13344, 4
  br i1 %75, label %35, label %76, !llvm.loop !5

76:                                               ; preds = %.backedge
  %77 = call noundef double @_ZNK8R3Circle4AreaEv(ptr noundef nonnull align 8 dereferenceable(72) %21)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #6
  call void @_ZN5RNRgbC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %9)
  %78 = uitofp nneg i32 %.13344 to double
  %79 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5RNRgbdVEd(ptr noundef nonnull align 8 dereferenceable(24) %17, double noundef %78)
  call void @_ZmldRK5RNRgb(ptr dead_on_unwind writable sret(%class.RNRgb) align 8 %0, double noundef %77, ptr noundef nonnull align 8 dereferenceable(24) %17)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #6
  br label %.loopexit

.loopexit.loopexit:                               ; preds = %43
  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 %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %76
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  br label %80

80:                                               ; preds = %.loopexit, %25, %19
  ret void
}

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 @_ZNK6R3Brdf7DiffuseEv(ptr noundef nonnull align 8 dereferenceable(180)) local_unnamed_addr #2 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 #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

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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !8, i64 152}
!12 = !{!"_ZTS11R3AreaLight", !13, i64 0, !17, i64 80, !8, i64 152, !8, i64 160, !8, i64 168}
!13 = !{!"_ZTS7R3Light", !14, i64 8, !15, i64 16, !14, i64 24, !15, i64 32, !8, i64 40, !16, i64 48, !15, i64 72}
!14 = !{!"any pointer", !9, i64 0}
!15 = !{!"int", !9, i64 0}
!16 = !{!"_ZTS5RNRgb", !9, i64 0}
!17 = !{!"_ZTS8R3Circle", !18, i64 0, !20, i64 8, !8, i64 32, !21, i64 40}
!18 = !{!"_ZTS9R3Surface", !19, i64 0}
!19 = !{!"_ZTS7R3Shape"}
!20 = !{!"_ZTS7R3Point", !9, i64 0}
!21 = !{!"_ZTS7R3Plane", !22, i64 0, !8, i64 24}
!22 = !{!"_ZTS8R3Vector", !9, i64 0}
!23 = !{!12, !8, i64 160}
!24 = !{!12, !8, i64 168}


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